lunatic-python
lunatic-python copied to clipboard
getting lunatic-python to work with luajit
Hi!
I'm trying to use luajit with lunatic-python to access torch from the python side.
I found that I had to make these changes:
- in setup.py, add 'luajit' to the pkgconfig call:
lua_pkgconfig = pkgconfig('luajit', 'lua', 'lua' + LUAVERSION,'python-' + PYTHONVERSION)
instead of
lua_pkgconfig = pkgconfig('lua', 'lua' + LUAVERSION,'python-' + PYTHONVERSION)
- before trying to 'require' packages in lua, load the luajit shared-object with exported symbols:
import ctypes lualib = ctypes.CDLL("libluajit-5.1.so", mode=ctypes.RTLD_GLOBAL)
After which, I can:
lua.execute('require "torch"')
My question is: can anybody suggest a good way to integrate these changes into the repo, so that future users don't have to do this little dance?
Do a pull request?
@micklat I suppose your queestion is: how to make the change without breaking installations for htose not using luajit? (Hmmm, necro award for me :-P)
+1