Perl:在Macos Sierra上使用Perlbrew进行安装

时间:2017-01-26 16:05:24

标签: perl macos-sierra perlbrew

我正在尝试使用最新版本的Perlbrew在运行macOS-Sierra的计算机上安装最新的稳定版Perl(5.24.1)和多线程。

Perlbrew似乎安装正确,但是当我运行命令时:

Perlbrew install perl-5.24.1 --thread or
perlbrew install stable --thread

安装继续,但随后出现以下消息

Installation process failed. To spot any issues, check

  /Users/alan/perl5/perlbrew/build.perl-5.24.1.log

If some perl tests failed and you still want to install this distribution anyway,
do:

  (cd /Users/alan/perl5/perlbrew/build/perl-5.24.1; make install)

You might also want to try upgrading patchperl before trying again:

按照上面的建议查看日志文件,我在文件末尾找到以下错误消息:

1 error generated.
make[1]: *** [HiRes.o] Error 1
cc -c   -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack- protector-strong -I/usr/local/include -Wall -Werror=declaration-after-statement -Wextra -Wc++-compat -Wwrite-strings -Wthread-safety -O3 -DVERSION=\"1.9733\" -DXS_VERSION=\"1.9733\"  "-I../.."  -DTIME_HIRES_NANOSLEEP -DTIME_HIRES_CLOCK_GETTIME -DTIME_HIRES_CLOCK_GETRES -DTIME_HIRES_CLOCK_NANOSLEEP -DTIME_HIRES_CLOCK -DTIME_HIRES_STAT=1 -DATLEASTFIVEOHOHFIVE HiRes.c
HiRes.xs:945:15: error: use of undeclared identifier 'darwin_time_mutex'
MUTEX_INIT(&darwin_time_mutex);
          ^
1 error generated.
make[1]: *** [HiRes.o] Error 1
Unsuccessful make(dist/Time-HiRes): code=512 at make_ext.pl line 569.
make: *** [lib/auto/Time/HiRes/HiRes.bundle] Error 25
##### Brew Failed #####"

在日志文件的其他位置,以下消息也会出现多次(尽管我不知道这与失败的安装过程有多相关):

ld: warning: object file (xxxxxxxx) was built for newer OSX version (10.12) than being linked (10.4)

我在网上搜索过类似的问题但没有找到任何结果。因此,我想知道这是Perlbrew和Sierra的一般问题,还是特定于我的设置。

显然我是Perl编程和编程的初学者,所以请尽可能简单地保留任何回复

感谢您的帮助

1 个答案:

答案 0 :(得分:3)

你不是唯一一个:这是一个错误。见Bug #128972 for perl5: Build failure on OS X 10.12 Sierra

似乎该错误已针对5.26.0解决,但尚未(尚未)反向移植到5.24.2和5.22.4。

你可以尝试使用最新版本(但很可能还有其他问题):

perlbrew install perl-blead