[tlbuild] LuaTeX extension modules – summary
Philipp Stephani
st_philipp at yahoo.de
Tue May 10 11:54:14 CEST 2011
Hello,
I'd like to summarize the current status on the issue of LuaTeX extension modules.
1. First I think that the ability to load extension modules is useful and important, and that TL's LuaTeX should support it if possible.
2. The ability to load extension modules is present in LuaTeX and works fine as long as a few build-related conditions are met (see below).
3. Ideally, an extension module should work with stock Lua and LuaTeX without separate compilation.
4. I have tested on OS X 10.6.7, Ubuntu 11.04 32-bit, and Windows 7 64-bit. I can't say anything about other systems, but these three and similar systems should already cover a large majority of users.
Now there are a few conditions that have to be fulfilled if extension modules should be supported. These conditions cause several issues (all of which are caused by Autotools or MinGW; compilation itself works smoothly):
1. On Linux, extension modules work out of the box.
2. On OS X, the luatex executable must not be stripped of its symbol table, as discussed in http://tug.org/pipermail/tlbuild/2011q1/001832.html and http://tug.org/pipermail/tlbuild/2011q2/001842.html. In that thread I have proposed a solution.
3. On Windows, there has to be a shared library (preferably named LUA51.DLL like the stock Lua) that exports the Lua interpreter functions, as discussed in http://tug.org/pipermail/tlbuild/2011q2/001871.html. At least on my system, using the stock Lua library instead doesn't work. Unfortunately I'm not experienced enough with Autotools and MinGW to implement this change.
4. For compiling extension modules, the Lua headers and import library (for Windows) have to be present. These might be worth adding to the source/ directory so that extension module authors don't have to install these files manually and they are kept in sync with the actual sources.
It would be great if extension modules were supported in TeX Live. As you see, there are only a small number of build-related issues to fix.
To test whether extension modules work, you can install and test a small module, e.g. lcomplex via luarocks:
luarocks install lcomplex
texlua /dev/fd/0 <<< 'require("complex") print(complex.exp(math.pi*complex.I))'
# should print ~ -1
Philipp
More information about the tlbuild
mailing list