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
cffi cannot find libzmq.so #395
Comments
Try setting:
|
It is not shown but it is set to that value. |
Your paste suggests that you have |
That is not accurate. I have it set in my profile when I login. |
What do you get from this: from cffi import FFI
def zmq_version_info():
ffi = FFI()
ffi.cdef('void zmq_version(int *major, int *minor, int *patch);')
libzmq = ffi.verify('#include <zmq.h>',
libraries=['c', 'zmq'])
major = ffi.new('int*')
minor = ffi.new('int*')
patch = ffi.new('int*')
libzmq.zmq_version(major, minor, patch)
return (int(major[0]), int(minor[0]), int(patch[0]))
zmq_version_info() |
Looks like the same thing.
|
and what do you get from |
It looks like libzmq.so.3 is in there.
|
Any change if you scrub |
I deleted the directory and I'm getting the same error. |
Previously, I had done a Now I get
Your script on the other hand has a problem:
Additionally, this is my dev environment. In my production environment, I cannot install into |
That NameError was just a typo from a bad copy/paste. Should be fixed above. |
I'll try to get a test setup working without a system libzmq - it definitely should work (and does work great with CPython). Weirdly enough, all of the documentation I have read suggests that you are doing everything right. |
Thanks. I appreciate you looking into the issue. |
It looks like CFFI ignores [DY]LD_LIBRARY_PATH, but respects LIBRARY_PATH.
This is with pypy-2.1.0 on OS X 10.8.4 |
OK, there must be something very different on Ubuntu. I guess I'l just hold off on pypy for now. |
@hydrogen18 I'm not sure if this affects custom prefixes installations, but in general, in linux, after The last example from @minrk |
Current workaround is:
However, using LD_PRELOAD seems to me incredibly hackish. |
I just ran my sequence above on Ubuntu LTS 12.04 (pypy-2.1.0), and it behaved the same as before. C_INCLUDE_PATH required to find the header, LIBRARY_PATH required to link, and LD_LIBRARY_PATH required at runtime. Note that after the first run which does the compilation, only LD_LIBRARY_PATH is required. |
No idea why, but you are right. It only works if you pass in
|
what is the line that sets LD_LIBRARY_PATH in your bashrc? |
In my
I really appreciate all your help with this. |
Aha! You need to |
Got it! Thanks for all the help. |
I have a similar issue, except it's different. The error is the same, and I can get it to work with LD_PRELOAD, the difference is I have zmq 2.1.7 installed on the system, and I built zmq 3.2.2 and installed it in /usr/local. Without LD_PRELOAD, the cffi backend seems to only find system libzmq. This applies at runtime after the first successful import, so it seems to be a matter with dynamic loading of the .so Any ideas? |
I recommend opening a separate issue. I did not have any actual library issues, but a misunderstanding of how environmental variables are passed along to child processes by the bash interpreter. |
I have installing libzmq in /home/ericu/local with the --prefix option on its configure script. Pyzmq installs fine under CPython 2.7.5. It does not work under pypy even with the environmental variables set.
The text was updated successfully, but these errors were encountered: