[zeromq-dev] pyzmq: using libzmq functions from cython
Min RK
benjaminrk at gmail.com
Sun Aug 11 17:11:29 CEST 2013
On Aug 11, 2013, at 4:19, Tom Farnbauer <tom.farnbauer at gmail.com> wrote:
> Thanks Michael & MinRK!
>
> That's exactly what I was looking for - I knew there has to be some simple way to do it. Now the only problem is one needs to have the zmq includes when importing stuff from libzmq. Is there a chance that these could be bundled with pyzmq when using a bundled libzmq instance? Otherwise 3rd party extensions will still require the zmq headers to be made available manually..
Yes, I have been meaning to do this.
>
> -Tom
> On Aug 9, 2013, at 9:18 PM, MinRK <benjaminrk at gmail.com> wrote:
>
>>
>>
>>
>> On Fri, Aug 9, 2013 at 12:00 PM, Michael Haberler <mail17 at mah.priv.at> wrote:
>>> Tom,
>>>
>>> Am 09.08.2013 um 20:34 schrieb Tom Farnbauer <tom.farnbauer at gmail.com>:
>>>
>>> > I'm pretty certain that I'm importing zmq first and it loads just fine. Then once I try to import my stuff, it fails and tells me that:
>>> >
>>> > ImportError: libzmq.so: cannot open shared object file: No such file or directory
>>> >
>>> > One interesting thing I noticed is that when I run `ldd <any one of pyzmq backend extensions>` libzmq.so is not in the output. It is however listed when I run it on my own extension module. This happens even if I link specifically against the libzmq instance that is bundled with zmq. I've tried playing around with different dlopen settings to no avail (based on this old info here: http://muttley.hates-software.com/2006/01/25/c37456e6.html). It appears that python doesn't use RTLD_GLOBAL by default, but trying to force it (through sys.setdlopenflags) didn't help...
>>> >
>>> > If I add the zmq package directory to LD_LIBRARY_PATH, it works just fine. I'm trying not to have to gdb it but I just may have to.
>>>
>>> you might want to look into the rpath linker option - in essence it gives you a way to bundle a library path with a binary
>>
>> Ah yes, I forgot that I do this in pyzmq when I ship libzmq with it. The distutils setting is `runtime_library_dirs`, and can include relative paths (relative to the compiled extension, if I recall).
>>
>> -MinRK
>>
>>>
>>> - Michael
>>>
>>>
>>> >
>>> > The code in question is here: https://github.com/SleepingPills/splice.io/blob/master/splice/receiver.pyx (warning: it is fairly hacky at the moment)
>>> > _______________________________________________
>>> > zeromq-dev mailing list
>>> > zeromq-dev at lists.zeromq.org
>>> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>>
>>> _______________________________________________
>>> zeromq-dev mailing list
>>> zeromq-dev at lists.zeromq.org
>>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev at lists.zeromq.org
>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130811/ed848148/attachment.htm>
More information about the zeromq-dev
mailing list