-
Notifications
You must be signed in to change notification settings - Fork 635
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
Failed to build Cython example with VS2017 #1452
Comments
I've only tested this with linux/mac, and Windows linking is substantially different. I don't have access to a Windows environment to test with, but I suspect that it needs to link libzmq directly. Try something like: extensions = [
Extension(
"cyzmq_example",
["cyzmq.pyx"],
libraries=["libzmq"],
library_dirs=zmq.get_library_dirs(),
include_dirs=zmq.get_includes() + [numpy.get_include()],
)
] Alternative: linux/mac Python compilation uses a version of If you can get that to work, it would be great to update the example with Windows instructions! |
Hi minrk, Thanks very much for your prompt reply. I have tried that the direct link to libzmq with I just tested the compilation under linux ubuntu 20.04 with gcc. The exetension building went thought. However, when I tred to import functions from cyzmq_example. The symbols under libzmq were still showing undefined. I am not sure if the issues under window and linux are related.
|
I've looked into this one a bit, and discovered that mac/linux are indeed affected by the same issue if zmq is not imported first, i.e. they rely on the fact that pyzmq loads the symbols from the libzmq dylib before being imported. Linking libzmq directly would be a good idea, but is very hairy for bundled libzmq as discussed in #1412, especially on macOS with EDIT: |
Hi minrk, Thanks for the suggestions. I've figured out how to build under windows with msvs. There are two things to add in the extension setup.
|
When I try to build the cython example in https://github.com/zeromq/pyzmq/tree/master/examples/cython, I find the following link error.
I am using MSVC build tools 2017 14.16.27023 with the libzmq.dll complied with "pip install pyzmq". The pyzmq version is 20.0.0.
Any thoughts will be much appreciated. Thanks in advance.
The text was updated successfully, but these errors were encountered: