Alien::ZMQ(3pm)
π Alien::ZMQ β the Alien::ZMQ(3pm) manual, but make it cute π
okay bestie, sit down, grab a strawberry π, because we're talking about Alien::ZMQ β the module that goes out and finds or installs libzmq, aka the core zeromq library. no cap, that's literally its whole job and it does it flawlessly. π
β¨ VERSION β¨
version 0.06 β iconic, we love a numbered era π
πΈ SYNOPSIS πΈ
here's the vibe, copy-paste approved:
use Alien::ZMQ;
use version;
my $version = version->parse(Alien::ZMQ::lib_version);
my $lib_dir = Alien::ZMQ::lib_dir;
print "zeromq $version is installed at $lib_dir\n";
look at her go π she's so simple and she works.
π¦ DESCRIPTION π¦
so the way this works: when you install this module, the target system gets probed to see if libzmq is already there. if it's not? no worries babe, libzmq 3.2.4 gets installed into a shared directory, no questions asked. π
tl;dr: modules that need libzmq can just depend on this one and trust that it's available β or you can use it all on its own as your personal way to install zeromq. main character energy, honestly. π
π METHODS π
inc_version
grab the version number of libzmq as a v-string (that's a version string, iykyk), straight from the zmq.h header file. β¨
lib_version
same energy, different source β this one gets the version number of libzmq as a v-string, according to the libzmq.so file. π
inc_dir
the directory holding the zmq.h header file. that's it, that's the whole job. πΈ
lib_dir
the directory holding the libzmq.so file. slay. π
cflags
the C compiler flags you need to compile a program that uses libzmq. lowkey it's just a shortcut for building a -I flag out of inc_dir. and in scalar context? the flags get quoted with String::ShellQuote and handed back as one single string. cute. π
libs
the linker flags you need to link a program against libzmq. this one's a shortcut for building a -L flag out of lib_dir, plus -lzmq. and yeah, in scalar context the flags get quoted with String::ShellQuote and returned as a single string too. consistent queen. β¨
on some platforms you might also want to add the library path to your executable or library as a runtime path β that's usually done by passing -rpath to the linker. something like this could work:
my @flags = (Alien::ZMQ::libs, "-Wl,-rpath=" . Alien::ZMQ::lib_dir);
this lets your program find libzmq even when it's living in a non-standard location π‘ β but heads up, some systems just don't have this RPATH mechanism. π
π OPTIONS π
these options go to Build.PL and they affect how this module gets installed. pay attention bestie.
--zmq-skip-probeβ by default, libzmq is not compiled and installed if it's already detected on the system. use this flag to skip those checks entirely and always install libzmq. no probing, just vibes. π₯--zmq-cflagsβ pass extra flags to the compiler while it's probing for an existing libzmq installation. you can pair this with--zmq-libsto help the probing function find libzmq when it's chilling in a weird unexpected place. for example, if your libzmq lives at/opt/zeromq, you can do something like:
perl Build.PL --zmq-cflags="-I/opt/zeromq/include" \
--zmq-libs="-L/opt/zeromq/lib -lzmq"
important bestie: these flags are only used by the probing function to locate libzmq. they will not be used when compiling libzmq from source (if it needs to be). if you want to affect the compiling of libzmq, use the --zmq-config flag instead. π
a better alternative to --zmq-cflags and --zmq-libs is to help the pkg-config program find your libzmq by using the PKG_CONFIG_PATH environment variable. of course, this method requires that you actually have the pkg-config program installed. here's an example:
perl Build.PL
PKG_CONFIG_PATH=/opt/zeromq/lib/pkgconfig ./Build
--zmq-libsβ pass extra flags to the linker while it's probing for an existing libzmq installation. use it together with--zmq-cflagsto help the probing function locate libzmq when it's installed somewhere unexpected. just like--zmq-cflags, these flags are only used by the probing function to locate libzmq. periodt. π--zmq-configβ pass extra flags to the libzmq configure script. you might wanna consider passing either--with-pgmor--with-system-pgmif you need support for PGM β and it's not enabled by default because not every system supports it. π
π CAVEATS π
probing only happens during the installation of this module. so if you're using a system-installed version of libzmq and you uninstall or upgrade it, you're gonna have to reinstall Alien::ZMQ too. sorry babe, them's the rules. π
also β if libzmq-2.x is found on the system, Alien::ZMQ will use it. there are a few incompatibilities between libzmq-2.x and libzmq-3.x, so your program might want to use the lib_version method to check which version of libzmq is actually installed. stay safe out there. π«Ά
π BUGS π
MSWin32 is not yet supported, but cygwin works. that's the whole note. π
π₯ SEE ALSO π₯
- GitHub project <https://github.com/chazmcgarvey/p5-Alien-ZMQ> π
- ZMQ β good perl bindings for zeromq π
- ZeroMQ <http://www.zeromq.org/> β official libzmq website β
π§ ACKNOWLEDGEMENTS π§
the design and implementation of this module were influenced by other Alien modules, including Alien::GMP and Alien::Tidyp. shoutout to the ancestors. π«Άβ¨
π AUTHOR π
Charles McGarvey <ccm@cpan.org> β absolute legend, no further questions. π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2013 by Charles McGarvey.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
okay and that's the whole page, bestie!! π this was perl v5.42.0, dated 2025-07-25, and you just read the Alien::ZMQ(3pm) manual β go forth and link some zeromq, you've got this π πβ¨
π¦ where this page comes from
- fedora 43: perl-Alien-ZMQ 0.06-29.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms