lunatic-python icon indicating copy to clipboard operation
lunatic-python copied to clipboard

getting lunatic-python to work with luajit

Open micklat opened this issue 11 years ago • 3 comments

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?

micklat avatar Sep 29 '14 06:09 micklat

Do a pull request?

mamcx avatar Nov 12 '14 01:11 mamcx

@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)

hughperkins avatar Sep 27 '15 02:09 hughperkins

+1

oeway avatar Mar 01 '16 09:03 oeway