简体   繁体   中英

How to best manage the multiple versions of Perl on HPC environment which are installed in a centralized, yet customized locations?

In the HPC/cluster computing environment, most of the applications are usually installed as 'MODULE' in customized centralized repository, and also most often, many different versions of the software application may need to coexist. Perl is one of such commonly used general programming language. And I would like to ask for the best practice/solution to be able to not only install multiple Perl version in an isolated setting from each other, but also be able to add on more customized perl module later on to different perl installation. For example, I might need to add bioperl/1.7.2 to Perl/5.28.1, but will install bioperl/1.7.8 in perl/5.36.0. There are quite a lot suggestions on the Inte.net for how to achieve this. But I would like to find some more concise and clear way to do it. Based on my own experience, I would say probably the best practice would be making use of CPAN's custom configure file option 'cpan -j'. I will elaborate this later after I post this question.Thanks.

I have googled a lot on this and didn't find a good answer to my specific need. So I will write my own answer based on my so far experience with Perl.

Just use the cpan that was installed by the perl for which you want to install a module.

$ head -n 1 /home/ikegami/usr/perlbrew/perls/5.36.0t/bin/cpan
#!/home/ikegami/usr/perlbrew/perls/5.36.0t/bin/perl

$ /home/ikegami/usr/perlbrew/perls/5.36.0t/bin/cpan Text::CSV_XS
...
Installing /home/ikegami/usr/perlbrew/perls/5.36.0t/lib/site_perl/5.36.0/x86_64-linux-thread-multi/auto/Text/CSV_XS/CSV_XS.so
Installing /home/ikegami/usr/perlbrew/perls/5.36.0t/lib/site_perl/5.36.0/x86_64-linux-thread-multi/Text/CSV_XS.pm
Installing /home/ikegami/usr/perlbrew/perls/5.36.0t/man/man3/Text::CSV_XS.3
Appending installation info to /home/ikegami/usr/perlbrew/perls/5.36.0t/lib/5.36.0/x86_64-linux-thread-multi/perllocal.pod
  HMBRAND/Text-CSV_XS-1.49.tgz
  /usr/bin/make install  -- OK

$ head -n 1 /home/ikegami/usr/perlbrew/perls/5.34.0t/bin/cpan
#!/home/ikegami/usr/perlbrew/perls/5.34.0t/bin/perl

$ /home/ikegami/usr/perlbrew/perls/5.34.0t/bin/cpan Text::CSV_XS
...
Installing /home/ikegami/usr/perlbrew/perls/5.34.0t/lib/site_perl/5.34.0/x86_64-linux-thread-multi/auto/Text/CSV_XS/CSV_XS.so
Installing /home/ikegami/usr/perlbrew/perls/5.34.0t/lib/site_perl/5.34.0/x86_64-linux-thread-multi/Text/CSV_XS.pm
Installing /home/ikegami/usr/perlbrew/perls/5.34.0t/man/man3/Text::CSV_XS.3
Appending installation info to /home/ikegami/usr/perlbrew/perls/5.34.0t/lib/5.34.0/x86_64-linux-thread-multi/perllocal.pod
  HMBRAND/Text-CSV_XS-1.49.tgz
  /usr/bin/make install  -- OK

perlbrew can help you install multiple Perl builds, and it can help you manipulate which one is found the PATH in a shell. While the Perl builds in the example were installed with the help of perlbrew , that's not required.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM