Perl:在MacosSierra上安装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编程和编程的初学者,所以请尽可能简单地回复

感谢的帮助

你不是唯一一个:这是一个bug。请参阅漏洞#1128972了解第5章:在OS X 10.12 Sierra 上构建失败

这个错误似乎在5.26.0中得到了解决,但(还)没有重新移植到5.24.2和5.22.4。

你可以尝试出血边缘版本(但很可能还有其他问题):

perlbrew install perl-blead

最新更新