我正在运行当前稳定版本的OmniOS r151020。决定安装一些Perl模块。我将它们安装在自定义库目录中。以下是我安装的方式。
sudo pkg install gnu-tar gnu-make gcc51
export MAKE=gmake
mkdir /bailey/lib/perl; cd /bailey/lib/perl
ln -s perl5/lib/perl5 cpan # so that my apps can add /bailey/lib/perl/cpan to their @INC
curl -L https://cpanmin.us | perl - App::cpanminus --local-lib=/bailey/lib/perl/perl5 # installs cpanm
perl5/bin/cpanm --local-lib=/bailey/lib/perl/perl5 local::lib && eval $(perl -I /bailey/lib/perl/cpan -Mlocal::lib) # sets default installation dir
perl5/bin/cpanm Crypt::Eksblowfish::Bcrypt
不幸的是,最后一个用于安装本机编译模块的命令会导致错误:
的 /usr/perl5/5.16.1/lib/i86pc-solaris-thread-multi-64int/CORE/perl.h:610:24: fatal error: sys/types.h: No such file or directory
完整的成绩单:
george@bedford:/bailey/lib/perl$ perl5/bin/cpanm Crypt::Eksblowfish::Bcrypt
--> Working on Crypt::Eksblowfish::Bcrypt
Fetching http://www.cpan.org/authors/id/Z/ZE/ZEFRAM/Crypt-Eksblowfish-0.009.tar.gz ... OK
Configuring Crypt-Eksblowfish-0.009 ... OK
Building and testing Crypt-Eksblowfish-0.009 ... FAIL
! Installing Crypt::Eksblowfish::Bcrypt failed. See /home/george/.cpanm/work/1485301763.12637/build.log for details. Retry with --force to force install it.
george@bedford:/bailey/lib/perl$ more /home/george/.cpanm/work/1485301763.12637/build.log
cpanm (App::cpanminus) 1.7042 on perl 5.016001 built for i86pc-solaris-thread-multi-64int
Work directory is /home/george/.cpanm/work/1485301763.12637
You have make /usr/gnu/bin/make
You have /usr/bin/wget
You have /usr/gnu/bin/tar, /usr/bin/gzip and /usr/bin/bzip2
You have /usr/bin/unzip
Searching Crypt::Eksblowfish::Bcrypt () on cpanmetadb ...
--> Working on Crypt::Eksblowfish::Bcrypt
Fetching http://www.cpan.org/authors/id/Z/ZE/ZEFRAM/Crypt-Eksblowfish-0.009.tar.gz
-> OK
Unpacking Crypt-Eksblowfish-0.009.tar.gz
Entering Crypt-Eksblowfish-0.009
Checking configure dependencies from META.json
Checking if you have warnings 0 ... Yes (1.13)
Checking if you have strict 0 ... Yes (1.07)
Checking if you have Module::Build 0.38 ... Yes (0.39_01)
Checking if you have ExtUtils::Install 1.46 ... Yes (1.58)
Configuring Crypt-Eksblowfish-0.009
Running Build.PL
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Crypt-Eksblowfish' version '0.009'
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have warnings 0 ... Yes (1.13)
Checking if you have XSLoader 0 ... Yes (0.16)
Checking if you have parent 0 ... Yes (0.225)
Checking if you have Exporter 0 ... Yes (5.66)
Checking if you have Carp 0 ... Yes (1.26)
Checking if you have Test::More 0 ... Yes (0.98)
Checking if you have strict 0 ... Yes (1.07)
Checking if you have Class::Mix 0.001 ... Yes (0.005)
Checking if you have MIME::Base64 2.21 ... Yes (3.13)
Checking if you have Module::Build 0 ... Yes (0.39_01)
Checking if you have ExtUtils::CBuilder 0.15 ... Yes (0.280206)
Building and testing Crypt-Eksblowfish-0.009
Building Crypt-Eksblowfish
gcc -I/usr/perl5/5.16.1/lib/i86pc-solaris-thread-multi-64int/CORE -DXS_VERSION="0.009" -DVERSION="0.009" -fPIC -c -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TS_ERRNO -DPTR_IS_LONG -fno-strict-aliasing -pipe -D_LARGEFILE_
SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -O3 -o lib/Crypt/Eksblowfish.o lib/Crypt/Eksblowfish.c
In file included from lib/Crypt/Eksblowfish.xs:3:0:
/usr/perl5/5.16.1/lib/i86pc-solaris-thread-multi-64int/CORE/perl.h:610:24: fatal error: sys/types.h: No such file or directory
compilation terminated.
error building lib/Crypt/Eksblowfish.o from 'lib/Crypt/Eksblowfish.c' at /usr/perl5/5.16.1/lib/ExtUtils/CBuilder/Base.pm line 177.
-> FAIL Installing Crypt::Eksblowfish::Bcrypt failed. See /home/george/.cpanm/work/1485301763.12637/build.log for details. Retry with --force to force install it.
george@bedford:/bailey/lib/perl$
types.h
中确实存在/usr/include/net-snmp
个文件。如何协调编译要求与系统环境之间的差异。我应该将types.h
文件符号链接到编译器正在查找的位置吗?我怎么能这样做,还是有更好的选择?