1Alien::ZMQ(3) User Contributed Perl Documentation Alien::ZMQ(3)
2
3
4
6 Alien::ZMQ - find and install libzmq, the core zeromq library
7
9 version 0.06
10
12 use Alien::ZMQ;
13 use version;
14
15 my $version = version->parse(Alien::ZMQ::lib_version);
16 my $lib_dir = Alien::ZMQ::lib_dir;
17
18 print "zeromq $version is installed at $lib_dir\n";
19
21 Upon installation, the target system is probed for the presence of
22 libzmq. If it is not found, libzmq 3.2.4 is installed in a shared
23 directory. In short, modules that need libzmq can depend on this
24 module to make sure that it is available, or use it independently as a
25 way to install zeromq.
26
28 inc_version
29 Get the version number of libzmq as a v-string (version string),
30 according to the zmq.h header file.
31
32 lib_version
33 Get the version number of libzmq as a v-string (version string),
34 according to the libzmq.so file.
35
36 inc_dir
37 Get the directory containing the zmq.h header file.
38
39 lib_dir
40 Get the directory containing the libzmq.so file.
41
42 cflags
43 Get the C compiler flags required to compile a program that uses
44 libzmq. This is a shortcut for constructing a "-I" flag using
45 "inc_dir". In scalar context, the flags are quoted using
46 String::ShellQuote and returned as a single string.
47
48 libs
49 Get the linker flags required to link a program against libzmq. This
50 is a shortcut for constructing a "-L" flag using "lib_dir", plus
51 "-lzmq". In scalar context, the flags are quoted using
52 String::ShellQuote and returned as a single string.
53
54 On some platforms, you may also want to add the library path to your
55 executable or library as a runtime path; this is usually done by
56 passing "-rpath" to the linker. Something like this could work:
57
58 my @flags = (Alien::ZMQ::libs, "-Wl,-rpath=" . Alien::ZMQ::lib_dir);
59
60 This will allow your program to find libzmq, even if it is installed in
61 a non-standard location, but some systems don't have this "RPATH"
62 mechanism.
63
65 These options to Build.PL affect the installation of this module.
66
67 --zmq-skip-probe
68 By default, libzmq is not compiled and installed if it is detected
69 to already be on the system. Use this to skip those checks and
70 always install libzmq.
71
72 --zmq-cflags
73 Pass extra flags to the compiler when probing for an existing
74 installation of libzmq. You can use this, along with "--zmq-libs",
75 to help the probing function locate libzmq if it is installed in an
76 unexpected place. For example, if your libzmq is installed at
77 /opt/zeromq, you can do something like this:
78
79 perl Build.PL --zmq-cflags="-I/opt/zeromq/include" \
80 --zmq-libs="-L/opt/zeromq/lib -lzmq"
81
82 These flags are only used by the probing function to locate libzmq;
83 they will not be used when compiling libzmq from source (if it
84 needs to be). To affect the compiling of libzmq, using the
85 "--zmq-config" flag instead.
86
87 A better alternative to using "--zmq-cflags" and "--zmq-libs" is to
88 help the pkg-config program find your libzmq by using the
89 "PKG_CONFIG_PATH" environment variable. Of course, this method
90 requires that you have the pkg-config program installed. Here's an
91 example:
92
93 perl Build.PL
94 PKG_CONFIG_PATH=/opt/zeromq/lib/pkgconfig ./Build
95
96 --zmq-libs
97 Pass extra flags to the linker when probing for an existing
98 installation of libzmq. You can use this, along with
99 "--zmq-cflags", to help the probing function locate libzmq if it is
100 installed in an unexpected place. Like "--zmq-cflags", these flags
101 are only used by the probing function to locate libzmq.
102
103 --zmq-config
104 Pass extra flags to the libzmq configure script. You may want to
105 consider passing either "--with-pgm" or "--with-system-pgm" if you
106 need support for PGM; this is not enabled by default because it is
107 not supported by every system.
108
110 Probing is only done during the installation of this module, so if you
111 are using a system-installed version of libzmq and you uninstall or
112 upgrade it, you will also need to reinstall Alien::ZMQ.
113
114 If libzmq-2.x is found on the system, Alien::ZMQ will use it. There
115 are a few incompatibilities between libzmq-2.x and libzmq-3.x, so your
116 program may want to use the "lib_version" method to check which version
117 of libzmq is installed.
118
120 MSWin32 is not yet supported, but cygwin works.
121
123 • GitHub project <https://github.com/chazmcgarvey/p5-Alien-ZMQ>
124
125 • ZMQ - good perl bindings for zeromq
126
127 • ZeroMQ <http://www.zeromq.org/> - official libzmq website
128
130 The design and implementation of this module were influenced by other
131 Alien modules, including Alien::GMP and Alien::Tidyp.
132
134 Charles McGarvey <ccm@cpan.org>
135
137 This software is copyright (c) 2013 by Charles McGarvey.
138
139 This is free software; you can redistribute it and/or modify it under
140 the same terms as the Perl 5 programming language system itself.
141
142
143
144perl v5.34.0 2022-01-20 Alien::ZMQ(3)