Subject: | ZMQ Detection on OSX fails |
Date: | Wed, 11 May 2011 11:33:24 +0200 |
To: | bug-ZeroMQ [...] rt.cpan.org |
From: | Johan Ström <johan [...] stromnet.se> |
Hi,
I'm trying to install ZeroMQ-0.12 manually on OS X (perl v5.8.8), with
zeromq 2.1.6 installed locally, but I've got some problems with the
autodetection of zmq.
Steps to reproduce:
$ export DEST=$HOME/dev/inst
$ mkdir -p $DEST
# First install zeromq locally
$ tar zxf zeromq-2.1.1.tar.gz
$ cd zeromq-2.1.
$ ./configure --prefix=$DEST
...
$ make
...
$ make install
...
# Now try to build ZeroMQ perl
$ tar zxf ZeroMQ-0.12.tar.gz
$ cd ZeroMQ-0.12
$ env ZMQ_HOME=$DEST perl Makefile.PL
Can't link/include 'zmq.h', 'zmq'
$ env ZMQ_HOME=$DEST PKG_CONFIG_PATH=$DEST/lib/pkgconfig perl
Makefile.PL
Can't link/include 'zmq.h', 'zmq'
I tried a bit of re-arranging in Makefile.pl, moving checklibs from
line 27 to after the detect_zmq.pl-stuff, which yielded this:
$ env PKG_CONFIG_PATH=$DEST/lib/pkgconfig perl Makefile.PL
Probing environment variables:
Probing libzmq via pkg-config ...
+ found libzmq 2.1.6
+ Detected ZMQ_INCLUDES from pkg-config...
+ Detected ZMQ_H from pkg-config...
+ Detected ZMQ_LIBS from pkg-config...
Detected the following ZMQ settings:
+ ZMQ_HOME = (null)
+ ZMQ_H = /Users/johan/dev/inst/include/zmq.h
+ ZMQ_INCLUDES = /Users/johan/dev/inst/include
+ ZMQ_LIBS = -L/Users/johan/dev/inst/lib -lzmq
+ ZMQ_TRACE = (null)
Can't link/include 'zmq.h', 'zmq'
With a bit more specific args I got it working, but this shouldn't be
necessary:
$ env PKG_CONFIG_PATH=$DEST/lib/pkgconfig perl Makefile.PL INC="-I
$DEST/include -I./" LIBS="-L$DEST/lib" PREFIX="$DEST"
Probing environment variables:
Probing libzmq via pkg-config ...
+ found libzmq 2.1.6
+ Detected ZMQ_INCLUDES from pkg-config...
+ Detected ZMQ_H from pkg-config...
+ Detected ZMQ_LIBS from pkg-config...
Detected the following ZMQ settings:
+ ZMQ_HOME = (null)
+ ZMQ_H = /Users/johan/dev/inst/include/zmq.h
+ ZMQ_INCLUDES = /Users/johan/dev/inst/include
+ ZMQ_LIBS = -L/Users/johan/dev/inst/lib -lzmq
+ ZMQ_TRACE = (null)
Writing ppport.h
+ Using zmq.h from /Users/johan/dev/inst/include/zmq.h
Checking if your kit is complete...
Looks good
Warning: prerequisite Devel::PPPort 3.19 not found. We have 3.0601.
Warning: prerequisite ExtUtils::MakeMaker 6.42 not found. We have 6.30.
Warning: prerequisite Task::Weaken 0 not found.
Warning: prerequisite Test::Exception 0.29 not found.
Warning: prerequisite Test::More 0.98 not found. We have 0.62.
Warning: prerequisite Test::Requires 0 not found.
Warning: prerequisite Test::TCP 0 not found.
Writing Makefile for ZeroMQ
And make works out fine aswell
$ make
cp lib/ZeroMQ/Context.pm blib/lib/ZeroMQ/Context.pm
cp lib/ZeroMQ/Poller.pm blib/lib/ZeroMQ/Poller.pm
cp lib/ZeroMQ/Constants.pm blib/lib/ZeroMQ/Constants.pm
cp lib/ZeroMQ.pm blib/lib/ZeroMQ.pm
cp lib/ZeroMQ/Socket.pm blib/lib/ZeroMQ/Socket.pm
cp lib/ZeroMQ/Message.pm blib/lib/ZeroMQ/Message.pm
cp lib/ZeroMQ/Raw.pm blib/lib/ZeroMQ/Raw.pm
/opt/local/bin/perl "-Iinc" /opt/local/lib/perl5/5.8.8/ExtUtils/
xsubpp -typemap /opt/local/lib/perl5/5.8.8/ExtUtils/typemap xs/
perl_zeromq.xs > xs/perl_zeromq.xsc && mv xs/perl_zeromq.xsc xs/
perl_zeromq.c
cc -c -I/Users/johan/dev/inst/include -I./ -I/opt/local/include -fno-
common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -
Wdeclaration-after-statement -I/opt/local/include -Wall -Wextra -
Wdeclaration-after-statement -O3 -DVERSION=\"0.12\" -DXS_VERSION=
\"0.12\" -o xs/perl_zeromq.o "-I/opt/local/lib/perl5/5.8.8/
darwin-2level/CORE" -DUSE_PPPORT xs/perl_zeromq.c
perl_zeromq.xs: In function 'XS_ZeroMQ__Raw_zmq_poll':
perl_zeromq.xs:588: warning: comparison between signed and unsigned
perl_zeromq.xs:589: warning: comparison between signed and unsigned
perl_zeromq.xs:608: warning: passing argument 4 of 'Perl_hv_fetch'
makes integer from pointer without a cast
perl_zeromq.xs:619: warning: passing argument 4 of 'Perl_hv_fetch'
makes integer from pointer without a cast
perl_zeromq.xs:628: warning: passing argument 4 of 'Perl_hv_fetch'
makes integer from pointer without a cast
perl_zeromq.xs:636: warning: passing argument 4 of 'Perl_hv_fetch'
makes integer from pointer without a cast
perl_zeromq.c: At top level:
xs/mg-xs.inc:56: warning: 'PerlZMQ_Raw_PollItem_vtbl' defined but not
used
Running Mkbootstrap for ZeroMQ ()
chmod 644 ZeroMQ.bs
rm -f blib/arch/auto/ZeroMQ/ZeroMQ.bundle
env MACOSX_DEPLOYMENT_TARGET=10.3 cc -L/opt/local/lib -bundle -
undefined dynamic_lookup xs/perl_zeromq.o -o blib/arch/auto/ZeroMQ/
ZeroMQ.bundle \
\
chmod 755 blib/arch/auto/ZeroMQ/ZeroMQ.bundle
cp ZeroMQ.bs blib/arch/auto/ZeroMQ/ZeroMQ.bs
chmod 644 blib/arch/auto/ZeroMQ/ZeroMQ.bs
Manifying blib/man3/ZeroMQ::Poller.3
Manifying blib/man3/ZeroMQ::Context.3
Manifying blib/man3/ZeroMQ::Constants.3
Manifying blib/man3/ZeroMQ.3
Manifying blib/man3/ZeroMQ::Socket.3
Manifying blib/man3/ZeroMQ::Raw.3
Manifying blib/man3/ZeroMQ::Message.3
So, to conclude, the detection doesn't really seem to utilize the
ZMQ_* env properly.. The above works fine with the clean Makefile.PL
aswell (ie no moving around of checklibs), but I supposed that is due
to my explicit INC/LIBS flags.
Am I missing something, or can the detection stuff be further improved?
For the record, I'm working (rather passively though) on a POE
integration, which can be found at https://github.com/stromnet/poe-zeromq
.
Best Regards
Johan