[luatex] Using a Lua C .so module with LuaLaTeX

Deepak Jois deepak.jois at gmail.com
Mon Nov 16 13:13:53 CET 2015

To narrow down the problem, I used the --luaonly option to run a test
lua file with luatex that loads the library. When I run:

luatex --luaonly test.lua

It gives me the error: Symbol not found: _luaL_setfuncs

Then, I built a fresh luatex binary from SVN using --nostrip option,
and ran the same thing, and it works fine.

I then tried to copy the freshly built luatex binary into TeXLive, and
ran fmtutil --all, but it gave me an error saying \pdfoutput was an
undefined control sequence.

So now I am wondering:

1. Why does the luatex binary built from SVN with --nostrip work, and
the luatex binary bundled with TeXLive does not work when using in
--luaonly mode. Is that intentional? On StackExchange[1] there are
people on Linux who report that it working fine with TeXLive 2015 as
well. What is different about Mac OS X?

2. How can I use the freshly built luatex binary with TeXLive 2015. Is
there anything else I need to do before I run fmtutil --all so that
this "undefined control sequence \pdfoutput" will go away.

Thank you

[1]: http://tex.stackexchange.com/questions/278329/symbol-not-found-error-when-using-lua-c-so-module-with-lualatex

On Sun, Nov 15, 2015 at 3:02 PM, Deepak Jois <deepak.jois at gmail.com> wrote:
> I am trying to get a basic Lua C .so module working with LuaLaTeX. I
> have all the pieces in place here. I am able to run the library using
> my local Lua interpreter just fine. But when I try to load it inside
> LuaLaTex, I get the error as shown below.
> My environment: Mac OS X, TeXLive 2015 and Lua 5.2.4.
> The minimal code example is here:
> https://github.com/deepakjois/tex-sandbox/tree/master/luatex-lua-c-bridge
> What am I doing wrong?
> Error Details:
> =====
> This is LuaTeX, Version beta-0.80.0 (TeX Live 2015) (rev 5238)
>  restricted \write18 enabled.
> (./test.tex
> LaTeX2e <2015/01/01>
>> <snip>
>> (./luaharfbuzz.lua)
> ! LuaTeX error error loading module 'harfbuzz' from file './harfbuzz.so':
>         dlopen(./harfbuzz.so, 6): Symbol not found: _luaL_setfuncs
>   Referenced from: ./harfbuzz.so
>   Expected in: flat namespace
>  in ./harfbuzz.so
> stack traceback:
>         [C]: in ?
>         [C]: in ?
>         [C]: in function 'require'
>         ./luaharfbuzz.lua:2: in main chunk
>         [C]: in function 'require'
>         [\directlua]:1: in main chunk.
> \luacode at dbg@exec ...code at maybe@printdbg {#1} #1 }
> l.6 \end{luacode*}
> =====

More information about the luatex mailing list