Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting lunatic-python to work with luajit #27

Open
micklat opened this issue Sep 29, 2014 · 3 comments
Open

getting lunatic-python to work with luajit #27

micklat opened this issue Sep 29, 2014 · 3 comments

Comments

@micklat
Copy link

micklat commented Sep 29, 2014

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?

@mamcx
Copy link

mamcx commented Nov 12, 2014

Do a pull request?

@hughperkins
Copy link

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

@oeway
Copy link

oeway commented Mar 1, 2016

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants