Perl 库配置、冲突

Perl 库配置、冲突

我在服务器机器上使用 Perl 时遇到了问题,我不是管理员,但我认为我已经创建了我的环境,在安装 Conda 之前它运行良好。

我使用 brew 安装 Perl,以便它可以帮助我配置他的库。

brew info perl
perl: stable 5.32.0, HEAD
Highly capable, feature-rich programming language
https://www.perl.org/
/lustre/mnad/.linuxbrew/Cellar/perl/5.32.0

如果我调用 cpan 不起作用,则返回以下错误:

ListUtil.c: loadable library and perl binaries are mismatched (got handshake key 0xcd00080, needed 0xed00080)

除非我取消设置 PERL5LIB 环境或在 brew 中将其导出到 Perl

 env | grep PERL
PERL5LIB=/lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/5.32.0:
PERL_MB_OPT=--install_base "/lustre/mnad/perl5"
PERL_LOCAL_LIB_ROOT=:/lustre/mnad/perl5
PERL_MM_OPT=INSTALL_BASE=/lustre/mnad/perl5

当我运行任何 Perl 脚本时,都会发生错误:

Can't locate local/lib.pm in @INC (you may need to install the local::lib module) (@INC contains: /lustre....
Can't locate Text/Soundex.pm in @INC (you may need to install the Text::Soundex module) ....

然后我尝试

cpan[1]> install local::lib
Reading '/lustre/mnad/.cpan/Metadata'
  Database was generated on Tue, 14 Jul 2020 02:17:04 GMT
Running install for module 'local::lib'
Checksum for /lustre/mnad/.cpan/sources/authors/id/H/HA/HAARG/local-lib-2.000024.tar.gz ok
Scanning cache /lustre/mohanad/.cpan/build for sizes
............................................................................DONE
'YAML' not installed, will not store persistent state
Configuring H/HA/HAARG/local-lib-2.000024.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for local::lib
Writing MYMETA.yml and MYMETA.json
  HAARG/local-lib-2.000024.tar.gz
  /lustre/mohanad/.linuxbrew/Cellar/perl/5.32.0/bin/perl Makefile.PL -- OK
Running make for H/HA/HAARG/local-lib-2.000024.tar.gz
cp lib/local/lib.pm blib/lib/local/lib.pm
cp lib/POD2/PT_BR/local/lib.pod blib/lib/POD2/PT_BR/local/lib.pod
cp lib/lib/core/only.pm blib/lib/lib/core/only.pm
cp lib/POD2/DE/local/lib.pod blib/lib/POD2/DE/local/lib.pod
Manifying 4 pod documents
  HAARG/local-lib-2.000024.tar.gz
  /usr/bin/make -- OK
The current configuration of allow_installing_outdated_dists is 'ask/yes', but for this option we would need 'CPAN::DistnameInfo' installed. Please install 'CPAN::DistnameInfo' as soon as possible. As long as we are not equipped with 'CPAN::DistnameInfo' this option does not take effect
Running make test for HAARG/local-lib-2.000024.tar.gz
PERL_DL_NONLAZY=1 "/lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/bad_variables.t ...... ok   
t/carp-mismatch.t ...... ok   
t/classmethod.t ........ ok   
t/de-dup.t ............. ok   
t/lib-core-only.t ...... ok   
t/pipeline.t ........... ok   
t/shell.t .............. ok       
t/stackable.t .......... ok     
t/subroutine-in-inc.t .. ok   
t/taint-mode.t ......... ok   
All tests successful.
Files=10, Tests=220,  7 wallclock secs ( 0.08 usr  0.03 sys +  2.68 cusr  2.53 csys =  5.32 CPU)
Result: PASS
Terminal does not support GetHistory.
Lockfile removed.
  HAARG/local-lib-2.000024.tar.gz
  /usr/bin/make test -- OK
Running make install for HAARG/local-lib-2.000024.tar.gz
Manifying 4 pod documents
Appending installation info to /lustre/mnad/perl5/lib/perl5/x86_64-linux-thread-multi/perllocal.pod
  HAARG/local-lib-2.000024.tar.gz
  /usr/bin/make install  -- OK

cpan[2]> install Text::Soundex
Running install for module 'Text::Soundex'
Checksum for /lustre/mnad/.cpan/sources/authors/id/R/RJ/RJBS/Text-Soundex-3.05.tar.gz ok
Configuring R/RJ/RJBS/Text-Soundex-3.05.tar.gz with Makefile.PL
The XS code will be compiled.
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Text::Soundex
Writing MYMETA.yml and MYMETA.json
  RJBS/Text-Soundex-3.05.tar.gz
  /lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/bin/perl Makefile.PL -- OK
