[zeromq-dev] pyzmq: using libzmq functions from cython
Tom Farnbauer
tom.farnbauer at gmail.com
Fri Aug 9 10:45:51 CEST 2013
Hello,
I have a somewhat peculiar problem. To get around the GIL, I have a small cython module that uses libzmq functions to set up some preliminary message processing before passing on messages to pure python code. The pure python code uses pyzmq as well. This obviously means that I need to use the zmq headers and libraries to compile and link the cython module, but at the same time I have to have pyzmq installed as well. All works fine as long as libzmq is available on LD_LIBRARY_PATH at runtime, but this is normally not the case when libzmq is bundled with pyzmq (since it sits in the directory of pyzmq).
Does anyone have any advice on what would be the best solution to make the above thing work? Pyzmq seems to expose libzmq through the libzmq.pxd file, but I still need the libzmq headers and libraries to be able to build my python module. If, however, I link against a separate zmq prefix, libzmq.so.1 will be missing at runtime.
Will I need to hook into the bundling process somehow to make sure that my extension module is built specifically against the bundled libzmq?
The docs mention that pyzmq makes it simple to use its own extension modules, but also the core libzmq functions from cython (by having the modular pxd files I presume), but there is little detail in achieving that (unfortunately).
Cheers,
Tom
More information about the zeromq-dev
mailing list