-
Notifications
You must be signed in to change notification settings - Fork 87
Closed
Description
I encountered two issues when I tried to use numpy from Lua. I use Ubuntu 14.04, Python 2.7 and luajit.
-
Lunatic hadn't compiled until I added -fPIC to CMAKE_C_FLAGS
-
The call
require "python"; python.execute("import numpy as np")in Lua failed withImportError: /usr/lib/python2.7/dist-packages/numpy/core/multiarray.so: undefined symbol: PyExc_SystemError. Inspired by http://stackoverflow.com/questions/8361437/linker-error-lunatic-python-lua-requiresocket-undefined-symbol-lua-getme I put#include <dlfcn.h>topythoninlua.cand addeddlopen("libpython2.7.so.1", RTLD_LAZY | RTLD_GLOBAL);at the beginning ofLUA_API int luaopen_python(lua_State *L). This fixed it. I am wondering if it would be a general improvement?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels