![](/img/trans.png)
[英]Installed JSON module for Perl but cannot load it, Can't locate JSON.pm in @INC
[英]Can't locate Data/Dumper.pm when building dssp - perl is installed but cannot be found?
我正在嘗試在服務器節點(而不是服務器登錄)上構建 dssp( https://github.com/cmbi/dssp ),但我面臨着系統如何查找依賴項的問題。 我正在使用 centos 7。
構建 dssp 的過程是: run ./autogen
以獲取一個configure.sh
文件,然后執行該文件。 然后運行make
。
運行whereis perl
和whereis perl5
我得到:
[mavridks@haswell-182 dssp-2.3.0]$ whereis perl
perl: /usr/bin/perl /usr/share/man/man1/perl.1.gz
[mavridks@haswell-182 dssp-2.3.0]$ whereis perl5
perl5: /usr/lib64/perl5 /usr/share/perl5
然后,運行./autogen
我得到錯誤:
Can't locate Data/Dumper.pm in @INC
(@INC contains:
/hits/sw/shared/apps/Autoconf/2.69-GCC-4.8.4/share/autoconf
/usr/local/lib64/perl5
/usr/local/share/perl5
/usr/lib64/perl5/vendor_perl
/usr/share/perl5/vendor_perl
/usr/lib64/perl5
/usr/share/perl5
.)
at /hits/sw/shared/apps/Autoconf/2.69-GCC-4.8.4/share/autoconf/Autom4te/C4che.pm line 33.
BEGIN failed--compilation aborted
at /hits/sw/shared/apps/Autoconf/2.69-GCC-4.8.4/share/autoconf/Autom4te/C4che.pm line 33.
Compilation failed in require
at /hits/sw/shared/apps/Autoconf/2.69-GCC-4.8.4/bin/autom4te line 37.
BEGIN failed--compilation aborted
at /hits/sw/shared/apps/Autoconf/2.69-GCC-4.8.4/bin/autom4te line 37.
aclocal: error: echo failed with exit status: 2
(為了可讀性添加了換行符。)
在我看來,調用autoconf
時的此錯誤與未正確定位 Perl 文件或路徑多於應有的內容有關? 另一個想法是我在服務器上沒有 root 權限,這可能會產生問題嗎?
歡迎任何想法或建議。
注意:服務器使用模塊系統來加載各種依賴項。 我需要 Autotools 和 Boost。 我正在使用的模塊,如果這很重要,是
[mavridks@haswell-182 dssp-2.3.0]$ module list
Currently Loaded Modules:
1) numactl/.2.0.10-GCC-4.8.4 (H)
2) hwloc/.1.10.1-GCC-4.8.4 (H)
3) OpenMPI/1.8.4-GCC-4.8.4
4) OpenBLAS/0.2.13-GCC-4.8.4-LAPACK-3.5.0
5) gompi/1.7.20
6) FFTW/3.3.4-gompi-1.7.20
7) ScaLAPACK/2.0.2-gompi-1.7.20-OpenBLAS-0.2.13-LAPACK-3.5.0
8) goolf/1.7.20
9) bzip2/.1.0.6-goolf-1.7.20 (H)
10) zlib/.1.2.8-goolf-1.7.20 (H)
11) Boost/1.58.0-goolf-1.7.20
12) slurm/18-08-4-1-hits
13) GCC/4.8.4
14) gcc/dummy
15) sge/dummy
16) M4/1.4.17-GCC-4.8.4
17) Autoconf/2.69-GCC-4.8.4
18) Automake/1.15-GCC-4.8.4
19) libtool/2.4.6-GCC-4.8.4
20) Autotools/20150215-GCC-4.8.4
Where:
H: Hidden Module
編輯:
在 Håkon Hægland 發表評論后,我得到:
[mavridks@haswell-005 ~]$ perl --version | grep 'This is'
This is perl 5, version 30, subversion 0 (v5.30.0) built for x86_64-linux-thread-multi
[mavridks@haswell-005 ~]$ perl -MData::Dumper -E 'say $INC{"Data/Dumper.pm"}'
/hits/sw/shared/apps/Perl/5.30.0-GCCcore-8.3.0/lib/perl5/5.30.0/x86_64-linux-thread-multi/Data/Dumper.pm
編輯 2:這是重新運行./autogen
后的結果
[mavridks@haswell-112 dssp-2.3.0]
$ PERL5LIB=/hits/sw/shared/apps/Perl/5.30.0-GCCcore-8.3.0/lib/perl5/5.30.0 ./autogen.sh
/hits/sw/shared/apps/Automake/1.15-GCC-4.8.4/bin/aclocal:
Perl lib version (5.30.0) doesn't match executable '/usr/bin/perl' version (5.16.3)
at /hits/sw/shared/apps/Perl/5.30.0-GCCcore-8.3.0/lib/perl5/5.30.0/x86_64-linux-thread-multi/Config.pm line 62.
Compilation failed in require
at /hits/sw/shared/apps/Automake/1.15-GCC-4.8.4/share/automake-1.15/Automake/Config.pm line 41.
BEGIN failed--compilation aborted
at /hits/sw/shared/apps/Automake/1.15-GCC-4.8.4/share/automake-1.15/Automake/Config.pm line 41.
Compilation failed in require
at /hits/sw/shared/apps/Automake/1.15-GCC-4.8.4/bin/aclocal line 37.
BEGIN failed--compilation aborted
at /hits/sw/shared/apps/Automake/1.15-GCC-4.8.4/bin/aclocal line 37.
(為了可讀性添加了換行符。)
編輯 3:
經過大量有用的評論和答案后,我添加了更多信息:
第一個連接到服務器登錄節點。 運行 whereis perl 給出:
[mavridks@haswell-login ~]$ whereis perl
perl: /usr/bin/perl /usr/share/man/man1/perl.1.gz
而且,運行
[mavridks@haswell-login ~]$ perl --version
This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-
linux-thread-multi
(with 39 registered patches, see perl -V for more detail)
.最后一個得到:
[mavridks@haswell-login ~]$ perl -MData::Dumper -E 'say
$INC{"Data/Dumper.pm"}'
/usr/lib64/perl5/vendor_perl/Data/Dumper.pm
旁注:我們運行 perl -V 會得到什么?
a) 在登錄節點上:
[mavridks@haswell-login ~]$ perl -V
Summary of my perl5 (revision 5 version 16 subversion 3) configuration:
Platform:
osname=linux, osvers=3.10.0-693.17.1.el7.x86_64, archname=x86_64-linux-thread-multi
uname='linux x86-01.bsys.centos.org 3.10.0-693.17.1.el7.x86_64 #1 smp thu jan 25 20:13:58 utc 2018 x86_64 x86_64 x86_64 gnulinux '
config_args='-des -Doptimize=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -Dccdlflags=-Wl,--enable-new-dtags -Dlddlflags=-shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -Wl,-z,relro -DDEBUGGING=-g -Dversion=5.16.3 -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dprefix=/usr -Dvendorprefix=/usr -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl5 -Dsitearch=/usr/local/lib64/perl5 -Dprivlib=/usr/share/perl5 -Dvendorlib=/usr/share/perl5/vendor_perl -Darchlib=/usr/lib64/perl5 -Dvendorarch=/usr/lib64/perl5/vendor_perl -Darchname=x86_64-linux-thread-multi -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Duseshrplib -Dusethreads -Duseithreads -Dusedtrace=/usr/bin/dtrace -Duselargefiles -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl=n -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr -Dd_gethostent_r_proto -Ud_endhostent_r_proto -Ud_sethostent_r_proto -Ud_endprotoent_r_proto -Ud_setprotoent_r_proto -Ud_endservent_r_proto -Ud_setservent_r_proto -Dscriptdir=/usr/bin -Dusesitecustomize'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic',
cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
ccversion='', gccversion='4.8.5 20150623 (Red Hat 4.8.5-36)', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -fstack-protector'
libpth=/usr/local/lib64 /lib64 /usr/lib64
libs=-lresolv -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat
perllibs=-lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.17'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,--enable-new-dtags -Wl,-rpath,/usr/lib64/perl5/CORE'
cccdlflags='-fPIC', lddlflags='-shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -Wl,-z,relro '
Characteristics of this binary (from libperl):
Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS
PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT
PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_ALL
USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE
USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF
USE_REENTRANT_API USE_SITECUSTOMIZE
Locally applied patches:
Fedora Patch1: Removes date check, Fedora/RHEL specific
Fedora Patch3: support for libdir64
Fedora Patch4: use libresolv instead of libbind
Fedora Patch5: USE_MM_LD_RUN_PATH
Fedora Patch6: Skip hostname tests, due to builders not being network capable
Fedora Patch7: Dont run one io test due to random builder failures
Fedora Patch9: Fix find2perl to translate ? glob properly (RT#113054)
Fedora Patch10: Fix broken atof (RT#109318)
Fedora Patch13: Clear $@ before "do" I/O error (RT#113730)
Fedora Patch14: Do not truncate syscall() return value to 32 bits (RT#113980)
Fedora Patch15: Override the Pod::Simple::parse_file (CPANRT#77530)
Fedora Patch16: Do not leak with attribute on my variable (RT#114764)
Fedora Patch17: Allow operator after numeric keyword argument (RT#105924)
Fedora Patch18: Extend stack in File::Glob::glob, (RT#114984)
Fedora Patch19: Do not crash when vivifying $|
Fedora Patch20: Fix misparsing of maketext strings (CVE-2012-6329)
Fedora Patch21: Add NAME headings to CPAN modules (CPANRT#73396)
Fedora Patch22: Fix leaking tied hashes (RT#107000) [1]
Fedora Patch23: Fix leaking tied hashes (RT#107000) [2]
Fedora Patch24: Fix leaking tied hashes (RT#107000) [3]
Fedora Patch25: Fix dead lock in PerlIO after fork from thread (RT#106212)
Fedora Patch26: Make regexp safe in a signal handler (RT#114878)
Fedora Patch27: Update h2ph(1) documentation (RT#117647)
Fedora Patch28: Update pod2html(1) documentation (RT#117623)
Fedora Patch29: Document Math::BigInt::CalcEmu requires Math::BigInt (CPAN RT#85015)
RHEL Patch30: Use stronger algorithm needed for FIPS in t/op/crypt.t (RT#121591)
RHEL Patch31: Make *DBM_File desctructors thread-safe (RT#61912)
RHEL Patch32: Use stronger algorithm needed for FIPS in t/op/taint.t (RT#123338)
RHEL Patch33: Remove CPU-speed-sensitive test in Benchmark test
RHEL Patch34: Make File::Glob work with threads again
RHEL Patch35: Fix CRLF conversion in ASCII FTP upload (CPAN RT#41642)
RHEL Patch36: Do not leak the temp utf8 copy of namepv (CPAN RT#123786)
RHEL Patch37: Fix duplicating PerlIO::encoding when spawning threads (RT#31923)
RHEL Patch38: Add SSL support to Net::SMTP (CPAN RT#93823) [1]
RHEL Patch39: Add SSL support to Net::SMTP (CPAN RT#93823) [2]
RHEL Patch40: Add SSL support to Net::SMTP (CPAN RT#93823) [3]
RHEL Patch41: Add SSL support to Net::SMTP (CPAN RT#93823) [4]
RHEL Patch42: Do not overload ".." in Math::BigInt (CPAN RT#80182)
RHEL Patch43: Fix CVE-2018-18311 Integer overflow leading to buffer overflow
Built under linux
Compiled at Jan 21 2019 22:09:19
@INC:
/usr/local/lib64/perl5
/usr/local/share/perl5
/usr/lib64/perl5/vendor_perl
/usr/share/perl5/vendor_perl
/usr/lib64/perl5
/usr/share/perl5
.
[mavridks@haswell-login ~]$
b) 在 GPU 節點上:
[mavridks@haswell-179 ~]$ perl -V
Summary of my perl5 (revision 5 version 16 subversion 3) configuration:
Platform:
osname=linux, osvers=3.10.0-693.17.1.el7.x86_64, archname=x86_64-linux-thread-multi
uname='linux x86-01.bsys.centos.org 3.10.0-693.17.1.el7.x86_64 #1 smp thu jan 25 20:13:58 utc 2018 x86_64 x86_64 x86_64 gnulinux '
config_args='-des -Doptimize=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -Dccdlflags=-Wl,--enable-new-dtags -Dlddlflags=-shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -Wl,-z,relro -DDEBUGGING=-g -Dversion=5.16.3 -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dprefix=/usr -Dvendorprefix=/usr -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl5 -Dsitearch=/usr/local/lib64/perl5 -Dprivlib=/usr/share/perl5 -Dvendorlib=/usr/share/perl5/vendor_perl -Darchlib=/usr/lib64/perl5 -Dvendorarch=/usr/lib64/perl5/vendor_perl -Darchname=x86_64-linux-thread-multi -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Duseshrplib -Dusethreads -Duseithreads -Dusedtrace=/usr/bin/dtrace -Duselargefiles -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl=n -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr -Dd_gethostent_r_proto -Ud_endhostent_r_proto -Ud_sethostent_r_proto -Ud_endprotoent_r_proto -Ud_setprotoent_r_proto -Ud_endservent_r_proto -Ud_setservent_r_proto -Dscriptdir=/usr/bin -Dusesitecustomize'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic',
cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
ccversion='', gccversion='4.8.5 20150623 (Red Hat 4.8.5-36)', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -fstack-protector'
libpth=/usr/local/lib64 /lib64 /usr/lib64
libs=-lresolv -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat
perllibs=-lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.17'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,--enable-new-dtags -Wl,-rpath,/usr/lib64/perl5/CORE'
cccdlflags='-fPIC', lddlflags='-shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -Wl,-z,relro '
Characteristics of this binary (from libperl):
Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS
PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT
PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_ALL
USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE
USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF
USE_REENTRANT_API USE_SITECUSTOMIZE
Locally applied patches:
Fedora Patch1: Removes date check, Fedora/RHEL specific
Fedora Patch3: support for libdir64
Fedora Patch4: use libresolv instead of libbind
Fedora Patch5: USE_MM_LD_RUN_PATH
Fedora Patch6: Skip hostname tests, due to builders not being network capable
Fedora Patch7: Dont run one io test due to random builder failures
Fedora Patch9: Fix find2perl to translate ? glob properly (RT#113054)
Fedora Patch10: Fix broken atof (RT#109318)
Fedora Patch13: Clear $@ before "do" I/O error (RT#113730)
Fedora Patch14: Do not truncate syscall() return value to 32 bits (RT#113980)
Fedora Patch15: Override the Pod::Simple::parse_file (CPANRT#77530)
Fedora Patch16: Do not leak with attribute on my variable (RT#114764)
Fedora Patch17: Allow operator after numeric keyword argument (RT#105924)
Fedora Patch18: Extend stack in File::Glob::glob, (RT#114984)
Fedora Patch19: Do not crash when vivifying $|
Fedora Patch20: Fix misparsing of maketext strings (CVE-2012-6329)
Fedora Patch21: Add NAME headings to CPAN modules (CPANRT#73396)
Fedora Patch22: Fix leaking tied hashes (RT#107000) [1]
Fedora Patch23: Fix leaking tied hashes (RT#107000) [2]
Fedora Patch24: Fix leaking tied hashes (RT#107000) [3]
Fedora Patch25: Fix dead lock in PerlIO after fork from thread (RT#106212)
Fedora Patch26: Make regexp safe in a signal handler (RT#114878)
Fedora Patch27: Update h2ph(1) documentation (RT#117647)
Fedora Patch28: Update pod2html(1) documentation (RT#117623)
Fedora Patch29: Document Math::BigInt::CalcEmu requires Math::BigInt (CPAN RT#85015)
RHEL Patch30: Use stronger algorithm needed for FIPS in t/op/crypt.t (RT#121591)
RHEL Patch31: Make *DBM_File desctructors thread-safe (RT#61912)
RHEL Patch32: Use stronger algorithm needed for FIPS in t/op/taint.t (RT#123338)
RHEL Patch33: Remove CPU-speed-sensitive test in Benchmark test
RHEL Patch34: Make File::Glob work with threads again
RHEL Patch35: Fix CRLF conversion in ASCII FTP upload (CPAN RT#41642)
RHEL Patch36: Do not leak the temp utf8 copy of namepv (CPAN RT#123786)
RHEL Patch37: Fix duplicating PerlIO::encoding when spawning threads (RT#31923)
RHEL Patch38: Add SSL support to Net::SMTP (CPAN RT#93823) [1]
RHEL Patch39: Add SSL support to Net::SMTP (CPAN RT#93823) [2]
RHEL Patch40: Add SSL support to Net::SMTP (CPAN RT#93823) [3]
RHEL Patch41: Add SSL support to Net::SMTP (CPAN RT#93823) [4]
RHEL Patch42: Do not overload ".." in Math::BigInt (CPAN RT#80182)
Built under linux
Compiled at Oct 30 2018 18:59:43
@INC:
/usr/local/lib64/perl5
/usr/local/share/perl5
/usr/lib64/perl5/vendor_perl
/usr/share/perl5/vendor_perl
/usr/lib64/perl5
/usr/share/perl5
.
然后一個連接到一個 GPU 節點。 似乎我們仍然擁有相同的 perl:
[mavridks@haswell-179 ~]$ whereis perl perl: /usr/bin/perl /usr/share/man/man1/perl.1.gz
但現在 Data/Dumber 不復存在(運行 perl -MData::Dumper -E 'say $INC{"Data/Dumper.pm"}' ):
[mavridks@haswell-179 ~]$ perl -MData::Dumper -E 'say $INC{"Data/Dumper.pm"}'
Can't locate Data/Dumper.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .).
BEGIN failed--compilation aborted.
然后IT部門建議加載perl模塊; 服務器建立在模塊系統上,其中所有組都能夠將軟件作為模塊加載(在路徑中附加正確的文件 - 這是使用的系統https://lmod.readthedocs.io/en/latest/#overview ) . 所以,如果我們運行 module load Perl,我們有:
[mavridks@haswell-179 ~]$ whereis perl perl: /usr/bin/perl /hits/sw/shared/apps/Perl/5.30.0-GCCcore-8.3.0/bin/perl /usr/share/man/ man1/perl.1.gz
這意味着我們已經改變了一些東西(我可以說使用的分布?)。 但現在我們有:
[mavridks@haswell-179 ~]$ perl -MData::Dumper -E 'say $INC{"Data/Dumper.pm"}'
/hits/sw/shared/apps/Perl/5.30.0-GCCcore-8.3.0/lib/perl5/5.30.0/x86_64-linux-thread-multi/Data/Dumper.pm
這意味着我們在系統上有數據/轉儲程序。
最后,還需要將所有自動工具作為一個模塊加載。 然后,似乎 autogen.sh 腳本的執行正在從系統中尋找 perl 模塊(來自 login 而不是 gpu 的模塊),但當然它無法找到它們。
[mavridks@haswell-179 dssp-2.3.0]$ ./autogen.sh 在@INC 中找不到 Data/Dumper.pm(@INC 包含:/hits/sw/shared/apps/Autoconf/2.69-GCC- 4.8.4/share/autoconf /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/ perl5 .) at /hits/sw/shared/apps/Autoconf/2.69-GCC-4.8.4/share/autoconf/Autom4te/C4che.pm line 33. BEGIN failed--編譯在/hits/sw/shared/apps中止/Autoconf/2.69-GCC-4.8.4/share/autoconf/Autom4te/C4che.pm line 33. 編譯失敗在 /hits/sw/shared/apps/Autoconf/2.69-GCC-4.8.4/bin/autom4te第 37 行 BEGIN 失敗--編譯在 /hits/sw/shared/apps/Autoconf/2.69-GCC-4.8.4/bin/autom4te 第 37 行中止。aclocal:錯誤:echo 失敗,退出狀態:2
您安裝了兩個版本的perl
。
/usr/bin/perl
, v5.16.3 [1]/hits/sw/shared/apps/Perl/5.30.0-GCCcore-8.3.0/bin/perl
, v5.30.0 [2] 我將分別稱它們為“系統perl
”和“模塊化perl
”。
perl
沒有安裝 Data::Dumper。 [3]perl
確實安裝了 Data::Dumper。 [4] whereis
在你的 PATH 中只顯示系統perl
,但后面的命令顯示perl
調用模塊化perl
。 所以要么perl
是模塊化perl
的別名, [5]要么你在不同的環境中運行你的測試(即你的 PATH 改變了)。
設置PERL5LIB
是否合適?
有一次,您將 env var PERL5LIB
設置為/hits/sw/shared/apps/Perl/5.30.0-GCCcore-8.3.0/lib/perl5/5.30.0
。 這是不合適的。
這對於系統perl
是不正確的。 [6]
這對於模塊化perl
是不必要的。 這是多余的。 [7]
為什么系統perl
沒有安裝 Data::Dumper?
Perl 附帶了某些模塊。 實際上,只要 Perl 中存在對模塊的支持,就包括 Data::Dumper。 Data::Dumper 應該始終可用。
但是,某些 linux 發行版將 Perl 拆分為多個包。 似乎在 CentOS 7 的perl(Data::Dumper)
包中找到了perl(Data::Dumper)
。
所以解決方案是安裝該軟件包。
由於 Data::Dumper 是雙活的,它也可以從 CPAN 安裝。 這不需要任何特殊權限。 也就是說,我通常建議在本地安裝perl
而不是搞亂系統perl
。 看來你已經有了這樣的 Perl。 這將我們引向下一個子答案。
如果我想使用模塊化perl
怎么辦?
我不知道。
一個快速的實驗讓我相信這可以通過簡單地將模塊化perl
放在/usr/bin
之前的 PATH 中來解決。
export PATH="/hits/sw/shared/apps/Perl/5.30.0-GCCcore-8.3.0/bin:$PATH"
或者,快速實驗表明以下兩種方法也有效:
./configure PERL=/hits/sw/shared/apps/Perl/5.30.0-GCCcore-8.3.0/bin/perl
PERL=/hits/sw/shared/apps/Perl/5.30.0-GCCcore-8.3.0/bin/perl ./configure
如果這些都不起作用,這可以作為一個單獨的問題提出。
如果我不同意此答案中的某些內容怎么辦?
我的一些陳述是猜測。 例如, /hits/sw/shared/apps/Perl/5.30.0-GCCcore-8.3.0/bin/perl
在您的問題中沒有提及。 如果您認為我犯了一個錯誤,請提供以下命令的輸出(括號和所有):
(
echo 'System perl:'
/usr/bin/perl -v | grep 'This is'
PERL5LIB= /usr/bin/perl -e'CORE::say for @INC'
echo
echo "Data::Dumper in system perl?"
PERL5LIB= /usr/bin/perl -e'
use Data::Dumper;
CORE::say $Data::Dumper::VERSION;
CORE::say INC{"Data/Dumper.pm"};
'
echo
echo 'Modular perl:'
/hits/sw/shared/apps/Perl/5.30.0-GCCcore-8.3.0/bin/perl -v | grep 'This is'
PERL5LIB= /hits/sw/shared/apps/Perl/5.30.0-GCCcore-8.3.0/bin/perl -e'CORE::say for @INC'
echo
echo "Data::Dumper in modular perl?"
PERL5LIB= /hits/sw/shared/apps/Perl/5.30.0-GCCcore-8.3.0/bin/perl -e'
use Data::Dumper;
CORE::say $Data::Dumper::VERSION;
CORE::say $INC{"Data/Dumper.pm"};
'
echo
echo 'Perl env vars:'
perl -e'CORE::say "$_: $ENV{$_}" for grep /^PERL/, keys(%ENV)'
echo
echo 'type perl:'
type perl
)
腳注。
這可以使用驗證
/usr/bin/perl -v | grep 'This is'
這可以使用驗證
/hits/sw/shared/apps/Perl/5.30.0-GCCcore-8.3.0/bin/perl -v | grep 'This is'
這可以使用驗證
/usr/bin/perl -e'use Data::Dumper;'
這可以使用驗證
/hits/sw/shared/apps/Perl/5.30.0-GCCcore-8.3.0/bin/perl -e'use Data::Dumper;'
在某些 shell(包括dash
、 bash
和ksh
)中,可以使用
type perl
這就是導致Perl lib version (5.30.0) doesn't match executable '/usr/bin/perl' version (5.16.3)
。
這可以使用驗證
PERL5LIB= /hits/sw/shared/apps/Perl/5.30.0-GCCcore-8.3.0/bin/perl -e'CORE::say for @INC;'
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.