Installing on Windows

MSI installer

Bundles libzmq + pyzmq

Git + Python + libzmq + pyzmq

  • Install Python 2.7 from http://www.python.org/, and update path in System control panel to match installation directory, the installer does not do this automatically.
  • Ensure your copy of Git is configured correctly, especially if you plan to commit to the repository:
C:\> git config --global user.name "Your full name"
C:\> git config --global user.email "your.email.registered@github"
  • Open a console and test that git works.
  • Create a working directory and clone the two public gits:
C:\> git clone git://github.com/zeromq/libzmq.git
C:\> git clone git://github.com/zeromq/pyzmq.git
  • Ensure that you have matching branches of pyzmq and zeromq. For the lastest development branch, both should be master. If you would prefer more stable maintenance versions, checkout ZeroMQ maint and PyZMQ 2.0.x:
C:\> cd libzmq
C:\libzmq\> git checkout maint
C:\libzmq\> cd ../pyzmq
C:\pyzmq\> git checkout 2.0.x
  • Open libzmq\builds\msvc\msvc.sln in Visual C++ and build the solution.1
  • First, tell pyzmq where zeromq is:
$ python setup.py configure --zmq=../libzmq

configure is a new command, introduced in pyzmq-2.1.4. If you are building older pyzmq, locating libzmq takes a couple of steps:

  • [pyzmq <= 2.1.1]: In order for Windows to be able to find the libzmq.dll you built, add the libzmq\lib directory to your PATH.
  • [pyzmq <= 2.1.1]: create a file pyzmq\setup.cfg as follows:
[build_ext]
library_dirs = ..\libzmq\lib
include_dirs = ..\libzmq\include

replacing ..\libzmq with the path to your libzmq if it's not adjacent to pyzmq.

  • Then run:
C:\pyzmq\> python setup.py build_ext --inplace
C:\pyzmq\> python setup.py test
C:\pyzmq\> python setup.py install

If you get errors for missing constants, such as:

error C2065: 'ZMQ_FD' : undeclared identifier

Then your ZeroMQ is probably too old for your PyZMQ.

Installing using MinGW

Steps are easy:

1. You need to install DevKit from rubyinstaller.org. Instructions for that are in RubyInstaller website wiki:

http://rubyinstaller.org/downloads

Note that this does *not* mean you are installing Ruby. The RubyInstaller project has created this nice little package for bundling MinGW tools, so it's smart to take advantage of it. The tools are 32-bit only so for now these instructions only describe how to install a 32-bit library.

2. Start a command prompt and invoke devkitvars.bat found inside the folder you installed DevKit, this will give you access to MinGW tools.

3. Download ØMQ source somewhere and extract (eg C:\src\zeromq).

4. Compile it using the following commands:

C:\> cd C:\src\zeromq
C:\> sh configure —prefix=C:/zeromq
C:\> make
C:\> make install

Note the use of forwardslash in the second command. The above commands will take a long time to complete, but once it's done, you will find inside C:\zeromq folder the binaries (bin, lib, include).

5) Copy the result binaries

Now you can copy the DLL from inside bin into a directory in your PATH and use it.

6) Don't forget the additional dependencies

Copy libstdc++-6.dll and libgcc_s_sjlj-1.dll from DevKit MinGW into the same folder you copied libzmq.dll.

To know where these DLLs are, you can use where, eg:

C:\> where libstdc++-6.dll
C:\Users\Luis\Tools\DevKit\4.5.1\mingw\bin\libstdc++-6.dll

Comments: 24

Add a New Comment