Unable to install Image::ExifTool due to 'make test' hanging - perl

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

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

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

Related

Tests for libffi fail on LFS

I am working on a Linux From Scratch project and I've run into some (potential) issues. In chapter 6.49: Libffi-3.2.1, I executed the "sed", "configure" and "make" commands successfully but when I executed "make check", it appears that every test fails:
MAKE x86_64-unknown-linux-gnu : 0 * check
...stuff...
Test run by root on Fri Jul 13 23:51:21 2018
Native configuration is x86_64-unknown-linux-gnu
=== libffi tests ===
Schedule of variations:
unix
Running target unix
...a lot of failures...
FAIL: libffi.call/va_struct3.c -W -Wall -Wno-psabi -Os (test for excess errors)
FAIL: libffi.call/va_struct3.c -W -Wall -Wno-psabi -O2 -fomit-frame-pointer (test for excess errors)
=== libffi Summary ===
# of unexpected failures 685
# of unresolved testcases 685
I've been following the book pretty closely, but maybe I missed something along the way. Should I even worry about this or should I just install it anyway and move on?
Let me know if more information is needed.
Nevermind, I solved it. I basically went back and redid everything.
I usually I copy and paste the commands from the LFS book into a bash script and run it that way (if I can get a away with it). Well, apparently I forgot to write one for the diffutils package. But this seems strange to me because I wouldn't think that missing that script would cause issues with a test that seems to use DejaGNU let alone get me that far without any troubles.
Anyway, my LFS is up and running now! 😁

"cpanm PHP" fails

