[luatex] Linking to C libraries / TL2017 / FFI

Patrick Gundlach patrick at gundla.ch
Sun Apr 23 19:39:27 CEST 2017


Thanks Luigi for the test file, this works fine on tl2017 and tl2016 (Mac).

My test file (shorter one below) works on tl2016 but _not_ on tl2017 (Mac and Linux). Is this on purpose?


------------------------------------
\documentclass{article}
\usepackage{luacode}
\begin{document}
\begin{luacode*}
ffi = require('ffi')

ffi.cdef[[
int printf(const char *fmt, ...);
]]
ffi.C.printf("Hello %s!", "world")

\end{luacode*}
\end{document}
------------------------------------

(tl2017) $ luajitlatex test
...
(./test.aux)[\directlua]:5: attempt to call field 'cdef' (a nil value)
stack traceback:
	[\directlua]:5: in main chunk.
\luacode at dbg@exec ...code at maybe@printdbg {#1} #1 }
...



(tl2016) $ luajitlatex test
...
(./test.aux)Hello world! (./test.aux))
 349 words of node memory still in use:
   2 hlist, 1 vlist, 1 rule, 7 glue, 39 glue_spec, 2 write nodes
   avail lists: 2:12,3:1,4:1,5:4,7:1,8:1,9:1
...


Patrick





More information about the luatex mailing list