Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZMQ::LibZMQ2 build fails #30

Open
wsdookadr opened this issue Apr 12, 2013 · 1 comment
Open

ZMQ::LibZMQ2 build fails #30

wsdookadr opened this issue Apr 12, 2013 · 1 comment

Comments

@wsdookadr
Copy link

What I tried

I very much appreciate and sympathize with the efforts made towards developing this module.

(I am not 100% sure if I should post this bug report as ZMQ::LibZMQ3 is out and maybe I should try that instead)

I'd like to report a problem.

I am running Perl 5.14.2.

I will describe all my install attempt: I first ran git clone [email protected]:zeromq/libzmq.git to get the source for 0MQ.

Then I installed it to my $HOME with ./autogen.sh ; ./configure --prefix=$HOME/local; make; make install;

After this I added these lines to my ~/.bashrc so that:

  • the header will be automatically detected by gcc

  • the library will be found by gcc

  • pkg-config is able to find the libzmq.pc

    export C_INCLUDE_PATH=$C_INCLUDE_PATH:$HOME/local/include
    export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$HOME/local/include
    export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$HOME/local/lib/pkgconfig

Now I'm going to try to install ZMQ::LibZMQ2 from CPAN like this cpanm ZMQ::LibZMQ2 , however, I am getting this:

Detected the following ZMQ settings:
 + ZMQ_HOME = (null)
 + ZMQ_H = (null)
 + ZMQ_INCLUDES = 
 + ZMQ_LIBS = -L/home/user/local/lib -lzmq  
 + ZMQ_TRACE = (null)

So I thought, ok I will give it what it needs(I am unsure if I did this right):

ZMQ_HOME=/home/user/local/lib/ \
ZMQ_H=/home/user/local/include/zmq.h \
ZMQ_INCLUDES=/home/user/local/include \
ZMQ_LIBS=/home/user/local/lib perl Makefile.PL

The result

user@user-K56CM:~/.cpanm/work/1365728991.21838/ZMQ-LibZMQ2-1.07$ make
cp lib/ZMQ/LibZMQ2.pm blib/lib/ZMQ/LibZMQ2.pm
/usr/bin/perl "-Iinc" /usr/share/perl/5.14/ExtUtils/xsubpp  -typemap /usr/share/perl/5.14/ExtUtils/typemap  xs/perl_libzmq2.xs > xs/perl_libzmq2.xsc && mv xs/perl_libzmq2.xsc xs/perl_libzmq2.c
cc -c  "-I." "-I/home/user/local/include" "-Ixs" "-I." -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -W -Wno-comment -O2 -g   -DVERSION=\"1.07\" -DXS_VERSION=\"1.07\" -o xs/perl_libzmq2.o -fPIC "-I/usr/lib/perl/5.14/CORE"  -DUSE_PPPORT xs/perl_libzmq2.c
xs/perl_libzmq2.xs: In function 'XS_ZMQ__LibZMQ2_zmq_recv':
xs/perl_libzmq2.xs:681:9: error: too few arguments to function 'zmq_recv'
In file included from xs/perl_libzmq2.h:7:0,
                 from xs/perl_libzmq2.xs:1:
/home/user/local/include/zmq.h:213:16: note: declared here
xs/perl_libzmq2.xs: In function 'XS_ZMQ__LibZMQ2__zmq_send':
xs/perl_libzmq2.xs:706:9: error: too few arguments to function 'zmq_send'
In file included from xs/perl_libzmq2.h:7:0,
                 from xs/perl_libzmq2.xs:1:
/home/user/local/include/zmq.h:212:16: note: declared here
xs/perl_libzmq2.c: In function 'XS_ZMQ__LibZMQ2_zmq_poll':
xs/perl_libzmq2.c:2328:7: warning: unused variable 'RETVAL' [-Wunused-variable]
xs/perl_libzmq2.xs: In function 'XS_ZMQ__LibZMQ2_zmq_device':
xs/perl_libzmq2.xs:882:9: warning: implicit declaration of function 'zmq_device' [-Wimplicit-function-declaration]
make: *** [xs/perl_libzmq2.o] Error 1

Questions

Is ZMQ::LibZMQ2 still recommended or should ::LibZMQ3 be used instead ?
If ::LibZMQ2 can still be used, what libzmq version should it be used with ?

@lestrrat
Copy link
Collaborator

Well, I can't say I know /all/ of its guts, but I suspect that it's just that MakeMaker (which does the REAL magic to compile the XS extension) just don't support those env vars.

One thing I noted was, if you have all the zmq stuff under /home/user/local, then you should be able to do

ZMQ_HOME=/home/usr/local perl Makefile.PL

If you do the above, tools/detect_zmq.pl (called from Makefile.PL) basically just checks if $ZMQ_HOME/include, $ZMQ_HOME/lib exists, puts them in the paths, and see if compilation works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants