Skip to content

Issue with numpy #29

@mys007

Description

@mys007

I encountered two issues when I tried to use numpy from Lua. I use Ubuntu 14.04, Python 2.7 and luajit.

  1. Lunatic hadn't compiled until I added -fPIC to CMAKE_C_FLAGS

  2. The call require "python"; python.execute("import numpy as np") in Lua failed with ImportError: /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> to pythoninlua.c and added dlopen("libpython2.7.so.1", RTLD_LAZY | RTLD_GLOBAL); at the beginning of LUA_API int luaopen_python(lua_State *L). This fixed it. I am wondering if it would be a general improvement?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions