@@ -6,84 +6,3 @@ language: rust
6
6
library : rust-zmq
7
7
---
8
8
9
- # Installation
10
-
11
- rust-zmq is available from [ crates.io] ( https://crates.io ) . Users
12
- should add this to their ` Cargo.toml ` file:
13
-
14
- ``` toml
15
- [dependencies ]
16
- zmq = " 0.9"
17
- ```
18
-
19
- As rust-zmq is a wrapper around ` libzmq ` , you need a build of ` libzmq `
20
- version 4.1 or newer, before attempting to build the ` zmq `
21
- crate. There are several options available:
22
-
23
- ## Dynamic linking using ` pkg-config `
24
-
25
- This is probably the preferred method when you are running a recent
26
- Unix-like OS that has support for ` pkg-config ` . For example, on recent
27
- Debian-based distributions, you can use the following command to get
28
- the prerequiste headers and library installed:
29
-
30
- ``` sh
31
- apt install libzmq3-dev
32
- ```
33
-
34
- If your OS of choice does not provide packages of a new-enough libzmq,
35
- you can install it from source; see
36
- < https://github.com/zeromq/libzmq/releases > , although in this case,
37
- you may prefer a ` vendored ` build, which automates that, see below.
38
-
39
- The build normally uses ` pkg-config ` to find out about libzmq's
40
- location. If that is not available, the environment variable
41
- ` LIBZMQ_PREFIX ` (or alternatively, ` LIBZMQ_LIB_DIR ` and
42
- ` LIBZMQ_INCLUDE_DIR ` ) can be defined to avoid the invocation of
43
- ` pkg-config ` .
44
-
45
- ## Windows build
46
-
47
- When building on Windows, using the MSCV toolchain, consider the
48
- following when trying to link dynamically against ` libzmq ` :
49
-
50
- - When building ` libzmq ` from sources, the library must be renamed
51
- to ` zmq.lib ` from the auto named ` libzmq-v***-mt-gd-*_*_*.lib ` ,
52
- ` libzmq.lib ` , ` libzmq-mt-*_*_*.lib ` , etc.
53
- - The folder containing the ` *.dll ` (dynamic link library)
54
- referred to by ` zmq.lib ` must be accessible via the path for
55
- the session that invokes the Rust compiler.
56
- - The name of the ` *.dll ` in question depends on the build system
57
- used for ` libzmq ` and can usually be seen when opening ` zmq.lib `
58
- in a text editor.
59
-
60
- ## Vendored build
61
-
62
- Starting with the upcoming release ` 0.9.1 ` (or when building from
63
- current ` master ` ), you can enable the ` vendored ` feature flag to have
64
- ` libzmq ` be built for you and statically linked into your binary
65
- crate. In your ` Cargo.toml ` , you can give users the option to do so
66
- using a dedicated feature flag:
67
-
68
- ``` toml
69
- [features ]
70
- vendored-zmq = [' zmq/vendored' ]
71
- ```
72
-
73
- ## Cross-compilation
74
-
75
- When you have a cross-compiled version of ` libzmq ` installed, you
76
- should be able to cross-compile rust-zmq, assuming a platform
77
- supporting ` pkg-config ` . For example, assuming you have ` libzmq `
78
- compiled for the ` i686-pc-windows-gnu ` target installed in
79
- ` ~/.local-w32 ` , the following should work:
80
-
81
- ``` sh
82
- PKG_CONFIG_PATH=$HOME /.local-w32/lib/pkgconfig \
83
- PKG_CONFIG_ALLOW_CROSS=1 \
84
- cargo build --target=i686-pc-windows-gnu --verbose
85
- ```
86
-
87
- Cross compilation without ` pkg-config ` should work as well, but you
88
- need set ` LIBZMQ_PREFIX ` as described above.
89
-
0 commit comments