-
Notifications
You must be signed in to change notification settings - Fork 82
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
Undefined Symbol problems at load-time in Linux #17
Comments
This sounds to be a known problem on lunatic-python. It is likely the same issue as the one posted on SO here and here. Unfortunately, I doubt I can offer any solution to this problem since I don't really program on linux. I can boot up a VM and investigate this further. From what I recall in lua 5.2 Someone more familiar with linux can chime in. |
what does |
I already knew the first post, it covers Python -> Lua and tells to enable RTLD_GLOBAL, which i did in Lua, by changing der loadlib.c file and compiling. I tried the lua5.2 thing with the second argument, but i tried to apply it to loadlib function, maybe I was a bit confused.. I installed lunatic-python via pip. (yes, the bugfix version) Please don't invest too much of your time in this, I already found a workaround using a communication library (ZMQ). Here is the output: |
This is just a guess but could it be because when you build I'm thinking none of the Python C functions are defined because
|
IT WORKED! =) I didn't even recompile lua-python.so, but I had to use my lua5.1 compiled with the RTLD_GLOBAL tag. could I ask you of your opinion about my use of this? FOR EVERYONE ELSE ENCOUNTERING THIS PROBLEM: I'm using Ubuntu 13.04 with Python 2.7 |
I have ZMQ somewhere and tried it briefly. From what I recall, that library's carefully designed to be as efficient as possible. Of course, like anything else, there is a learning curved involved unless you're already familiar with the library. Lunatic python needs to translate from Lua -> C -> Python and back again whenever you access facilities from the other language. This could add up to quite a bit of overhead so I wouldn't recommend making too many lunatic calls in performance critical code. Having said that, the obvious advantage is you can access tools and facilities from the other language that otherwise wouldn't be possible. And if you're already comfortable using those facilities that can be a big win. |
@eloshoman @greatwolf Hi there! I've tested your method and found out that one does not to have to add the RTLD_GLOBAL flag in the Lua distribution. All you have to do is
|
Glad you found it useful :) |
Afaik, Lua5.2 is compiled with the GLOBAL tag by default. |
Hi,
I am trying to use lunatic python to access python code from within lua.
The problem is, whenever I load the python bridge, I get this error:
lua-python.so: undefined symbol: _Py_ZeroStruct
I am running Ubuntu 13.04 and have tried with lua5.1 and lua5.2, both installed with apt and from source with editing loadlib.c to "RTLD_NOW | RTLD_GLOBAL", as suggested by the original author.
I always recompiled lunatic-python to match the current lua version.
Maybe you can help to resolve this issue.
Thank you!
The text was updated successfully, but these errors were encountered: