Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Perl 由于';进行测试';绞刑_Perl_Installation_Cross Compiling_Perl Module_Sparc - Fatal编程技术网

Perl 由于';进行测试';绞刑

Perl 由于';进行测试';绞刑,perl,installation,cross-compiling,perl-module,sparc,Perl,Installation,Cross Compiling,Perl Module,Sparc,我有一个Netgear ReadyNAS NV+,我正试图在上面使用perl做一些事情 由于供应商的perl安装是在没有uselagefiles-标志的情况下编译的,因此我尝试编译/安装自己的版本以与system one并行运行 当我第一次尝试在机器上编译perl时,我遇到了麻烦,因为系统缺少很多常规的系统工具,这会阻止配置脚本正常运行 # ./Configure -des -Dprefix=$HOME/perl-5.16.2 First let's make sure your kit is

我有一个Netgear ReadyNAS NV+,我正试图在上面使用perl做一些事情

由于供应商的perl安装是在没有uselagefiles-标志的情况下编译的,因此我尝试编译/安装自己的版本以与system one并行运行

当我第一次尝试在机器上编译perl时,我遇到了麻烦,因为系统缺少很多常规的系统工具,这会阻止配置脚本正常运行

# ./Configure -des -Dprefix=$HOME/perl-5.16.2
First let's make sure your kit is complete.  Checking...
./Configure: line 1986: split: command not found
cat: /root/dload/perl-5.16.2/UU/x??: No such file or directory
Locating common programs...
I don't know where 'comm' is, and my life depends on it.
Go find a public domain implementation or fix your PATH setting!
为了解决这个问题,我在另一台机器上安装并使用了perl。 我不知道如何使用perl中的标准配置脚本进行交叉编译,所以我使用了

之后,我可以将新的perl文件夹复制到NAS上,并进行如下工作:

# ~/sparc-perl-5.16.2/bin/perl -version

This is perl 5, version 16, subversion 2 (v5.16.2) built for sparc-linux

Copyright 1987-2012, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

# ~/sparc-perl-5.16.2/bin/perl -e 'print "A string!\n";'
A string!
因此,在某种意义上,我觉得我已经成功地在机器上实现了“我的”perl

但是,当我试图安装额外的模块时,我遇到了麻烦

我尝试过使用cpanp(以及其他工具)安装Image::ExifTool,但安装从未完成

今天我尝试手动安装

wget http://search.cpan.org/CPAN/authors/id/E/EX/EXIFTOOL/Image-ExifTool-9.12.tar.gz
tar xzf Image-ExifTool-9.12.tar.gz
cd Image-ExifTool-9.12
~/sparc-perl-5.16.2/bin/perl Makefile.pl
make
所有的工作都是他们应该做的

当我进行测试时,它会无限期地挂起,就像这样:

# make test
PERL_DL_NONLAZY=1 /root/sparc-perl-5.16.2/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/AFCP.t ...........
查看正在运行的进程,我认为这些进程代表了命令:

# ps aux | grep per[l]
root     26187  0.5  0.7 12000 7808 pts/0    S+   10:31   0:07 /root/sparc-perl-5.16.2/bin/perl -MExtUtils::Command::MM -e test_harness(0, 'blib/lib', 'blib/arch') t/AFCP.t t/AIFF.t t/APE.t t/ASF.t t/BigTIFF.t t/BMP.t t/CanonRaw.t t/Canon.t t/CanonVRD.t t/Casio.t t/DICOM.t t/DjVu.t t/DNG.t t/DV.t t/EXE.t t/ExifTool.t t/FLAC.t t/FlashPix.t t/Flash.t t/Font.t t/FotoStation.t t/FujiFilm.t t/Geotag.t t/GeoTiff.t t/GE.t t/GIF.t t/GIMP.t t/GPS.t t/HTML.t t/InDesign.t t/IPTC.t t/ITC.t t/Jpeg2000.t t/JVC.t t/Kodak.t t/KyoceraRaw.t t/Lang.t t/LNK.t t/M2TS.t t/Matroska.t t/MIE.t t/MIFF.t t/Minolta.t t/MP3.t t/MWG.t t/MXF.t t/Nikon.t t/Olympus.t t/OpenEXR.t t/Panasonic.t t/PDF.t t/Pentax.t t/PGF.t t/PhotoCD.t t/PhotoMechanic.t t/Photoshop.t t/PICT.t t/PNG.t t/PostScript.t t/PPM.t t/PSP.t t/QuickTime.t t/Radiance.t t/Real.t t/Ricoh.t t/RIFF.t t/RTF.t t/Sanyo.t t/Sigma.t t/Sony.t t/Unknown.t t/Vorbis.t t/Writer.t t/XMP.t t/ZIP.t
root     26189  1.7  0.0     0    0 pts/0    Z+   10:31   0:24 [perl] <defunct>
coreutils

apt-get install coreutils
-Dcc=gcc

./Configure -des -Dprefix=$HOME/perl-5.16.2 -Dcc=gcc
EDIT2-编译失败:

有史以来最短暂的成功:

# make
`sh  cflags "optimize='-O2'" perlmini.o`  -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB perlmini.c
  CCCMD =  gcc -DPERL_CORE -c -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -O2 -Wall 
In file included from perl.c:33:
perl.h:699: error: conflicting types for `syscall'
/usr/include/unistd.h:939: error: previous declaration of `syscall'
ake: *** [perlmini.o] Error 1
EDIT3-测试驱动叉:

尝试执行以下操作以验证fork是否正常工作。我相信测试是成功的,但我以前从未尝试过fork,所以如果我读错了输出,请告诉我

# cat test_forkwait.px 
#!/root/sparc-perl-5.16.2/bin/perl

$pid = fork();
die if $pid < 0;

$SIG{CHLD} = sub { warn "SIGCHLD\n"; };

if($pid) {
    $status = waitpid($pid, 0);
    warn "wait status: $status\n";
} else {
    warn "Child starting\n";
    sleep 1;
    warn "Child terminating\n";
}

# ./test_forkwait.px 
Child starting
Child terminating
SIGCHLD
wait status: 29913
#cat test_forkwait.px
#!/root/sparc-perl-5.16.2/bin/perl
$pid=fork();
如果$pid<0,则死亡;
$SIG{CHLD}=sub{warn“SIGCHLD\n”;};
如果($pid){
$status=waitpid($pid,0);
警告“等待状态:$status\n”;
}否则{
警告“子系统正在启动\n”;
睡眠1;
警告“子进程终止\n”;
}
#./test_forkwait.px
儿童启动
终止子进程
西格尔德
等待状态:29913

放弃了找出测试失败的原因。最终还是使用了这个模块。我的文件似乎可以正常工作。

我的评论有点晚了,对“make test”挂起的问题没有任何想法,但我想指出Image::ExifTool是纯Perl的,因此不需要编译。安装步骤非常简单,只需将分发文件复制到正确的目录即可

  • 菲尔
# cat test_forkwait.px 
#!/root/sparc-perl-5.16.2/bin/perl

$pid = fork();
die if $pid < 0;

$SIG{CHLD} = sub { warn "SIGCHLD\n"; };

if($pid) {
    $status = waitpid($pid, 0);
    warn "wait status: $status\n";
} else {
    warn "Child starting\n";
    sleep 1;
    warn "Child terminating\n";
}

# ./test_forkwait.px 
Child starting
Child terminating
SIGCHLD
wait status: 29913