Charles McGarvey > Alien-ZMQ-0.06 > Alien::ZMQ

Download:
Alien-ZMQ-0.06.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.06   Source  

NAME ^

Alien::ZMQ - find and install libzmq, the core zeromq library

VERSION ^

version 0.06

SYNOPSIS ^

    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";

DESCRIPTION ^

Upon installation, the target system is probed for the presence of libzmq. If it is not found, libzmq 3.2.4 is installed in a shared directory. In short, modules that need libzmq can depend on this module to make sure that it is available, or use it independently as a way to install zeromq.

METHODS ^

inc_version

Get the version number of libzmq as a v-string (version string), according to the zmq.h header file.

lib_version

Get the version number of libzmq as a v-string (version string), according to the libzmq.so file.

inc_dir

Get the directory containing the zmq.h header file.

lib_dir

Get the directory containing the libzmq.so file.

cflags

Get the C compiler flags required to compile a program that uses libzmq. This is a shortcut for constructing a -I flag using "inc_dir". In scalar context, the flags are quoted using String::ShellQuote and returned as a single string.

libs

Get the linker flags required to link a program against libzmq. This is a shortcut for constructing a -L flag using "lib_dir", plus -lzmq. In scalar context, the flags are quoted using String::ShellQuote and returned as a single string.

On some platforms, you may also want to add the library path to your executable or library as a runtime path; this is 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 will allow your program to find libzmq, even if it is installed in a non-standard location, but some systems don't have this RPATH mechanism.

OPTIONS ^

These options to Build.PL affect the installation of this module.

--zmq-skip-probe

By default, libzmq is not compiled and installed if it is detected to already be on the system. Use this to skip those checks and always install libzmq.

--zmq-cflags

Pass extra flags to the compiler when probing for an existing installation of libzmq. You can use this, along with "--zmq-libs", to help the probing function locate libzmq if it is installed in an unexpected place. For example, if your libzmq is installed at /opt/zeromq, you can do something like this:

    perl Build.PL --zmq-cflags="-I/opt/zeromq/include" \
                  --zmq-libs="-L/opt/zeromq/lib -lzmq"

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). To affect the compiling of libzmq, using the "--zmq-config" flag instead.

A better alternative to using "--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 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 when probing for an existing installation of libzmq. You can use this, along with "--zmq-cflags", to help the probing function locate libzmq if it is installed in an unexpected place. Like "--zmq-cflags", these flags are only used by the probing function to locate libzmq.

--zmq-config

Pass extra flags to the libzmq configure script. You may want to consider passing either --with-pgm or --with-system-pgm if you need support for PGM; this is not enabled by default because it is not supported by every system.

CAVEATS ^

Probing is only done during the installation of this module, so if you are using a system-installed version of libzmq and you uninstall or upgrade it, you will also need to reinstall Alien::ZMQ.

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 may want to use the "lib_version" method to check which version of libzmq is installed.

BUGS ^

MSWin32 is not yet supported, but cygwin works.

SEE ALSO ^

ACKNOWLEDGEMENTS ^

The design and implementation of this module were influenced by other Alien modules, including Alien::GMP and Alien::Tidyp.

AUTHOR ^

Charles McGarvey <ccm@cpan.org>

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.

syntax highlighting: