Download
Follow the instructions below to download and install the selected ZeroMQ
library.
OSX
You need Brew installed and configured https://brew.sh/
czmq and zyre are also available.
Linux
Fedora
Ubuntu/Debian/Mint
apt-get install libzmq3-dev
Arch
SUSE
zypper install zeromq-devel
Packages for Debian, Ubuntu, Fedora, CentOS, RHEL, SUSE
The ZeroMQ maintainers provide pre-built binary packages for libzmq, czmq, zyre, malamute, zproject and zproto, automatically built from both the latest stable releases OR the latest commit in the Git repositories via the Open Build Service for i386, amd64, armv7, arm64, ppc64, s390x (note: depends on the distribution).
Add the repository of your choice by clicking on the distribution and version, and then follow “Go to download repository”. That is the URL of the repository. Remember to add the GPG key.
For example, to add Debian 9 and install the development packages for libzmq from the latest stable release without draft APIs:
echo "deb http://download.opensuse.org/repositories/network:/messaging:/zeromq:/release-stable/Debian_9.0/ ./" >> /etc/apt/sources.list
wget https://download.opensuse.org/repositories/network:/messaging:/zeromq:/release-stable/Debian_9.0/Release.key -O- | sudo apt-key add
apt-get install libzmq3-dev
Install from a package manager
Linux
Deb packages are available for Debian and Ubuntu.
For other distros please refer to pkgs.org.
You can also get prebuild binaries for latest git master
for most distros on openSUSE’s Build Service:
Git master
only stable APIs: http://software.opensuse.org/download.html?project=network%3Amessaging%3Azeromq%3Agit-stable&package=czmq
Git master
including draft APIs: http://software.opensuse.org/download.html?project=network%3Amessaging%3Azeromq%3Agit-draft&package=czmq
MacOS
On macOS install czmq with Homebrew see here.
Windows
Using vcpkg
If you are already using vcpkg, you can download and install czmq
with one single command:
vcpkg.exe install czmq
this will build czmq
as a 32-bit shared library.
vcpkg.exe install czmq:x64-windows-static
this will build czmq
as a 64-bit static library.
You may also build czmq
with one or more optional libraries:
vcpkg.exe install czmq[curl,httpd,lz4]:x64-windows
this will build czmq
with libcurl
, libmicrohttpd
, lz4
, as a 64-bit shared library.
To use the draft APIs, you may build czmq
with draft
feature:
vcpkg install czmq[draft]
If you are an adventurer, and want to always use the lastest version of czmq
, pass an extra --head
option:
vcpkg.exe install czmq --head
These commands will also print out instructions on how to use the library from your MSBuild or CMake-based projects.
Requirements
ZeroMQ 2.2.x or later. We recommend to use ZeroMQ >= 3.
C++11 compliant compiler. (g++ >= 4.7)
The command line client and the tests also require libboost.
Installation
Installation can be done by the standard make && make install. If the boost
unittest framework is installed, check and installcheck can be run for sanity
checking. To use ZMQ4 security feature install libsodium and libzmq –with-libsodium
as shown below before ZMQPP.
Build, check, and install libsodium
git clone git://github.com/jedisct1/libsodium.git
cd libsodium
./autogen.sh
./configure && make check
sudo make install
sudo ldconfig
cd ../
Build, check, and install the latest version of ZeroMQ
git clone git://github.com/zeromq/libzmq.git
cd libzmq
./autogen.sh
./configure –with-libsodium && make
sudo make install
sudo ldconfig
cd ../
Now install ZMQPP
git clone git://github.com/zeromq/zmqpp.git
cd zmqpp
make
make check
sudo make install
make installcheck
The most commonly useful overrides are setting CXX, to change the compiler
used, and PREFIX to change install location. The CXX prefix should be used on
all targets as the compiler version is used in the build path. PREFIX is only
relevant for the install target.
Example
download
is missing for
cppzmq
. Would you like to contribute it? Then follow the steps below:
git clone https://github.com/zeromq/zeromq.org
example_dir=content/docs/examples/cpp/cppzmq
cd zeromq.org && mkdir -p $example_dir
[ -s $example_dir/index.md ] || cat >$example_dir/index.md <<'EOF'
---
headless: true
---
EOF
cp archetypes/examples/download.md
$example_dir/download.md
Building and installation
Building requires a recent version of CMake (2.8.12 or later for Visual Studio, 2.8 or later for the rest), and a C++ compiler
which supports C++11. Currently this has been tested with -
* Xcode 5.1 on OS X 10.8
* Xcode 6 on OS X 10.9
* Xcode 6.4 on OS X 10.10
* Xcode 7.1 on OS X 10.11
* GCC 4.8 + Boost 1.48 on CentOS 6
* GCC 4.8 + Boost 1.53 on CentOS 7
* GCC 4.8 on Arch Linux and Ubuntu
* GCC 4.8 on Ubuntu
* GCC 5.3 + Boost 1.60 on Ubuntu
* Microsoft Visual Studio 2013 on Windows Server 2008 R2
Library dependencies are -
* Boost 1.48 or later
* ZeroMQ 4.0.x
Tests and example code require -
* Boost 1.54 or later
To build on Linux / OS X -
$ mkdir build && cd build
$ cmake ..
$ make
$ make test
$ make install
To build on Windows -
> mkdir build
> cd build
> cmake ..
> cmake --build . --config Release
> ctest . -C Release
You can also open Visual Studio solution from build
directory after invoking CMake.
To change the default install location use -DCMAKE_INSTALL_PREFIX
when invoking CMake.
To change where the build looks for Boost and ZeroMQ use -DBOOST_ROOT=<my custom Boost install>
and -DZMQ_ROOT=<my custom ZeroMQ install>
when invoking CMake. Or set BOOST_ROOT
and ZMQ_ROOT
environment variables.
Example
download
is missing for
czmqpp
. Would you like to contribute it? Then follow the steps below:
git clone https://github.com/zeromq/zeromq.org
example_dir=content/docs/examples/cpp/czmqpp
cd zeromq.org && mkdir -p $example_dir
[ -s $example_dir/index.md ] || cat >$example_dir/index.md <<'EOF'
---
headless: true
---
EOF
cp archetypes/examples/download.md
$example_dir/download.md
Example
download
is missing for
fbzmq
. Would you like to contribute it? Then follow the steps below:
git clone https://github.com/zeromq/zeromq.org
example_dir=content/docs/examples/cpp/fbzmq
cd zeromq.org && mkdir -p $example_dir
[ -s $example_dir/index.md ] || cat >$example_dir/index.md <<'EOF'
---
headless: true
---
EOF
cp archetypes/examples/download.md
$example_dir/download.md
Installation
You can download NetMQ via NuGet.
Example
download
is missing for
clrzmq4
. Would you like to contribute it? Then follow the steps below:
git clone https://github.com/zeromq/zeromq.org
example_dir=content/docs/examples/csharp/clrzmq4
cd zeromq.org && mkdir -p $example_dir
[ -s $example_dir/index.md ] || cat >$example_dir/index.md <<'EOF'
---
headless: true
---
EOF
cp archetypes/examples/download.md
$example_dir/download.md
Install
You can install chumak
from hex.pm by including the following in your rebar.config
:
{deps,[
{chumak, "X.Y.Z"}
]}.
where X.Y.Z is one of the release versions.
For more info on rebar3 dependencies see the rebar3 docs.
Example
download
is missing for
ezmq
. Would you like to contribute it? Then follow the steps below:
git clone https://github.com/zeromq/zeromq.org
example_dir=content/docs/examples/erlang/ezmq
cd zeromq.org && mkdir -p $example_dir
[ -s $example_dir/index.md ] || cat >$example_dir/index.md <<'EOF'
---
headless: true
---
EOF
cp archetypes/examples/download.md
$example_dir/download.md
Example
download
is missing for
erlang-czmq
. Would you like to contribute it? Then follow the steps below:
git clone https://github.com/zeromq/zeromq.org
example_dir=content/docs/examples/erlang/erlang-czmq
cd zeromq.org && mkdir -p $example_dir
[ -s $example_dir/index.md ] || cat >$example_dir/index.md <<'EOF'
---
headless: true
---
EOF
cp archetypes/examples/download.md
$example_dir/download.md
Example
download
is missing for
FsNetMQ
. Would you like to contribute it? Then follow the steps below:
git clone https://github.com/zeromq/zeromq.org
example_dir=content/docs/examples/fsharp/fsnetmq
cd zeromq.org && mkdir -p $example_dir
[ -s $example_dir/index.md ] || cat >$example_dir/index.md <<'EOF'
---
headless: true
---
EOF
cp archetypes/examples/download.md
$example_dir/download.md
Example
download
is missing for
fszmq
. Would you like to contribute it? Then follow the steps below:
git clone https://github.com/zeromq/zeromq.org
example_dir=content/docs/examples/fsharp/fszmq
cd zeromq.org && mkdir -p $example_dir
[ -s $example_dir/index.md ] || cat >$example_dir/index.md <<'EOF'
---
headless: true
---
EOF
cp archetypes/examples/download.md
$example_dir/download.md
Requirements
zmq4 is just a wrapper for the ZeroMQ library. It doesn’t include the
library itself. So you need to have ZeroMQ installed, including its
development files. On Linux and Darwin you can check this with ($
is
the command prompt):
$ pkg-config --modversion libzmq
4.3.1
The Go compiler must be able to compile C code. You can check this
with:
$ go env CGO_ENABLED
1
You can’t do cross-compilation. That would disable C.
Install
go get github.com/pebbe/zmq4
Install
Dependencies
For CZMQ master
go get github.com/zeromq/goczmq
The CZMQ library includes experimental classes that are not built by default, but can be built
by passing --enable-drafts
to configure. Support for these draft classes are being added
to goczmq. To build these features against a CZMQ that has been compiled with --enable-drafts
,
use go build -tags draft
.
For CMZQ = 4.2
go get gopkg.in/zeromq/goczmq.v4
Note: CZMQ 4.2 is has not been released yet.
For CZMQ Before 4.0
go get gopkg.in/zeromq/goczmq.v1
Example
download
is missing for
zeromq-haskell
. Would you like to contribute it? Then follow the steps below:
git clone https://github.com/zeromq/zeromq.org
example_dir=content/docs/examples/haskell/zeromq-haskell
cd zeromq.org && mkdir -p $example_dir
[ -s $example_dir/index.md ] || cat >$example_dir/index.md <<'EOF'
---
headless: true
---
EOF
cp archetypes/examples/download.md
$example_dir/download.md
Usage
Maven
Add it to your Maven project’s pom.xml
:
<dependency>
<groupId>org.zeromq</groupId>
<artifactId>jeromq</artifactId>
<version>0.5.1</version>
</dependency>
<!-- for the latest SNAPSHOT -->
<dependency>
<groupId>org.zeromq</groupId>
<artifactId>jeromq</artifactId>
<version>0.5.2-SNAPSHOT</version>
</dependency>
<!-- If you can't find the latest snapshot -->
<repositories>
<repository>
<id>sonatype-nexus-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
Ant
To generate an ant build file from pom.xml
, issue the following command:
Example
download
is missing for
JZMQ
. Would you like to contribute it? Then follow the steps below:
git clone https://github.com/zeromq/zeromq.org
example_dir=content/docs/examples/java/jzmq
cd zeromq.org && mkdir -p $example_dir
[ -s $example_dir/index.md ] || cat >$example_dir/index.md <<'EOF'
---
headless: true
---
EOF
cp archetypes/examples/download.md
$example_dir/download.md
Example
download
is missing for
jczmq
. Would you like to contribute it? Then follow the steps below:
git clone https://github.com/zeromq/zeromq.org
example_dir=content/docs/examples/java/jczmq
cd zeromq.org && mkdir -p $example_dir
[ -s $example_dir/index.md ] || cat >$example_dir/index.md <<'EOF'
---
headless: true
---
EOF
cp archetypes/examples/download.md
$example_dir/download.md
Installation
Install ZeroMQ.js with prebuilt binaries:
npm install zeromq@6.0.0-beta.6
Requirements for prebuilt binaries:
- Node.js 10.2+ or Electron 3+ (requires a N-API version 3+)
Prebuilt binaries
The following platforms have a prebuilt binary available:
- Linux on x86-64/armv7/armv8 with libstdc++.so.6.0.21+ (glibc++ 3.4.21+), for example:
- Debian 9+ (Stretch or later)
- Ubuntu 16.04+ (Xenial or later)
- CentOS 8+
- Linux on x86-64 with musl, for example:
- Alpine 3.3+
- MacOS 10.9+ on x86-64
- Windows on x86/x86-64
If a prebuilt binary is not available for your platform, installing will attempt to start a build from source.
Building from source
If a prebuilt binary is unavailable or if you want to pass certain options during build, you can build this package from source.
Make sure you have the following installed before attempting to build from source:
- Node.js 10+ or Electron 3+
- A working C++17 compiler toolchain with make
- Python 2.7 (or Python 3 with Node 12.13+)
- CMake 2.8+
- curl
To install from source
npm install zeromq@6.0.0-beta.6 --build-from-source
If you want to link against a shared ZeroMQ library, you can build skip downloading libzmq and link with the installed library instead as follows:
npm install zeromq@6.0.0-beta.6 --zmq-shared
If you wish to use any DRAFT sockets then it is also necessary to compile the library from source:
npm install zeromq@6.0.0-beta.6 --zmq-draft
INSTALL
cpanm -v ZMQ::FFI
Downloading
Unless you specifically want to develop PyZMQ, we recommend downloading
the PyZMQ source code or wheels from
PyPI,
or install with conda.
You can also get the latest source code from our GitHub repository, but
building from the repository will require that you install recent Cython.
Building and installation
For more detail on building pyzmq, see our Wiki.
We build wheels for OS X, Windows, and Linux, so you can get a binary on those platforms with:
pip install pyzmq
but compiling from source with pip install pyzmq
should work in most environments.
Especially on OS X, make sure you are using the latest pip (≥ 8), or it may not find the right wheels.
If the wheel doesn’t work for some reason, or you want to force pyzmq to be compiled
(this is often preferable if you already have libzmq installed and configured the way you want it),
you can force installation with:
pip install –no-binary=:all: pyzmq
When compiling pyzmq (e.g. installing with pip on Linux),
it is generally recommended that zeromq be installed separately,
via homebrew, apt, yum, etc:
Debian-based
sudo apt-get install libzmq3-dev
RHEL-based
sudo yum install libzmq3-devel
If this is not available, pyzmq will try to build libzmq as a Python Extension,
though this is not guaranteed to work.
Building pyzmq from the git repo (including release tags on GitHub) requires Cython.
Installation
Install libzmq.
If the gem installation complains that it cannot find libzmq or headers, simply pass the location of your libzmq installation to the gem install command:
gem install zmq -- --with-zmq-dir=/opt/local
On Windows add a parameter for the libs. For example:
gem install zmq -- --with-zmq-dir=c:/src/zeromq-4.3.2 --with-zmq-lib=c:/src/zeromq-4.3.2/src/.libs
Installation
rust-zmq is available from crates.io. Users
should add this to their Cargo.toml
file:
[dependencies]
zmq = "0.9"
As rust-zmq is a wrapper around libzmq
, you need a build of libzmq
version 4.1 or newer, before attempting to build the zmq
crate. There are several options available:
Dynamic linking using pkg-config
This is probably the preferred method when you are running a recent
Unix-like OS that has support for pkg-config
. For example, on recent
Debian-based distributions, you can use the following command to get
the prerequiste headers and library installed:
If your OS of choice does not provide packages of a new-enough libzmq,
you can install it from source; see
https://github.com/zeromq/libzmq/releases, although in this case,
you may prefer a vendored
build, which automates that, see below.
The build normally uses pkg-config
to find out about libzmq’s
location. If that is not available, the environment variable
LIBZMQ_PREFIX
(or alternatively, LIBZMQ_LIB_DIR
and
LIBZMQ_INCLUDE_DIR
) can be defined to avoid the invocation of
pkg-config
.
Windows build
When building on Windows, using the MSCV toolchain, consider the
following when trying to link dynamically against libzmq
:
- When building
libzmq
from sources, the library must be renamed
to zmq.lib
from the auto named libzmq-v***-mt-gd-*_*_*.lib
,
libzmq.lib
, libzmq-mt-*_*_*.lib
, etc.
- The folder containing the
*.dll
(dynamic link library)
referred to by zmq.lib
must be accessible via the path for
the session that invokes the Rust compiler.
- The name of the
*.dll
in question depends on the build system
used for libzmq
and can usually be seen when opening zmq.lib
in a text editor.
Vendored build
Starting with the upcoming release 0.9.1
(or when building from
current master
), you can enable the vendored
feature flag to have
libzmq
be built for you and statically linked into your binary
crate. In your Cargo.toml
, you can give users the option to do so
using a dedicated feature flag:
[features]
vendored-zmq = ['zmq/vendored']
Cross-compilation
When you have a cross-compiled version of libzmq
installed, you
should be able to cross-compile rust-zmq, assuming a platform
supporting pkg-config
. For example, assuming you have libzmq
compiled for the i686-pc-windows-gnu
target installed in
~/.local-w32
, the following should work:
PKG_CONFIG_PATH=$HOME/.local-w32/lib/pkgconfig \
PKG_CONFIG_ALLOW_CROSS=1 \
cargo build --target=i686-pc-windows-gnu --verbose
Cross compilation without pkg-config
should work as well, but you
need set LIBZMQ_PREFIX
as described above.