Running make for R/RJ/RJBS/Text-Soundex-3.05.tar.gz
cp Soundex.pm blib/lib/Text/Soundex.pm
Running Mkbootstrap for Soundex ()
chmod 644 "Soundex.bs"
"/lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Soundex.bs blib/arch/auto/Text/Soundex/Soundex.bs 644
"/lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/bin/perl" "/lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/5.32.0/ExtUtils/xsubpp"  -typemap '/lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/5.32.0/ExtUtils/typemap'  Soundex.xs > Soundex.xsc
mv Soundex.xsc Soundex.c
cc -c   -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/lustre/mohanad/.linuxbrew/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O2   -DVERSION=\"3.05\" -DXS_VERSION=\"3.05\" -fPIC "-I/lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/5.32.0/x86_64-linux-thread-multi/CORE"   Soundex.c
rm -f blib/arch/auto/Text/Soundex/Soundex.so
cc  -shared -O2 -L/usr/local/lib -fstack-protector-strong  Soundex.o  -o blib/arch/auto/Text/Soundex/Soundex.so  \
      \
  
chmod 755 blib/arch/auto/Text/Soundex/Soundex.so
Manifying 1 pod document
  RJBS/Text-Soundex-3.05.tar.gz
  /usr/bin/make -- OK
The current configuration of allow_installing_outdated_dists is 'ask/yes', but for this option we would need 'CPAN::DistnameInfo' installed. Please install 'CPAN::DistnameInfo' as soon as possible. As long as we are not equipped with 'CPAN::DistnameInfo' this option does not take effect
Running make test for RJBS/Text-Soundex-3.05.tar.gz
"/lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Soundex.bs blib/arch/auto/Text/Soundex/Soundex.bs 644
PERL_DL_NONLAZY=1 "/lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/basic.t .. ok    
All tests successful.
Files=1, Tests=18,  0 wallclock secs ( 0.03 usr  0.01 sys +  0.01 cusr  0.02 csys =  0.07 CPU)
Result: PASS
  RJBS/Text-Soundex-3.05.tar.gz
  /usr/bin/make test -- OK
Running make install for RJBS/Text-Soundex-3.05.tar.gz
"/lustre/mohanad/.linuxbrew/Cellar/perl/5.32.0/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Soundex.bs blib/arch/auto/Text/Soundex/Soundex.bs 644
Manifying 1 pod document
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Appending installation info to /lustre/mohanad/perl5/lib/perl5/x86_64-linux-thread-multi/perllocal.pod
  RJBS/Text-Soundex-3.05.tar.gz
  /usr/bin/make install  -- OK

两者都已安装,但是当我重新运行 Perl 工具时出现类似的错误:

Can't locate local/lib.pm in @INC (you may need to install the local::lib module) (@INC contains: /lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/5.32.0/x86_64-linux-thread-multi /lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/5.32.0 /lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/site_perl/5.32.0/x86_64-linux-thread-multi /lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/site_perl/5.32.0 /lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/5.32.0/x86_64-linux-thread-multi /lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/5.32.0 /lustre/mnad/.linuxbrew/lib/perl5/site_perl/5.32.0/x86_64-linux-thread-multi /lustre/mnad/.linuxbrew/lib/perl5/site_perl/5.32.0).
BEGIN failed--compilation aborted.
Can't locate Text/Soundex.pm in @INC (you may need to install the Text::Soundex module) (@INC contains: /lustre/mnad/Tools/RM /lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/5.32.0/x86_64-linux-thread-multi /lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/5.32.0 /lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/site_perl/5.32.0/x86_64-linux-thread-multi /lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/site_perl/5.32.0 /lustre/mnad/.linuxbrew/lib/perl5/site_perl/5.32.0/x86_64-linux-thread-multi /lustre/mnad/.linuxbrew/lib/perl5/site_perl/5.32.0) at /lustre/mnad/Tools/RM/Taxonomy.pm line 80.
BEGIN failed--compilation aborted at /lustre/mnad/Tools/RM/Taxonomy.pm line 80.
Compilation failed in require at ./RepeatMasker line 332.
BEGIN failed--compilation aborted at ./RepeatMasker line 332.
/usr/bin/perl: symbol lookup error: /lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/5.32.0/x86_64-linux-thread-multi/auto/Socket/Socket.so: undefined symbol: Perl_xs_handshake

请有人帮助我解决这个问题。

相关内容