After installing terapaths using the install script we are encountering a problem on iepm-raptor1 AMD64 machine, whereby when we try to load a perl module using the perl -M option it gives the following error message:

akbar@iepm-raptor1 $ perl -MRRDs
Can't load '/afs/slac.stanford.edu/u/sg/akbar/opt/terapaths_raptor/lib/lib/site_perl/5.8.8/i386_linux24/auto/RRDs/RRDs.so' for module RR
Ds: /afs/slac.stanford.edu/u/sg/akbar/opt/terapaths_raptor/lib/lib/site_perl/5.8.8/i386_linux24/auto/RRDs/RRDs.so: cannot open shared ob
ject file: No such file or directory at /afs/slac.stanford.edu/package/perl/lib/5.8.8/i386_linux24/DynaLoader.pm line 230.
 at - line 0
Compilation failed in require.
BEGIN failed--compilation aborted.

In the above example I tried to load the RRDs.pm module which was installed in the /afs/slac.stanford.edu/u/sg/akbar/opt/terapaths_raptor/lib/lib/site_perl/5.8.8/i386_linux24/auto/RRDs/ directory by the install script. The error says that it cannot load the RRDs.so file which is the compiled dynamic link library of the module. Upon checking for the existence of this file in the required location we observe that it is indeed present.

After extensive search on the web for solutions, I tried changing the LD_LIBRARY_PATH and the to point to the library and also tried changing the contents of /etc/so.ld.conf to reflect the required path so that the dynamic link library would be automatically picked up by perl but that did not work.

Similarly changing the make file to use a different version of perl also did not work.

After consulation with John Bartlet and Alf, the problem was narrowed down to the fact that the RRDs.so file generated was 64-bit, while the version of perl being used to load the module is the version at /usr/local/bin/perl which is basically a symlink to the 32-bit afs version of perl.

I tried changing the PERL variable in the makefile to /usr/bin/perl which is the local 64-bit version of perl and then reinstalling the whole library. Next I tried loading the library using the /usr/bin/perl so that everything was 64-bit. This did not work as well giving the same error.

Next I did a fresh installation of the terapaths on pinger.slac.stanford.edu which is a 32-bit machine. After setting the PERL5LIB to the appropriate path and loading the RRDs.pm module it worked fine.

Afterwards I did a fresh installation on the AMD64 iepm-raptor1 machine again. I compared the makefiles generated by the configure script for the RRDs package on both the pinger and iepm-raptor1 machines and discovered that the problem was that while the script was using 32-bit AFS perl to compile the module, it was using 64-bit gcc to RRcreate the dynamic link libraries. This was why the 64-bit file RRDs.so file was being generated despite using 32-bit afs perl to compile it.

Having figured this out I tried to figure out in the configure script where the gcc path was being set. Turns out the configure script takes the perl path from the PERL environment variable and the gcc path from the PERLCC environment variable. With this information I tried setting the perl path and the gcc path to various combinations of 32-bit and 64-bit binaries located in the /afs/slac/package/perl and /afs/slac/package/gcc locations.

On setting the perl path to 32-bit perl and gcc to 64-bit or 32-bit on the /afs/package directories I am able to compile correctly but when gcc tries to generate the object files make gives the following error message:

