Help building pyzmq

I’m trying to build pyzmq to work with Maya2016 but I’m running into issues (no surprise; compiling solutions is a new world to me).

I am following the instructions on this page:
http://zeromq.org/docs:windows-installations

I have cloned the two branches (both master) and the next line is:

Open libzmq\builds\msvc\msvc.sln in Visual C++ and build the solution.1

Firstly, msvc/msvc.sln doesn’t exist. I have: msvc\vs2012\libzmq.sln

Assuming that is correct I open that in VS2012 and set the Configuration to Active(StaticRelease) and Platform is Active(x64).

When I build I get these errors:

Error	1	error C1083: Cannot open include file: 'inttypes.h': No such file or directory	zeromq\libzmq\src\precompiled.hpp	102	1	libzmq
Error	2	error LNK1181: cannot open input file 'libzmq.lib'	zeromq\libzmq\builds\msvc\vs2012\inproc_thr\LINK	inproc_thr
Error	3	error LNK1181: cannot open input file 'libzmq.lib'	zeromq\libzmq\builds\msvc\vs2012\inproc_lat\LINK	inproc_lat
Error	4	error LNK1181: cannot open input file 'libzmq.lib'	zeromq\libzmq\builds\msvc\vs2012\remote_lat\LINK	remote_lat
Error	5	error LNK1181: cannot open input file 'libzmq.lib'	zeromq\libzmq\builds\msvc\vs2012\remote_thr\LINK	remote_thr
Error	6	error LNK1181: cannot open input file 'libzmq.lib'	zeromq\libzmq\builds\msvc\vs2012\local_thr\LINK	local_thr
Error	7	error LNK1181: cannot open input file 'libzmq.lib'	zeromq\libzmq\builds\msvc\vs2012\local_lat\LINK	local_lat
	8	IntelliSense: cannot open source file "inttypes.h"	zeromq\libzmq\src\precompiled.hpp	102	1	libzmq
	9	IntelliSense: enumeration value is out of 'int' range	zeromq\libzmq\src\fd.hpp	47	24	libzmq

And I have no idea what to do.

Can’t do a static library for extension modules, they need to be linked dynamically.
Also, the fact that it can’t find one of its header files looks worrisome.

I might be able to give it a shot after work, if nobody else has a solution.

I get the same errors when using the DynRelease configuration.

Also there was one error the first time I ran this that said “Run configure.bat to create platform.h”. I ran configure.bat from libzmq\builds\msvc and that error went away and I now get what you see above.

Got it working using this fix: http://stackoverflow.com/questions/13266868/ffmpeg-inttypes-h-not-found-error

Why is this a necessary step, though? Does it just expect me to already have this file? Should it include it?

Now that that works, I am running into errors with setup.py.


../libzmq\include\zmq.h(240) : error C2146: syntax error : missing ')' before identifier 'routing_id'
../libzmq\include\zmq.h(240) : error C2081: 'uint32_t' : name in formal parameter list illegal
../libzmq\include\zmq.h(240) : error C2061: syntax error : identifier 'routing_id'
../libzmq\include\zmq.h(240) : error C2059: syntax error : ';'
../libzmq\include\zmq.h(240) : error C2059: syntax error : ')'
../libzmq\include\zmq.h(241) : error C2061: syntax error : identifier 'zmq_msg_routing_id'
../libzmq\include\zmq.h(241) : error C2059: syntax error : ';'
../libzmq\include\zmq.h(241) : error C2059: syntax error : 'type'

error: command '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\cl.exe"' failed with exit status 2

Is this because it is using VS9? Is there a way to specify the compiler that distutils uses? I see a posted solution here about using the Windows 7 SDK https://github.com/zeromq/pyzmq/issues/282#issuecomment-10316362

Should I try that approach? Is this a common issue when compiling python extensions? Is there a guide somewhere that I missed that describes this process?

So what I do is run the “Developer Command Prompt for VS2012” command prompt.
This should setup most of the environment variables as needed for visual studio.

Because you’ll be using mayapy and not standard python, you’ll need to add the python headers that ship with maya (might be in the devkit) to the include env variable, and the python libs to the lib variable (again might be in the devkit).

After that you should be able to run setup.py from mayapy, and hopefully get properly built a library.

Thanks for the prompt replies.

I followed the setup for the dev cmd prompt here: https://msdn.microsoft.com/en-us/library/ms229859(v=vs.110).aspx
and it is still using VS9.0. I even tried changing the VS90COMNTOOLS variable to point to VS11, but it’s still calling VS9.

EDIT:
My mistake, I wasn’t using mayapy.exe to setup.py. That fixed that error. Now I’m dealing with more.

Either I’m slow at this or building these extensions isn’t trivial.

EDIT2:
This is the error I am now getting:

buildutils\include_win32\stdint.h(4) : fatal error C1083: Cannot open include file: '../../bundled/zeromq/src/stdint.hpp': No such file or directory.

There is a stdint.hpp in …/libzmq/src, but otherwise there is no directory named bundled anywhere in the folders I am working in. I’m starting to feel like I’m in over my head and may just abandon this for now.

pyzmq 14.7.0 compiled for Maya 2105+ (win64)

Enjoy =)

[QUOTE=Styler;29821]pyzmq 14.7.0 compiled for Maya 2105+ (win64)

Enjoy =)[/QUOTE]

nice!

How did you get libsodium to actually build? I keep getting some kind of horrible syntax error.

I built sodium first, then added its includes and libs to libzmq project. Compiled libzmq. After that put all together to pyzmq, added some magic :slight_smile: and fixes to libzmq and python distutils code and finally compiled pyzmq. Honestly, it wasn’t so straightforward :frowning:

Yeah, that is what I was afraid of.

Awesome thanks!

And that at least makes me feel not so dumb.