Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Compiling and deploying Perl XS modules on a QNAP embedded system

by virtualdj (Initiate)
on Dec 09, 2011 at 13:14 UTC ( [id://942653]=note: print w/replies, xml ) Need Help??


in reply to Re: Compiling and deploying Perl XS modules on a QNAP embedded system
in thread Compiling and deploying Perl XS modules on a QNAP embedded system

Thank you very much for your answer!

Yes, sorry, I forgot to mention the Perl versions because they were the same (or at least I tought that the version number was sufficient to declare the two perl identical...).

On QNAP (installed from IPKG which is Optware's application manager for embedded systems):

[~] # perl -V Summary of my perl5 (revision 5 version 10 subversion 0) configuration +: Platform: osname=linux, osvers=2.6.24, archname=i686-unknown-linux-gnu uname='linux ts509 2.6.24 #1 smp fri jul 18 01:47:30 cst 2008 i686 + gnulinux ' config_args='-Dcc=gcc -Dprefix=/opt -Duseshrplib -de' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=und +ef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='i686-unknown-linux-gnu-gcc', ccflags ='-fno-strict-aliasing -p +ipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-fno-strict-aliasing' ccversion='', gccversion='4.2.1', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +2 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', + lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='i686-unknown-linux-gnu-ld', ldflags =' -L/home/slug/optware/ts +509/staging/opt/lib -Wl,-rpath,/opt/lib -Wl,-rpath-link,/home/slug/op +tware/ts509/staging/opt/lib -Wl,-rpath,/opt/lib/perl5/5.10.0/i686-lin +ux/CORE' libpth=/opt/lib /opt/local/lib /lib /usr/lib libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil perllibs=-lnsl -ldl -lm -lcrypt -lutil libc=/lib/libc-2.6.1.so, so=so, useshrplib=true, libperl=libperl.s +o gnulibc_version='2.6.1' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E - +Wl,-rpath,/opt/lib/perl5/5.10.0/i686-linux/CORE' cccdlflags='-fPIC', lddlflags='-shared -O2 -L/opt/lib -L/opt/local +/lib' Characteristics of this binary (from libperl): Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP USE_LARGE_FILES USE_PERLIO Built under linux Compiled at May 16 2010 15:39:00 @INC: /opt/lib/perl5/5.10.0/i686-linux /opt/lib/perl5/5.10.0 /opt/lib/perl5/site_perl/5.10.0/i686-linux /opt/lib/perl5/site_perl/5.10.0 /opt/lib/perl5/site_perl .

On Debian VM (installed from apt-get):

debian:~# perl -V Summary of my perl5 (revision 5 version 10 subversion 0) configuration +: Platform: osname=linux, osvers=2.6.26-2-amd64, archname=i486-linux-gnu-threa +d-multi uname='linux puccini 2.6.26-2-amd64 #1 smp fri aug 14 07:12:04 utc + 2009 i686 gnulinux ' config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -Dccc +dlflags=-fPIC -Darchname=i486-linux-gnu -Dprefix=/usr -Dprivlib=/usr/ +share/perl/5.10 -Darchlib=/usr/lib/perl/5.10 -Dvendorprefix=/usr -Dve +ndorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/us +r/local -Dsitelib=/usr/local/share/perl/5.10.0 -Dsitearch=/usr/local/ +lib/perl/5.10.0 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/ma +n/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man +/man3 -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Ua +fs -Ud_csh -Ud_ualarm -Uusesfio -Uusenm -DDEBUGGING=-g -Doptimize=-O2 + -Duseshrplib -Dlibperl=libperl.so.5.10.0 -Dd_dosuid -des' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=und +ef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict +-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFS +ET_BITS=64', optimize='-O2 -g', cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing + -pipe -I/usr/local/include' ccversion='', gccversion='4.3.2', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +2 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', + lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /usr/lib64 libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt perllibs=-ldl -lm -lpthread -lc -lcrypt libc=/lib/libc-2.7.so, so=so, useshrplib=true, libperl=libperl.so. +5.10.0 gnulibc_version='2.7' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_ITH +READS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API Built under linux Compiled at Aug 28 2009 22:15:29 @INC: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .

The QNAP and the Debian are different systems on how they look for shared libraries; for instance QNAP installs their lib on /opt/lib (because it's stored on the HDD, while /usr/lib is on a RAM disk), but normally with C apps it was a merely matter of putting the right path on LD_LIBRARY_PATH.

I may write a stupid thing, but when I was building XML::Parser it asked me for libexpat.so file and header; on the QNAP I can install it with Optware (ipkg install expat), on Debian with APT (apt-get install libexpath-dev) and in both systems I can always build the library from source.
But where should I place the library if the paths are different in Debian and QNAP? May the XML::Parser module store the hardcoded path which then fails to find the library on the other system? (LD_LIBRARY_PATH doesn't help, I've alredy tried!).

However your last advice to try compiling and running the whole Perl seems to work... I've just to make some additional tests to see if I can replicate the procedure. Is this the only method to make the things working in your opinion?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://942653]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-26 03:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found