Checking if your kit is complete...
Looks good
Writing Makefile for RRDs
cd perl-shared && make
make[4]: Entering directory `/afs/slac.stanford.edu/u/sg/akbar/netflow/packages/rrdtool-1.2.15/bindings/perl-shared'
cp RRDs.pm blib/lib/RRDs.pm
cp ntmake.pl blib/lib/ntmake.pl
/afs/slac.stanford.edu/package/perl/5.8.8/i386_linux24/bin/perl /afs/slac.stanford.edu/package/perl/lib/5.8.8/ExtUtils/xsubpp  -typemap
/afs/slac.stanford.edu/package/perl/lib/5.8.8/ExtUtils/typemap  RRDs.xs > RRDs.xsc && mv RRDs.xsc RRDs.c
/afs/slac.stanford.edu/package/gcc/vol9/i386_linux24/bin/gcc -c  -I../../src -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I
/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -DPERL_USE_SAFE_PUTENV -DPERL_USE_SAFE_PUTENV -O2   -D
VERSION=\"1.2015\" -DXS_VERSION=\"1.2015\" -fpic "-I/afs/slac.stanford.edu/package/perl/lib/5.8.8/i386_linux24/CORE"  -DPERLPATCHLEVEL=8
 RRDs.c
{standard input}: Assembler messages:
{standard input}:61: Error: suffix or operands invalid for `push'
{standard input}:63: Error: suffix or operands invalid for `push'
{standard input}:64: Error: suffix or operands invalid for `push'
{standard input}:65: Error: suffix or operands invalid for `push'
{standard input}:67: Internal error, aborting at ../../gas/config/tc-i386.c line 3500 in output_imm
Please report this bug.
make[4]: *** [RRDs.o] Error 1
make[4]: Leaving directory `/afs/slac.stanford.edu/u/sg/akbar/netflow/packages/rrdtool-1.2.15/bindings/perl-shared'
make[3]: *** [perl_shared] Error 2
make[3]: Leaving directory `/afs/slac.stanford.edu/u/sg/akbar/netflow/packages/rrdtool-1.2.15/bindings'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/afs/slac.stanford.edu/u/sg/akbar/netflow/packages/rrdtool-1.2.15/bindings'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/afs/slac.stanford.edu/u/sg/akbar/netflow/packages/rrdtool-1.2.15'
make: *** [all] Error 2

When I use a 64-bit version of perl from either /afs/slac/package or from the local system version the following error is encountered

Checking if your kit is complete...
Looks good
Writing Makefile for RRDp
cd perl-piped && make
make[4]: Entering directory `/afs/slac.stanford.edu/u/sg/akbar/netflow/packages/rrdtool-1.2.15/bindings/perl-piped'
cp RRDp.pm blib/lib/RRDp.pm
Manifying blib/man3/RRDp.3pm
make[4]: Leaving directory `/afs/slac.stanford.edu/u/sg/akbar/netflow/packages/rrdtool-1.2.15/bindings/perl-piped'
cd perl-shared && /usr/bin/perl Makefile.PL  PREFIX=/u/sg/akbar/opt/terapaths_raptor LIB=/u/sg/akbar/opt/terapaths_raptor/lib/perl/5.8.5
 CC=/afs/slac.stanford.edu/package/gcc/vol9/i386_linux24/bin/gcc LD=/afs/slac.stanford.edu/package/gcc/vol9/i386_linux24/bin/gcc RPATH=/
u/sg/akbar/opt/terapaths_raptor/lib
Checking if your kit is complete...
Looks good
Writing Makefile for RRDs
cd perl-shared && make
make[4]: Entering directory `/afs/slac.stanford.edu/u/sg/akbar/netflow/packages/rrdtool-1.2.15/bindings/perl-shared'
cp RRDs.pm blib/lib/RRDs.pm
cp ntmake.pl blib/lib/ntmake.pl
/usr/bin/perl /usr/lib/perl5/5.8.5/ExtUtils/xsubpp  -typemap /usr/lib/perl5/5.8.5/ExtUtils/typemap  RRDs.xs > RRDs.xsc && mv RRDs.xsc RR
Ds.c
/afs/slac.stanford.edu/package/gcc/vol9/i386_linux24/bin/gcc -c  -I../../src -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing
 -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -m64   -DVERSION=\"1.2015\" -DXS
_VERSION=\"1.2015\" -fPIC "-I/usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/CORE"  -DPERLPATCHLEVEL=8 RRDs.c
RRDs.c:1: sorry, unimplemented: 64-bit mode not compiled in
make[4]: *** [RRDs.o] Error 1
make[4]: Leaving directory `/afs/slac.stanford.edu/u/sg/akbar/netflow/packages/rrdtool-1.2.15/bindings/perl-shared'
make[3]: *** [perl_shared] Error 2
make[3]: Leaving directory `/afs/slac.stanford.edu/u/sg/akbar/netflow/packages/rrdtool-1.2.15/bindings'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/afs/slac.stanford.edu/u/sg/akbar/netflow/packages/rrdtool-1.2.15/bindings'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/afs/slac.stanford.edu/u/sg/akbar/netflow/packages/rrdtool-1.2.15'
make: *** [all] Error 2
  • No labels