Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ZMQ::LibZMQ3 and strawberry perl

I am trying to install ZMQ::LibZMQ3 on strawberry perl but get the below error message while installing this module also my zmq libs and includes are found under C:\Program Files\ZeroMQ 3.2.2 :

cpan> install ZMQ::LibZMQ3

Running install for module 'ZMQ::LibZMQ3'
Running make for D/DM/DMAKI/ZMQ-LibZMQ3-1.09.tar.gz
Checksum for C:\strawberry\cpan\sources\authors\id\D\DM\DMAKI\ZMQ-LibZMQ3-1.09.tar.gz ok
Scanning cache C:\strawberry\cpan\build for sizes
............................................................................DONE

  CPAN.pm: Building D/DM/DMAKI/ZMQ-LibZMQ3-1.09.tar.gz

Cannot determine perl version info from lib/ZMQ/LibZMQ3.pm
Probing environment variables:
Probing libzmq via pkg-config ...
'pkg-config' is not recognized as an internal or external command,
operable program or batch file.
 - No libzmq found...
Probing zeromq3 via pkg-config ...
'pkg-config' is not recognized as an internal or external command,
operable program or batch file.
 - No zeromq3 found...
Detected the following ZMQ settings:
 + ZMQ_HOME = "C:\Program Files\ZeroMQ 3.2.2"
 + ZMQ_H = "C:\Program Files\ZeroMQ 3.2.2\include\zmq.h"
 + ZMQ_INCLUDES = "C:\Program Files\ZeroMQ 3.2.2\include"
 + ZMQ_LIBS = "C:\Program Files\ZeroMQ 3.2.2\lib"
 + ZMQ_TRACE = (null)
Can't link/include C library 'zmq.h', 'zmq', aborting.
Warning: No success on command[C:\strawberry\perl\bin\perl.exe Makefile.PL]
  DMAKI/ZMQ-LibZMQ3-1.09.tar.gz
  C:\strawberry\perl\bin\perl.exe Makefile.PL -- NOT OK
Running make test
  Make had some problems, won't test
Running make install
  Make had some problems, won't install
Stopping: 'install' failed for 'ZMQ::LibZMQ3'.
Failed during this command:
 DMAKI/ZMQ-LibZMQ3-1.09.tar.gz                : writemakefile NO 'C:\strawberry\perl\bin\perl.exe Ma
kefile.PL' returned status 512

is it possible to install this cpan module on windows and if yes could someone help what could be the problem here ?

like image 592
smith Avatar asked Feb 19 '13 22:02

smith


3 Answers

I just tried it in my ActiveStatePerl environment.

First I got the same results, but then I renamed my ZMQ installation and removed the spaces.

(From C:\App\ZeroMQ 2.2.0 to C:\App\ZeroMQ2_2_0.)

+ ZMQ_HOME = C:\App\ZeroMQ2_2_0
+ ZMQ_H = C:\App\ZeroMQ2_2_0\include\zmq.h
+ ZMQ_INCLUDES = C:\App\ZeroMQ2_2_0\include
+ ZMQ_LIBS = C:\App\ZeroMQ2_2_0\lib
+ ZMQ_TRACE = (null)

So I passed the problem

Can't link/include C library 'zmq.h', 'zmq', aborting.

and got the next step in Makefile.PL

Detecting zmq version...

(That fails on my system because I have a 0mq 2.2.0 and the perl-binding requires 3.3)

Hope that works for you, too.

like image 90
smartmeta Avatar answered Nov 13 '22 22:11

smartmeta


Are you using Strawberry Perl or ActiveState Perl? Active State Perl can have issues with installing from CPAN unless you've got nmake and installed the MinGW utilities. I'm concerned about this:

Probing libzmq via pkg-config ...
'pkg-config' is not recognized as an internal or external command,
operable program or batch file.

That raises big hurking red flags for me. I also noticed this little ditty when I tried to install:

Detected the following ZMQ settings:
 + ZMQ_HOME = (null)
 + ZMQ_H = (null)
 + ZMQ_INCLUDES = (null)
 + ZMQ_LIBS = (null)
 + ZMQ_TRACE = (null)

Hmm.. I have to set these environment variables first.

Next, I got Can't link/include C library 'zmq', aborting. which is from the assert in the Makefile. I found this issue on Github. It said:

Ahhh nice pointer. pthread_create problem. My perl was compiled with thread support. I have recompiled perl and that problem has gone away.

Um yes, Strawberry Perl is compiled with thread support. And, I'm not recompiling it.

What I do recommend is the following:

  • Install ZMQ in a directory without spaces in the name. I installed it directly under C:\ZeroMQ-3.2.2.
  • Define those environment variables. I looked at the Makefile.PL and it requires ZMQ_LIBS and ZMQ_INCLUDES.
  • Make sure you're only using Strawberry Perl and not ActiveState. You can use ActiveState, but it takes a bit of tweaking for something like this.
  • Add that Debug flag debug => 1 in the Makefile.PL (which means you have to do the manual method of the Makefile install where you run perl Makefile.PL from the command line.

I'm not going to download and recompile Perl without the threads support to see if this will work. I hope I've sent you on the correct path though.

like image 38
David W. Avatar answered Nov 13 '22 22:11

David W.


This package would not install on my ActiveState Perl Windows-based machine - although some of the ZMQ packages will. It seems support under Windows/Perl is limited at best.

See this page: https://github.com/lestrrat/p5-ZMQ/issues/14 As there does appear to be known issues with Strawberry Perl.

Hate to add this (don't like Python), but it does seem to work under Windows with Python 2.7. Just did a quick install and ran the included tests, which passed. Docs also say Java works well with under Windows as well.

If your not 64-bit this may help (from laufeyjarson):

A work-around is to change $^I to have a backup. I used ~ like gvim does:

Line 100 of Makefile.PL:
local $^I = '~';
EDIT:  On recent versions, it is line 203 - JimB

That lets the Makefile.PL work.
like image 2
Jim Black Avatar answered Nov 13 '22 21:11

Jim Black