perl - 如何在 Perl 中安装 Parallel::ForkManager?

标签 perl

我厌倦了通过使用 Parallel:ForkManager 的 perl 脚本并行运行多个作业。

#!/usr/bin/perl  -w

use Parallel::ForkManager;

my @make_obj = qw(
 mode1_testlist
 mode1_testlist1
 mode1_testlist2
);

my $fm = $pm = Parallel::ForkManager-> new(3);
foreach my $obj (@make_obj) {
  $fm->start and next;
  print("make regression MODE=1 MODELIST=$make_obj");
  $fm->finish();
}

但它使我低于错误。

Can't locate Parallel/ForkManager.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at parallel_run.pl line 3. BEGIN failed--compilation aborted at parallel_run.pl line 3.

我已经下载了 Parallel-ForkManager-1.03.tar.gz 但我不知道把它放在哪里我的意思是如何安装它。

我尝试了 perl Makefile.PL && make test && make install:

WARNING: META_MERGE is not a known parameter.
WARNING: BUILD_REQUIRES is not a known parameter.
WARNING: LICENSE is not a known parameter.
Checking if your kit is complete...
Looks good
'BUILD_REQUIRES' is not a known MakeMaker parameter name.
'LICENSE' is not a known MakeMaker parameter name.
'META_MERGE' is not a known MakeMaker parameter name.
Writing Makefile for Parallel::ForkManager
cp lib/Parallel/ForkManager.pm blib/lib/Parallel/ForkManager.pm
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e"test_harness(0,'blib/lib', 'blib/arch')" t/*.t
                                                                                            t/00-load.............ok 1/3    (in cleanup) Undefined subroutine 
&File::Path::remove_tree called at /h/altera_dump2/vjain419/regression_flow_bck
/regression_flow/MSS1/hw/verif/top_/00e/tools/Parallel-ForkManager-1.03/blib
/lib/Parallel  /ForkManager.pm line 662.
t/00-load.............ok
t/01-utf8-all.........skipped
    all skipped: Need utf8::all for this test crashing on Windows
    t/02-callback.........Array found where operator expected at t/02-callback.t line
    21,at  end of line
    (Do you need to predeclare explain?)
    syntax error at t/02-callback.t line 21, near "explain @out"
   xecution of t/02-callback.t aborted due to compilation errors.
   # Looks like your test died before it could output anything.
   t/02-callback.........dubious                                                
    Test returned status 255 (wstat 65280, 0xff00)
     DIED. FAILED tests 1-2
    Failed 2/2 tests, 0.00% okay
    t/03-callback-data....Array found where operator expected at t/03-callback-data.t line 13, at end of line
    (Do you need to predeclare explain?)
   syntax error at t/03-callback-data.t line 13, near "explain @out"
   Execution of t/03-callback-data.t aborted due to compilation errors.
    # Looks like your test died before it could output anything.
    t/03-callback-data....dubious                                                
    Test returned status 255 (wstat 65280, 0xff00)
    DIED. FAILED test 1
    Failed 1/1 tests, 0.00% okay
   Failed Test          Stat Wstat Total Fail  Failed  List of Failed
   t/02-callback.t       255 65280     2    4 200.00%  1-2
   t/03-callback-data.t  255 65280     1    2 200.00%  1
   1 test skipped.
   Failed 2/4 test scripts, 50.00% okay. 3/6 subtests failed, 50.00% okay.
   make: *** [test_dynamic] Error 255 

最佳答案

就用

cpan Parallel::ForkManager

或者,在确保安装了依赖项(POSIX、Storable、File::Spec、File::Temp、File::Path 2.00 和 Test::More 0.81_01)后执行以下命令:

tar xvzf Parallel-ForkManager-1.03.tar.gz
cd Parallel-ForkManager-1.03
perl Makefile.PL && make test && make install

关于perl - 如何在 Perl 中安装 Parallel::ForkManager?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16162539/

相关文章:

perl - 我是否应该使用核心模块 Net::Ping,即使它在 CPAN 测试器上有这么多失败?

perl - 在 foreach 循环中死亡时未按良好顺序执行的行

windows - 使用 Perl 脚本模拟按下键盘 F 键

mysql - 如何检查 Perl 模块 (DBD::mysql) 是否正确安装?

regex - 如何在正则表达式中结合正面和负面条件?

c - 使用 gcovr Linux 和 perl 的自动覆盖测试 C 程序

r - 合并列,但它进入 perl 代码中的新行

mysql - 减少 DBI::common::Fetch 的调用 (Perl)

windows - perl if( -e "带空格路径的窗口){}

linux - 计算管道分隔文件中的列数