Skip to content
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

Unable to build on windows #55

Closed
jkd opened this issue Dec 15, 2010 · 6 comments
Closed

Unable to build on windows #55

jkd opened this issue Dec 15, 2010 · 6 comments

Comments

@jkd
Copy link

jkd commented Dec 15, 2010

I'm unable to build zeromq successfully using these directions. I'm on Windows 7 64-bit using msvc 2008, Python 2.7, and I did have to install Cython. If I follow the directions exactly, on the step "python setup.py build_ext —inplace" I get:

C:\pyzmq>python setup.py build_ext --inplace
running build_ext
skipping 'zmq\core\constants.c' Cython extension (up-to-date)
building 'zmq.core.constants' extension
Traceback (most recent call last):
  File "setup.py", line 309, in <module>
    'Topic :: System :: Networking'
  File "c:\dev\Python27\lib\distutils\core.py", line 152, in setup
    dist.run_commands()
...trimmed...
  File "c:\dev\Python27\lib\distutils\msvc9compiler.py", line 295, in query_vcvarsall
    raise ValueError(str(list(result.keys())))
ValueError: [u'path']

If I then first run vcvarsall I get:
C:\pyzmq>python setup.py build_ext --inplace
running build_ext
skipping 'zmq\core\constants.c' Cython extension (up-to-date)
building 'zmq.core.constants' extension
C:\dev\mvs9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Izmq\utils -Izmq\core -Izmq\devices -I.\zmq -Ic:\dev\Python27\include -Ic:
\dev\Python27\PC /Tczmq\core\constants.c /Fobuild\temp.win-amd64-2.7\Release\zmq\core\constants.obj
constants.c
zmq\core\constants.c(224) : fatal error C1083: Cannot open include file: 'zmq.h': No such file or directory
error: command 'C:\dev\mvs9.0\VC\BIN\cl.exe' failed with exit status 2

If I then change setup.cfg to read:

[build_ext]
library_dirs = .\zmq
include_dirs = ..\zeromq2\include

I get:

C:\pyzmq>python setup.py build_ext --inplace
running build_ext
skipping 'zmq\core\constants.c' Cython extension (up-to-date)
building 'zmq.core.constants' extension
C:\dev\mvs9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Izmq\utils   -Izmq\core -Izmq\devices -I..\zeromq2\include -Ic:\dev\Python27
\include -Ic:\dev\Python27\PC /Tczmq\core\constants.c /Fobuild\temp.win-amd64-2.7\Release\zmq\core\constants.obj
constants.c
zmq\core\constants.c(907) : error C2065: 'ZMQ_XPUB' : undeclared identifier
zmq\core\constants.c(919) : error C2065: 'ZMQ_XSUB' : undeclared identifier
zmq\core\constants.c(1183) : error C2065: 'ZMQ_FD' : undeclared identifier
zmq\core\constants.c(1195) : error C2065: 'ZMQ_EVENTS' : undeclared identifier
zmq\core\constants.c(1207) : error C2065: 'ZMQ_TYPE' : undeclared identifier
zmq\core\constants.c(1219) : error C2065: 'ZMQ_LINGER' : undeclared identifier
zmq\core\constants.c(1231) : error C2065: 'ZMQ_RECONNECT_IVL' : undeclared identifier
zmq\core\constants.c(1243) : error C2065: 'ZMQ_BACKLOG' : undeclared identifier
error: command 'C:\dev\mvs9.0\VC\BIN\cl.exe' failed with exit status 2

And I'm stuck. What should I try next?

@jkd
Copy link
Author

jkd commented Dec 15, 2010

Apparently this is only a problem in master. If I check out 2.0.10 I get a bunch of these:
constants.obj : error LNK2019: unresolved external symbol __imp__PyImport_Import referenced in function ___Pyx_ImportModule
constants.obj : error LNK2019: unresolved external symbol __imp__PyString_FromString referenced in function ___Pyx_ImportModule

when linking the first file, constants.obj.

@minrk
Copy link
Member

minrk commented Dec 15, 2010

The 'undeclared identifier' errors are because you have the wrong version of zeromq. pyzmq/master currently depends on zeromq/master, and I made a note of this on the instructions you mentioned. If you want to link against zeromq/maint, the matching branch for pyzmq right now is '2.0.x'.

As for your linking errors, those are basic Python symbols, so I would guess that you don't have your PATH configured correctly to find the Python dlls.

How did you install Python, and what is your PATH?

@jkd
Copy link
Author

jkd commented Dec 15, 2010

Thanks for replying, minrk. Continued selective Googling finally revealed someone else having similar problems. I obtained mvs 2008, checked out maint and 2.0.x, changed the profile to build to x64 as mentioned in the link, and got a successful build.

That was pretty painful. I do hope you guys find someone to maintain some windows binaries for you. I wish I knew win development enough to volunteer. In the meantime, it might help others if you note the need for cython and for the 64-bit compiler. Note that there is no free version of visual studio for 64 bit, but you can get a 90-day evaluation of 2008.

@minrk
Copy link
Member

minrk commented Dec 15, 2010

I just want to be clear. The ZeroMQ 'solution' specifies win32, so you had to change that to x64 per the mailing-list, and rebuild ZeroMQ. From there, the remaining instructions worked fine?

Is that correct?

Binaries would certainly be lovely, but there currently aren't any pyzmq developers that use Windows at all, let alone as a dev platform. I have a VM for testing, but that's it.

If you are volunteering, that would be great!

@jkd
Copy link
Author

jkd commented Dec 15, 2010

Correct. Once I changed the 'solution' to x64 and rebuilt ZeroMQ, the rest of the instructions worked.

At our shop here we run Python on Linux servers but develop on Windows 7. If this prototype I'm assembling with 0MQ works out, you'll have to up your pyzmq windows developer count to 4. If we can spare a moment I'll have one of the guys put together a windows build process for you guys.

@minrk
Copy link
Member

minrk commented Dec 15, 2010

That would be great, thanks!

I posted the mailing-list note to the wiki, so hopefully that will help others.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants