简体   繁体   English

Perl 将 cpan 安装到特定存储库中

[英]Perl a cpan installation into a specific repository

Hel lo, I'm actually installing a perl module called HmmCleaner here :你好,我实际上在这里安装了一个名为 HmmCleaner 的 perl 模块:

https://metacpan.org/pod/HmmCleaner.pl

for that I use :为此,我使用:

/beegfs/data/me/perl-5.30.1/localperl/bin/cpan Bio::MUST::Apps::HmmCleaner

But I'm actually into a shared cluster where we have 2 principal directories :但我实际上进入了一个共享集群,其中我们有 2 个主要目录:

/beegfs/home/me

And

/beegfs/data/me 

and in the home repository I have a threshold of number of chunk files to not并且在主存储库中,我有一个不包含块文件数量的阈值

I have a threshold that I cannot exceed of the number of chunk files and when I run the /beegfs/data/me/perl-5.30.1/localperl/bin/cpan Bio::MUST::Apps::HmmCleaner command, for some reason some files are created into the home directory and when I look into the log file I see that something is wrong at this moment :我有一个阈值,我不能超过块文件的数量,当我运行/beegfs/data/me/perl-5.30.1/localperl/bin/cpan Bio::MUST::Apps::HmmCleaner命令时,对于出于某种原因,一些文件被创建到主目录中,当我查看日志文件时,我发现此时出现问题:

! Installing Bio::MUST::Core::Utils failed. See /beegfs/home/me/.cpanm/work/1580931498.36405/build.log for details. Retry with --force to force install it.
Warning: unable to close filehandle $out properly: Disk quota exceeded at /beegfs/data/me/perl-5.30.1/localperl/bin/cpanm line 49.
Warning: unable to close filehandle $out properly: Disk quota exceeded at /beegfs/data/me/perl-5.30.1/localperl/bin/cpanm line 49.
Warning: unable to close filehandle $out properly: Disk quota exceeded at /beegfs/data/me/perl-5.30.1/localperl/bin/cpanm line 49.

But when I look into the disk quota in data , both memory and chuck file limit is not reached, but for the home the number of chunk files is exceeded!但是当我查看data的磁盘配额时,没有达到内存和卡盘文件限制,但是对于home ,块文件的数量已经超过了!

Does someone know how can I force to run all the files created in the installation into the data repository instead of home?有人知道如何强制将安装中创建的所有文件运行到数据存储库而不是 home 中吗?

Thank you for your help.感谢您的帮助。

for polarbear :对于北极熊:

When I do :当我做 :

/beegfs/data/me/perl-5.30.1/localperl/bin/cpan -D local::lib

I get : Loading internal logger.我得到:正在加载内部记录器。 Log::Log4perl recommended for better logging Log::Log4perl 推荐用于更好的日志记录

CPAN.pm requires configuration, but most of it can be done automatically.
If you answer 'no' below, you will enter an interactive dialog for each
configuration option instead.

Would you like to configure as much as possible automatically? [yes] yes
Fetching with LWP:
http://www.cpan.org/authors/01mailrc.txt.gz
Reading '/beegfs/home/me/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Fetching with LWP:
http://www.cpan.org/modules/02packages.details.txt.gz
Reading '/beegfs/home/me/.cpan/sources/modules/02packages.details.txt.gz'
  Database was generated on Thu, 06 Feb 2020 08:41:03 GMT
.............
  New CPAN.pm version (v2.27) available.
  [Currently running version is v2.22]
  You might want to try
    install CPAN
    reload cpan
  to both upgrade CPAN.pm and run the new version without leaving
  the current session.


...............................................................DONE
Fetching with LWP:
http://www.cpan.org/modules/03modlist.data.gz
Reading '/beegfs/home/me/.cpan/sources/modules/03modlist.data.gz'
DONE
Writing /beegfs/home/me/.cpan/Metadata
local::lib
-------------------------------------------------------------------------
    (no description)
    H/HA/HAARG/local-lib-2.000024.tar.gz
    (no installation file)
    Installed: not installed
    CPAN:      2.000024  Not up to date
    Graham Knop (HAARG)
    haarg@haarg.org

Lets follow next scenario让我们跟随下一个场景

mv ~/.cpam /beegfs/data/me
ln -s /beegfs/data/me/.cpan ~/.cpan
HOME=/beegfs/data/me perl -Mlocal::lib > ~/.lib_perl

these commands will这些命令将

  • move $HOME/.cpan directory from $HOME to /beegfs/data/me将 $HOME/.cpan 目录从 $HOME 移动到 /beegfs/data/me
  • symlink it in $HOME directory在 $HOME 目录中符号链接它
  • run perl with local::lib module使用 local::lib 模块运行 perl
  • it will check for $SHELL它将检查 $SHELL
  • output configuration variables to $HOME/.lib_perl file将配置变量输出到 $HOME/.lib_perl 文件

Now source $HOME/.lib_perl in your shell environment according your $SHELL (bash - .bashrc, csh - .cshrc, ...) on login into system.现在根据您登录系统时的 $SHELL (bash - .bashrc, csh - .cshrc, ...) 在您的 shell 环境中获取 $HOME/.lib_perl 源。

As you work remotely you have to logout and login to pickup changes (do it in separate terminal just in case if you do something wrong and you need back door to revert your changes).当您远程工作时,您必须注销并登录以获取更改(在单独的终端中进行,以防万一您做错了并且需要后门来恢复您的更改)。

At this point you should be able to use cpan to install modules into /beegfs/data/me/perl5 directory.此时您应该可以使用cpan将模块安装到 /beegfs/data/me/perl5 目录中。

Check if local::lib is installed with following command使用以下命令检查是否安装了local::lib

cpan -D local::lib cpan -D local::lib

If it is installed then head to following webpage local::lib and do some reading - pay attention to point #4.如果已安装,则前往以下网页local::lib并阅读一些内容 - 注意第 4 点。

Otherwise check if cpanm is available in your system.否则检查cpanm在您的系统中是否可用。

As an option you can set variables manually作为一个选项,您可以手动设置变量

PERL_MB_OPT
PERL_MM_OPT
PERL5LIB
PATH
PERL_LOCAL_LIB_ROOT

Before setting private library check that you have write permission on storage directory.在设置私有之前,请检查您是否对存储目录具有写权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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