Re: [NTG-context] Problem loading a DLL with the latest Ctx beta
Hello Akira, I tested ConTeXt run with my DLL module and all works fine. Thank you again! Best regards, Lukas On Sun, 09 Apr 2017 00:23:48 +0200, Akira Kakutowrote: Any way to re-enable user DLL loading into ConTeXt, even in the future, would be appreciated... I have just uploaded dynamically linked luatex and luajittex. I hope that you can again load your lua DLL modules in a few days. Further, standard C functions can be used in ffi without loading a C DLL. For example, my previous example can be changed as follows: % % context test.tex % \starttext \placeformula \startformula j_1(2.387) = \startluacode local ffi = require("ffi") ffi.cdef[[ double _j1(double x); ]] tex.print(ffi.C._j1(2.387)) \stopluacode \stopformula \stoptext Best, Akira ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___ -- Ing. Lukáš Procházka | mailto:l...@pontex.cz Pontex s. r. o. | mailto:pon...@pontex.cz | http://www.pontex.cz | IDDS:nrpt3sn Bezová 1658 147 14 Praha 4 Tel: +420 241 096 751 (+420 720 951 172) Fax: +420 244 461 038 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Problem loading a DLL with the latest Ctx beta
Hello Akira, On Sun, 09 Apr 2017 00:23:48 +0200, Akira Kakutowrote: Any way to re-enable user DLL loading into ConTeXt, even in the future, would be appreciated... I have just uploaded dynamically linked luatex and luajittex. great news, I'll try it in the upcoming week. Thank you. Best regards, Lukas I hope that you can again load your lua DLL modules in a few days. Further, standard C functions can be used in ffi without loading a C DLL. For example, my previous example can be changed as follows: % % context test.tex % \starttext \placeformula \startformula j_1(2.387) = \startluacode local ffi = require("ffi") ffi.cdef[[ double _j1(double x); ]] tex.print(ffi.C._j1(2.387)) \stopluacode \stopformula \stoptext Best, Akira ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___ -- Ing. Lukáš Procházka | mailto:l...@pontex.cz Pontex s. r. o. | mailto:pon...@pontex.cz | http://www.pontex.cz | IDDS:nrpt3sn Bezová 1658 147 14 Praha 4 Tel: +420 241 096 751 (+420 720 951 172) Fax: +420 244 461 038 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Problem loading a DLL with the latest Ctx beta
On 4/6/2017 11:03 AM, Procházka Lukáš Ing. wrote: Hello Akira, you mention possibility of --shell-escape at http://tug.org/pipermail/luatex/2017-March/006410.html. How exactly do you mean to combine "ffi" and "--shell-escape" to work with latest ConTeXt/LuaTeX? (I tried (rather amateurishly) to run "context --shell-escape WinTest.mkiv" - but it didn't help.) context doesn't use --shell-escape (control over executables happens via the sandbox mechanism) BTW: WinCon.dll contains some functions to print COLORED text to the console screen and enables some basic WinAPI functions (like capturing window bitmap) to Lua; I've been using especially colored printing in combination with ConTeXt ("warnings" in magenta, "errors" in red...). local ansicolor = { r = function(s) return "[0;31m" .. s .."[0;1m" end, g = function(s) return "[0;32m" .. s .."[0;1m" end, b = function(s) return "[0;34m" .. s .."[0;1m" end, c = function(s) return "[0;36m" .. s .."[0;1m" end, m = function(s) return "[0;35m" .. s .."[0;1m" end, y = function(s) return "[0;33m" .. s .."[0;1m" end } local formatters = string.formatters utilities.strings.formatters.add(formatters, "cr", [[cr(%s)]], { cr = ansicolor.r }) utilities.strings.formatters.add(formatters, "cg", [[cg(%s)]], { cg = ansicolor.g }) utilities.strings.formatters.add(formatters, "cb", [[cb(%s)]], { cb = ansicolor.b }) utilities.strings.formatters.add(formatters, "cc", [[cc(%s)]], { cc = ansicolor.c }) utilities.strings.formatters.add(formatters, "cm", [[cm(%s)]], { cm = ansicolor.m }) utilities.strings.formatters.add(formatters, "cy", [[cy(%s)]], { cy = ansicolor.y }) print(ansicolor.r("red")) print(ansicolor.g("green")) print(ansicolor.b("blue")) print(ansicolor.c("cyan")) print(ansicolor.m("magenta")) print(ansicolor.y("yellow")) logs.writer(formatters["this is in %!cr! or %!cg! or %!cb! or %s"]("red","green","blue","oeps")) logs.report("whatever","this is in %!cr! or %!cg! or %!cb! or %s","red","green","blue","oeps") (you can also use mtxrun --ansi ) Any way to re-enable user DLL loading into ConTeXt, even in the future, would be appreciated... Best regards, Lukas On Thu, 06 Apr 2017 00:05:28 +0200, Akira Kakutowrote: I encountered problem loading WinCon.dll (a module that I wrote and I've been using for several years) In the new lua(jit)tex, one cannot use DLL modules. See my mail in http://tug.org/pipermail/luatex/2017-March/006410.html http://tug.org/pipermail/luatex/2017-March/006413.html Reason: I could not build usable binaries for the new sources by linking dynamically lua-5.2.4 or luajit. Thus I changed to link lua-5.2.4 etc. statically. Best, Akira ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___ -- - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Problem loading a DLL with the latest Ctx beta
Hello Akira, you mention possibility of --shell-escape at http://tug.org/pipermail/luatex/2017-March/006410.html. How exactly do you mean to combine "ffi" and "--shell-escape" to work with latest ConTeXt/LuaTeX? (I tried (rather amateurishly) to run "context --shell-escape WinTest.mkiv" - but it didn't help.) BTW: WinCon.dll contains some functions to print COLORED text to the console screen and enables some basic WinAPI functions (like capturing window bitmap) to Lua; I've been using especially colored printing in combination with ConTeXt ("warnings" in magenta, "errors" in red...). Any way to re-enable user DLL loading into ConTeXt, even in the future, would be appreciated... Best regards, Lukas On Thu, 06 Apr 2017 00:05:28 +0200, Akira Kakutowrote: I encountered problem loading WinCon.dll (a module that I wrote and I've been using for several years) In the new lua(jit)tex, one cannot use DLL modules. See my mail in http://tug.org/pipermail/luatex/2017-March/006410.html http://tug.org/pipermail/luatex/2017-March/006413.html Reason: I could not build usable binaries for the new sources by linking dynamically lua-5.2.4 or luajit. Thus I changed to link lua-5.2.4 etc. statically. Best, Akira ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___ -- Ing. Lukáš Procházka | mailto:l...@pontex.cz Pontex s. r. o. | mailto:pon...@pontex.cz | http://www.pontex.cz | IDDS:nrpt3sn Bezová 1658 147 14 Praha 4 Tel: +420 241 096 751 (+420 720 951 172) Fax: +420 244 461 038 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Problem loading a DLL with the latest Ctx beta
On 4/5/2017 5:49 PM, Procházka Lukáš Ing. wrote: Hello, On Wed, 05 Apr 2017 17:02:01 +0200, Hans Hagenwrote: On 4/5/2017 4:12 PM, Procházka Lukáš Ing. wrote: Just to ensure that I'm not trying to use 32b WinCon.dll with 64b Ctx/LuaTeX... os.platform will it retrieve OS platform or LuaTeX (= executable) platform? Which compiler is used to build LuaTeX for Windows? probably the regular microsoft one OK, probably VS, but which version? i don't know ... probably recent .. compilation of native windows binaries is done by akira kakuto as part of the cjk windows distribuition cq. tex live and the garden takes his binaries why don't you just try to recompile? Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Problem loading a DLL with the latest Ctx beta
Hello, On Wed, 05 Apr 2017 17:02:01 +0200, Hans Hagenwrote: On 4/5/2017 4:12 PM, Procházka Lukáš Ing. wrote: Just to ensure that I'm not trying to use 32b WinCon.dll with 64b Ctx/LuaTeX... os.platform will it retrieve OS platform or LuaTeX (= executable) platform? Which compiler is used to build LuaTeX for Windows? probably the regular microsoft one OK, probably VS, but which version? Lukas Hans -- Ing. Lukáš Procházka | mailto:l...@pontex.cz Pontex s. r. o. | mailto:pon...@pontex.cz | http://www.pontex.cz | IDDS:nrpt3sn Bezová 1658 147 14 Praha 4 Tel: +420 241 096 751 (+420 720 951 172) Fax: +420 244 461 038 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Problem loading a DLL with the latest Ctx beta
On 4/5/2017 4:12 PM, Procházka Lukáš Ing. wrote: Just to ensure that I'm not trying to use 32b WinCon.dll with 64b Ctx/LuaTeX... os.platform Which compiler is used to build LuaTeX for Windows? probably the regular microsoft one Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Problem loading a DLL with the latest Ctx beta
Hello, On Wed, 05 Apr 2017 15:06:08 +0200, Hans Hagenwrote: On 4/5/2017 2:29 PM, Procházka Lukáš Ing. wrote: Strange thing is that WonCon.dll with Ctx used to work for several years... What is the problem now? Probably an updated compiler ... after all, vs 2008 is 8 years old which is real old in computer times). Maybe you miss another ancient dll (can be checked with dll checkers). Maybe... But I've VS 2008 installed again on the comp I'm using now, so - at least for me - all DLLs should exist on my comp (for other comps, there is free VS 2008 Redistributable Package), so that shouldn't be a problem. Would Ctx and LuaTeX write info about its binary architecture, so that '--version' shows "x86" or "64b", too? Just to ensure that I'm not trying to use 32b WinCon.dll with 64b Ctx/LuaTeX... I attached also the WinCon.dll (built with VS 2008 - Release version; zipped and ZIP renamed to PIZ). I'm surprised that this passed the mail server. Do I have to rebuild the WinCon.dll source? Why not just try that? Which compiler is used to build LuaTeX for Windows? Best regards, Lukas Hans ps. Version 1.0.5 is not official i.e. it's the ctx meeting version. We're at 1.0.4 now. - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___ -- Ing. Lukáš Procházka | mailto:l...@pontex.cz Pontex s. r. o. | mailto:pon...@pontex.cz | http://www.pontex.cz | IDDS:nrpt3sn Bezová 1658 147 14 Praha 4 Tel: +420 241 096 751 (+420 720 951 172) Fax: +420 244 461 038 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Problem loading a DLL with the latest Ctx beta
On 4/5/2017 2:29 PM, Procházka Lukáš Ing. wrote: Strange thing is that WonCon.dll with Ctx used to work for several years... What is the problem now? Probably an updated compiler ... after all, vs 2008 is 8 years old which is real old in computer times). Maybe you miss another ancient dll (can be checked with dll checkers). I attached also the WinCon.dll (built with VS 2008 - Release version; zipped and ZIP renamed to PIZ). I'm surprised that this passed the mail server. Do I have to rebuild the WinCon.dll source? Why not just try that? Hans ps. Version 1.0.5 is not official i.e. it's the ctx meeting version. We're at 1.0.4 now. - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___