构建 dssp 时找不到 Data/Dumper.pm - perl 已安装但找不到?

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 perlwhereis 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:

经过大量有用的评论和回答后,我添加了更多信息:

  1. 第一个连接到服务器登录节点。 运行 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

旁注:我们得到什么 运行ning 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
    .
  1. 然后连接到一个GPU节点。看来我们仍然有相同的 perl:

    [mavridks@haswell-179 ~]$ whereis perl perl: /usr/bin/perl /usr/share/man/man1/perl.1.gz

但现在 Data/Dumber 已不复存在(运行ning 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.
  1. 然后IT部门建议加载perl模块;服务器建立在模块系统上,所有组都可以将软件作为模块加载(在路径中附加正确的文件 - 这是使用的系统 https://lmod.readthedocs.io/en/latest/#overview)。所以,如果我们 运行 模块加载 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

这意味着我们在系统上有 Data/Dumper。

  1. 最后,还需要将所有 autotools 作为一个模块加载。然后,似乎 autogen.sh 脚本的执行正在从系统中寻找 perl 模块(来自登录而不是 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 .) 在 /hits/sw/shared/apps/Autoconf/2.69-GCC-4.8.4/share/autoconf/Autom4te/C4che.pm 第 33 行. BEGIN 失败——编译在 /hits/sw/shared/apps/Autoconf/2.69-GCC-4.8.4/share/autoconf/Autom4te/C4che.pm 第 33 行中止。 在 /hits/sw/shared/apps/Autoconf/2.69-GCC-4.8.4/bin/autom4te 第 37 行的 require 中编译失败。 BEGIN 失败——编译在 /hits/sw/shared/apps/Autoconf/2.69-GCC-4.8.4/bin/autom4te 第 37 行中止。 aclocal:错误:回显失败,退出状态: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合适吗?

在某一时刻,您将环境变量 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) package 中似乎找到了 Data::Dumper。

因此解决方案是安装该软件包。

因为Data::Dumper是dual-lived,也可以从CPAN安装。这不需要任何特殊权限。也就是说,我通常建议在本地安装 perl 而不是搞乱系统 perl。看来你已经有了这样的 Perl。这将我们带到下一个 sub-answer.


如果我想使用模块化perl怎么办?

我不确定。

一个快速的实验让我相信这可以通过简单地将模块 perl 放在路径 /usr/bin.

之前来解决。
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 。如果您认为我犯了错误,请提供以下命令的输出(parens 和所有):

(
   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
)

脚注。

  1. 这可以使用

    来验证
    /usr/bin/perl -v | grep 'This is'
    
  2. 这可以使用

    来验证
    /hits/sw/shared/apps/Perl/5.30.0-GCCcore-8.3.0/bin/perl -v | grep 'This is'
    
  3. 这可以使用

    来验证
    /usr/bin/perl -e'use Data::Dumper;'
    
  4. 这可以使用

    来验证
    /hits/sw/shared/apps/Perl/5.30.0-GCCcore-8.3.0/bin/perl -e'use Data::Dumper;'
    
  5. 在某些 shell 中(包括 dashbashksh),可以使用

    来验证
    type perl
    
  6. 这就是导致 Perl lib version (5.30.0) doesn't match executable '/usr/bin/perl' version (5.16.3) 的原因。

  7. 这可以使用

    来验证
    PERL5LIB= /hits/sw/shared/apps/Perl/5.30.0-GCCcore-8.3.0/bin/perl -e'CORE::say for @INC;'