What should I change in order to install the module? php is 5.3.3 withyum install php-devel in place.
PHP.c: In function ‘PHP_set_php_input’:
PHP.c:818: warning: passing argument 2 of ‘Perl_sv_2pv_flags’ from incompatible pointer type
/home/mpapec/.plenv/versions/5.20.0/lib/perl5/5.20.0/x86_64-linux/CORE/proto.h:3931: note: expected ‘STRLEN * const’ but argument is of type ‘int *’
cc -c -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -Wall -O2 -DVERSION=\"0.15\" -DXS_VERSION=\"0.15\" -fPIC "-I/home/mpapec/.plenv/versions/5.20.0/lib/perl5/5.20.0/x86_64-linux/CORE" array.c
In file included from /usr/include/php/main/php.h:33,
from /usr/include/php/sapi/embed/php_embed.h:23,
from PHP.h:14,
from array.c:9:
/usr/include/php/main/php_config.h:2417:1: warning: "_GNU_SOURCE" redefined
In file included from /home/mpapec/.plenv/versions/5.20.0/lib/perl5/5.20.0/x86_64-linux/CORE/perl.h:28,
from PHP.h:9,
from array.c:9:
/home/mpapec/.plenv/versions/5.20.0/lib/perl5/5.20.0/x86_64-linux/CORE/config.h:1825:1: warning: this is the location of the previous definition
rm -f blib/arch/auto/PHP/PHP.so
cc -shared -O2 -L/usr/local/lib -fstack-protector PHP.o array.o -o blib/arch/auto/PHP/PHP.so \
\
chmod 755 blib/arch/auto/PHP/PHP.so
"/home/mpapec/.plenv/versions/5.20.0/bin/perl5.20.0" -MExtUtils::Command::MM -e 'cp_nonempty' -- PHP.bs blib/arch/auto/PHP/PHP.bs 644
Manifying 1 pod document
Running Mkbootstrap for PHP ()
chmod 644 "PHP.bs"
PERL_DL_NONLAZY=1 "/home/mpapec/.plenv/versions/5.20.0/bin/perl5.20.0" "-Iblib/lib" "-Iblib/arch" test.pl
1..79
not ok 1 - use_ok PHP
# Failed test 'use_ok PHP'
# at test.pl line 11.
not ok 2 - require PHP;
# Failed test 'require PHP;'
# at test.pl line 18.
# Tried to require 'PHP'.
# Error: Attempt to reload PHP.pm aborted.
# Compilation failed in require at (eval 6) line 2.
not ok 3 - eval
# Failed test 'eval'
# at test.pl line 49.
Module PHP failed to load at blib/lib/PHP.pm line 80.
Module PHP failed to load at blib/lib/PHP.pm line 80.
END failed--call queue aborted at test.pl line 50.
# Looks like you planned 79 tests but ran 3.
# Looks like you failed 3 tests of 3 run.
# Looks like your test exited with 22 just after 3.
make: *** [test_dynamic] Error 22
-> FAIL Installing PHP failed. See /home/mpapec/.cpanm/work/1440522239.12833/build.log for details. Retry with --force to force install it.
(
PHP is kind of fragile. It probably won't work out of the box with your system php installation, and may have trouble with 64-bit or multi-threaded versions of perl.
I have only ever gotten it to work on Linux. The latest version I have tried to use is 5.3.8 (back in 2013), though I remember things going smoothly from 5.2.x to 5.3.8.
I always build php from source, with this configuration:
./configure --enable-embed --with-zlib --with-openssl --with-mysql \
--with-libdir=lib/i386-linux-gnu
--enable-embed is absolutely required, as the pod mentions, to build a PHP interpreter with the SAPI extension, and which then allows perl to manipulate the PHP interpreter through XS code. The other extensions were for other requirements of my project; they may be optional, but I haven't experimented with building the PHP interpreter or the PHP module with any other configuration. The pod also says to never use the --with-apxs argument, which I was never tempted to do anyway.
The build process of the PHP module will look for and require a program called php-config. You may need to hack your $PATH, if only during the build process, so that the PHP module runs the correct php-config. After that the module will know where to look for the rest of your php installation.
I had fun working with this module for a while (writing a Catalyst and then a Mojolicious wrapper around WordPress), but it has fallen into disrepair and disrepute. Share whatever you learn trying to build it and we'll put it in the docs, making this module that much easier to use.

Calling sem_open on Solaris as ordinary user

This call fails on Solaris with EACCES when ran as ordinary user:
sem_open(fileName.c_str(), O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO, 1);
When process is started as root, it runs fine. Is this expected behavior?
Environment:
$ uname -a
SunOS solaris 5.11 11.0 i86pc i386 i86pc
$ g++ --version
g++ (GCC) 4.5.2
At the command line try:
prctl $$
These are the system enforced resource limits your process has. Note there are
process.max-sem-ops
process.max-sem-nsems
project.max-sem-ids
These are limits that have a number, if you do not see them (or the limits are already reached) then you have to add them to your account's profile with projadd or projmod to increase them if your project already exists.
If you cannot do this (no root access) consult with your sysadmin, s/he probably has some reason for not allowing semapahore access.
Note carefully:
sempahores are kernel persistent. If you ran your code a bunch of times the sempahores you created are likely still out there.
To see existing semaphores try ipcs -as
To remove lingering sempahores that your code should have removed use ipcrm

Inline::C build failure

I am using active perl 5.14.2. Here I am trying to use a windows C library in my perl code using Inline::C
use strict;
use Inline C => DATA =>
CCFLAGS => '-std:C99 -Tx86-coff -Zi -Ob1 -fp:precise -W1 -Gd -Ze -Go -D_USER_SPACE_' =>
INC => '"-ID:\test\incl"' =>
LIBS => '"-LD:\test\lib" -llib1 -llib2 -llib3 -llib4';
test();
__END__
__C__
#include <incl/hd1.h>
#include <stdio.h>
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
void test(void) {
.........
While I am trying to run the script its failing with below error
Warning. No Inline C functions bound to Perl in .\test.pl
Check your C function definition(s) for Inline compatibility
Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Perl5.14\bin\perl.exe C:\Perl5.14\lib\ExtUtils\xsubpp -typemap "C:\Perl5.14\lib\ExtUtils\typemap" test_pl_7fbb.xs > test_pl_7fbb.xsc && C:\Perl5.14\bin\perl.exe -M
ExtUtils::Command -e "mv" -- test_pl_7fbb.xsc test_pl_7fbb.c
cl -c -I"D:/test" "-ID:\test\incl" -std:C99 -Tx86-coff -Zi -Ob1 -fp:precise -W1 -Gd -Ze -Go -D_USER_SPACE_ -MD -Zi -DNDEBUG -O1 -DVERSIO
N=\"0.00\" -DXS_VERSION=\"0.00\" "-IC:\Perl5.14\lib\CORE" test_pl_7fbb.c
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\cl.EXE"' : return code '0xc0000135'
Stop.
A problem was encountered while attempting to compile and install your Inline
C code. The command that failed was:
C:\PROGRA~2\MICROS~1.0\VC\bin\nmake.exe > out.make 2>&1
The build directory was:
D:\test\_Inline\build\test_pl_7fbb
To debug the problem, cd to the build directory, and inspect the output files.
at .\test.pl line 0
...propagated at C:/Perl5.14/site/lib/Inline/C.pm line 772.
INIT failed--call queue aborted.
PS D:\cmapl_test> perl -v
This is perl 5, version 14, subversion 2 (v5.14.2) built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)
Copyright 1987-2011, Larry Wall
Binary build 1402 [295342] provided by ActiveState http://www.ActiveState.com
Built Oct 7 2011 15:49:44
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.
I tried to build the test_pl_7fbb.c file using the command:
cl -c "-ID:\test" "-ID:\test\include" -std:C99 -Tx86-coff -Zi -Ob1 -fp:precise -W1 -
Gd -Ze -Go -D_USER_SPACE_ -MD -Zi -DNDEBUG -O1 "-DVERSION=0.00"
"-DXS_VERSION=0.00" "-IC:\Perl5.14\lib\CORE" test_pl_7fbb.c
It got completed without error.
My guess the option -I"D:/test" used by Inline while compiling is causing the issue.
Thanks in advance for any help on this.
You seem to have installed Visual C VC-9 (VS 2008), but last time I used Activeperl's Inline C it required VC-6.
If that's the reason, you could try to install VC 6 or switch to Strawberry Perl which has the gcc 4.6 tool chain included.
You could try installing MinGW from ActivePerl's PPM servers. It would probably need a recompile of many of your installed modules to work, but i'm sure it'll make things like Inline::C work properly.

Error with PAR module

I have been trying to build .exe through PAR in windows XP and
my perl version is 5.8.8.. I installed the latest PAR from PPM
I gave the following command in the command prompt,
C:\Documents and Settings\abc\Desktop\serial>pp -o serial.exe serial.pl
Set up gcc environment - 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
Program too big to fit in memory
Access is denied.
Also it throws me the following error popup..
C:\DOCUME~1\abc\LOCALS~1\Temp\parlLoYJMpa.exe is not a valid Win32 application.
Actually my script in just one line code..
I am confused...
Please help me....
Worked fine for me, but then I use pp all the time with no problem. I didn't get any "Set up gcc environment..." message, no messages at all. I'm putting this as an answer because not enough room in the comment for all this:
I did a gcc -v and got:
C:\tools\perl\tests>gcc -v
Reading specs from c:/Perl/site/lib/auto/MinGW/bin/../lib/gcc/mingw32/3.4.5/spec
s
Configured with: ../gcc-3.4.5-20060117-3/configure --with-gcc --with-gnu-ld
--with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads
--disable-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry
--disable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt
--without-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter
--enable-hash-synchronization --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.5 (mingw-vista special r3)