[luatex] Linking to C libraries / TL2017 / FFI

luigi scarso luigi.scarso at gmail.com
Wed Apr 19 21:04:50 CEST 2017


On Wed, Apr 19, 2017 at 10:55 AM, Patrick Gundlach <patrick at gundla.ch> wrote:
> Hello all,
>
> I have a (probably very dumb) question regarding the new TeXlive 2017. I'd like to link C-libraries (actually written in Go, but I would start with simple cases first) to LuaTeX, without recompiling. I believe this is possible with the new LuaTeX. Is this correct? Is this supported on Mac, Linux and Windows? Is this related to ffi?
>
> If this is possible: is there a small howto somewhere?
luatex 1.0.4 has a ffi module which aims to be compatible with  luajit ffi as in
http://luajit.org/ext_ffi.html
so, if you have a C so/dll  you can load it in luatex, but you have
also to provide an "interface "
(see, for example Accessing the zlib Compression Library in
http://luajit.org/ext_ffi_tutorial.html  )

I don't know if the luatex binary of the  Mac is compiled with the
right switches, but in build.sh
strip -u -r -A -n
should do the work
(at least it was the last time I have  cross-compiled for mac).
-- 
luigi



More information about the luatex mailing list