4

I have a Netgear ReadyNAS NV+ on which I'm trying to do some things using perl.

Since the perl installation from the vendor is compiled without the uselargefiles-flag I've tried to compile/install my own version to run in parallell with the system one.

When I first tried to compile perl on the machine itself I ran into trouble as the system is lacking alot of regular system tools which prevents the Configure-script from running properly.

# ./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!

To get around that I installed and used this cross-compiler to build perl on another machine. I could not figure out how to cross-compile using the standard configure-script from perl, so I used this.

After that I could just copy my new perl-folder onto the NAS and have thing like the following work:

# ~/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!

So in some sense I feel I've been successful in my quest to get "my" perl working on the machine.

I get in trouble when I try to install extra modules though.

I've tried installing Image::ExifTool using cpanp (among others), but the installation never finishes.

Today I resorted to trying the installation manually.

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

All work as they're supposed to.

when I get to make test however it hangs indefinitely like so:

# 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 ...........

Looking at the running processes I think these are the ones representing the command:

# 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>

This is completely consistent with what happens when I try the same installation using cpanp.

I guess I could just run make install and hope that it won't be to much of a problem that the test is unable to run/complete, but that makes me feel a bit uneasy. I'd much rather figure out what is wrong.

I also find it odd that the test hangs the way it does, I could accept that it fails, but that it just keeps running in a non-productive manner feels weird.

Since it is the first time I've built perl from source and the first time I've used a cross-compiler I would not be surprised to learn I've done something very wrong, any help identifying what is very welcome.

What am I doing wrong?

EDIT - compiling on the mahcine:

Figured out how to get the Configure script working natively on the machine. Will try to build there to see if that will work better. It'll take some time though, the machine is slow.

To be able to run the configure script I needed:

GCC

apt-get install libc6-dev gcc gdb libtag1-dev uuid-dev

coreutils

apt-get install coreutils

-Dcc=gcc

./Configure -des -Dprefix=$HOME/perl-5.16.2 -Dcc=gcc

EDIT2 - compile failed:

Most shortlived success ever:

# 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 - testdriving fork:

Tried the following to verify that fork works as it should. I believe that the test is successful, but I've never tried fork before, so please let me know if I read the output wrong.

# 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
azzid
  • 371
  • 2
  • 8

2 Answers2

1

I'm a bit late with this comment, and don't have any ideas about your "make test" hang, but I wanted to point out the Image::ExifTool is pure Perl, so it does not require compilation. The install step is as simple as copying the distribution files to the proper directories.

  • Phil
PhilHarvey
  • 886
  • 7
  • 9
0

Gave up on figuring out why the test fails. Ended up using the module anyways. Seems to work OK with my files.

azzid
  • 371
  • 2
  • 8