We installed Perl (5.26) on our HPC cluster as a module in the modules environment. Because we do not want to install all Perl modules requested by single users on the whole cluster we asked them to install the needed perl modules in one of their directories (home, workspace, ...)
We suggested to use cpanm and local::lib to install the needed modules. Cpanm is installed on our cluster, the user installs local::lib on their own. Then they should be able to install perl modules on their own.
In practice, this just works for some modules. First, we set up local::lib and set the environment
# 1. Install local::lib in your home
wget https://cpan.metacpan.org/authors/id/H/HA/HAARG/local-lib-2.000024.tar.gz
tar xvf local-lib-2.000024.tar.gz
cd local-lib-2.000024
# Install local::lib in your home
perl Makefile.PL --bootstrap
make test && make install
# 2. Configure local::lib, because cpanm uses this configuration. Otherwise cpanm would install modules to system perl, which is not writable for normal users
echo 'eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)"' >>~/.bashrc
source ~/.bashrc;
Now we try to install a module:
cpanm HTML::PullParser
It tries to install the dependency HTML::Tagset, it says HTML::Tagset is installed, but it cannot find the dependency afterwards. There is a directory for Tagsat in the user PERL5LIB directory, but it's empty:
Configuring HTML-Tagset-3.20 ... OK
Building and testing HTML-Tagset-3.20 ... OK
Successfully installed HTML-Tagset-3.20
! Installing the dependencies failed: Module 'HTML::Tagset' is not
installed
! Bailing out the installation for HTML-Parser-3.72.
1 distribution installed
Did someone experience the same behavior and knows how to fix this? For some modules like Math::CDF it worked.
Edit to answer the comments:
PERL5LIB and therefore @INC is changed:
> set | grep ^PERL
PERL5LIB=~/perl5/lib/perl5:/opt/bwhpc/common/devel/perl/5.26/lib/site_perl/5.26.1:/opt/bwhpc/common/devel/perl/5.26/lib
PERL_BIN_DIR=/opt/bwhpc/common/devel/perl/5.26/bin
PERL_HOME=/opt/bwhpc/common/devel/perl/5.26
PERL_LIB_DIR=/opt/bwhpc/common/devel/perl/5.26/lib
PERL_LOCAL_LIB_ROOT=~/perl5
PERL_MAN_DIR=/opt/bwhpc/common/devel/perl/5.26/man
PERL_MB_OPT='--install_base "~/perl5"'
PERL_MM_OPT=INSTALL_BASE=~/perl5
PERL_VERSION=5.26
> perl -I$HOME/perl5/lib/perl5 -Mlocal::lib
PERL_MB_OPT="--install_base \"~/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=~/perl5"; export PERL_MM_OPT;
Output of cpanm with -v:
Unpacking HTML-Tagset-3.20.tar.gz
HTML-Tagset-3.20/
HTML-Tagset-3.20/Tagset.pm
HTML-Tagset-3.20/Makefile.PL
HTML-Tagset-3.20/META.yml
HTML-Tagset-3.20/MANIFEST.SKIP
HTML-Tagset-3.20/MANIFEST
HTML-Tagset-3.20/README
HTML-Tagset-3.20/t/
HTML-Tagset-3.20/t/01_old_junk.t
HTML-Tagset-3.20/t/pod.t
HTML-Tagset-3.20/t/00_about_verbose.t
HTML-Tagset-3.20/Changes
Entering HTML-Tagset-3.20
Checking configure dependencies from META.yml
Running Makefile.PL
Configuring HTML-Tagset-3.20 ... Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for HTML::Tagset
Writing MYMETA.yml and MYMETA.json
OK
Checking dependencies from MYMETA.json ...
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.24)
Building and testing HTML-Tagset-3.20 ... cp Tagset.pm blib/lib/HTML/Tagset.pm
Manifying 1 pod document
PERL_DL_NONLAZY=1 "/cluster/bwhpc/common/devel/perl/5.26/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00_about_verbose.t .. ok
t/01_old_junk.t ....... ok
t/pod.t ............... skipped: Test::Pod 1.14 required for testing POD
All tests successful.
Files=3, Tests=3, 0 wallclock secs ( 0.02 usr 0.01 sys + 0.04 cusr 0.02 csys = 0.09 CPU)
Result: PASS
Manifying 1 pod document
Appending installation info to ~/perl5/lib/perl5/x86_64-linux-thread-multi/perllocal.pod
OK
Successfully installed HTML-Tagset-3.20
Installing ~/perl5/lib/perl5/x86_64-linux-thread-multi/.meta/HTML-Tagset-3.20/install.json
! Installing the dependencies failed: Module 'HTML::Tagset' is not installed
! Bailing out the installation for HTML-Parser-3.72.
1 distribution installed
@INC
. I suggestexport PERL5LIB=~/perl5/lib/perl5
– Borodinset | grep ^PERL
.source ~/.bashrc
should have setup some env vars (incl aforementionedPERL5LIB
). – ikegamiperl -I$HOME/perl5/lib/perl5 -Mlocal::lib
– ikegamicpanm
hides useful output. Could you please try to install the module again, but using-v
this time – ikegamiset | grep ^PERL
,cpanm -v
andperl -I$HOME/perl5/lib/perl5 -Mlocal::lib
. – Fex