ZMQ :: LibZMQ3和草莓perl

时间:2013-02-19 22:12:58

标签: windows perl zeromq cpan strawberry-perl

我正在尝试在草莓perl上安装ZMQ :: LibZMQ3但是在安装此模块时得到以下错误消息我的zmq库和包含在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

是否可以在Windows上安装此cpan模块,如果可以,有人可以帮助解决这里的问题吗?

3 个答案:

答案 0 :(得分:4)

我刚在ActiveStatePerl环境中尝试过它。

首先我得到了相同的结果,但后来我重命名了我的ZMQ安装 并删除了空格。

(从C:\App\ZeroMQ 2.2.0C:\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)

所以我通过了问题

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

并在Makefile.PL中进行了下一步

Detecting zmq version...

(在我的系统上失败,因为我有一个0mq 2.2.0而perl-binding需要3.3)

希望这也适合你。

答案 1 :(得分:3)

您使用的是Strawberry Perl还是ActiveState Perl?除非您已nmake并安装了MinGW实用程序,否则Active State Perl可能会出现从CPAN安装的问题。我很关心这个:

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

这给我带来了巨大的危险信号。当我尝试安装时,我也注意到了这个小小的东西:

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

嗯..我必须先设置这些环境变量。

接下来,我得到了无法链接/包含C库'zmq',正在中止。它来自Makefile中的assert。我在Github上发现了这个问题。它说:

  

啊,好指针。 pthread_create问题。我的perl是用线程支持编译的。我重新编译了perl,这个问题已经消失了。

嗯,是的,Strawberry Perl是用线程支持编译的。而且,我不会重新编译它。

我建议如下:

  • 在名称中没有空格的目录中安装ZMQ。我直接在C:\ZeroMQ-3.2.2
  • 下安装了它
  • 定义这些环境变量。我查看了Makefile.PL,它需要ZMQ_LIBSZMQ_INCLUDES
  • 确保您只使用Strawberry Perl而不是ActiveState。你可以使用ActiveState,但需要对此进行一些调整。
  • 在Makefile.PL中添加Debug标志debug => 1(这意味着您必须从命令行运行perl Makefile.PL来进行Makefile安装的手动方法。

我不会在没有线程支持的情况下下载并重新编译Perl,看看这是否有效。我希望我已经把你送到了正确的道路上。

答案 2 :(得分:2)

这个软件包不会安装在我的ActiveState Perl基于Windows的机器上 - 尽管有些ZMQ软件包会。似乎Windows / Perl下的支持充其量是有限的。

查看此页面:https://github.com/lestrrat/p5-ZMQ/issues/14 因为Strawberry Perl似乎存在已知问题。

讨厌添加它(不喜欢Python),但它似乎在Windows下使用Python 2.7。刚刚进行了快速安装并运行了包含的测试,并通过了测试。文档还说Java在Windows下运行良好。

如果您不是64位,这可能会有所帮助(来自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.