sunshine_august has asked for the wisdom of the Perl Monks concerning the following question:
Dear all Monks:
I have writen a perl script, and It will be placed on both i386 and x86_64 arch boxes. I write it in a x86_64 box, and install the x86_64 modules I need in the local project directory, not the default /usr/lib or /usr/local/lib directory,like these:
my crrent work directory is "/home/larry/project/client_script". And I add 'use lib...' to instruct the script to find the local modules, like these:"./lib/perl5/site_perl/5.8.5"; "./lib64/perl5/5.8.5/x86_64-linux-thread-multi"; "./lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi";
it works well in x86_64 box, but when I put this script in a i386 box, and also install the i386 modules I need in these directory:use lib "./lib/perl5/site_perl/5.8.5"; use lib "./lib64/perl5/5.8.5/x86_64-linux-thread-multi"; use lib "./lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi";
and add these "use lib...." to my script:"./lib/perl5/5.8.5/i386-linux-thread-multi"; "./lib/perl5/site_perl/5.8.5/i386-linux-thread-multi";
so, finally, I install both i386 and x86_64 modules in my local project directory:use lib "./lib/perl5/5.8.5/i386-linux-thread-multi"; use lib "./lib/perl5/site_perl/5.8.5/i386-linux-thread-multi";
and add these "use lib..." in my script:"./lib/perl5/site_perl/5.8.5"; "./lib64/perl5/5.8.5/x86_64-linux-thread-multi"; "./lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi"; "./lib/perl5/5.8.5/i386-linux-thread-multi"; "./lib/perl5/site_perl/5.8.5/i386-linux-thread-multi";
then I try to run this script in i386 and x86_64 box respectively, It doesn't work!! This script can't find the right modules in both i386 and x86_64 boxes. For example, there are two arch "threads" module placed in my project directory:use lib "./lib/perl5/site_perl/5.8.5"; use lib "./lib64/perl5/5.8.5/x86_64-linux-thread-multi"; use lib "./lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi"; use lib "./lib/perl5/5.8.5/i386-linux-thread-multi"; use lib "./lib/perl5/site_perl/5.8.5/i386-linux-thread-multi";
and when I try to run the script in a x86_64 box, it throws this error:./lib/perl5/5.8.5/i386-linux-thread-multi/threads.pm ./lib64/perl5/5.8.5/x86_64-linux-thread-multi/threads.pm
when run in i386 box, it throws this error:Can't load '/home/larry/project/client_script/lib/perl5/5.8.5/i386-lin +ux-thread-multi/auto/threads/threads.so' for module threads: /home/la +rry/project/client_script/lib/perl5/5.8.5/i386-linux-thread-multi/aut +o/threads/threads.so: cannot open shared object file: No such file or + directory at /usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/XSLoad +er.pm line 68.
But, if I preserve the only right arch "use lib ..." respectively, It works well on both i386 and x86_64 boxes.Can't load '/home/larry/project/client_script/lib64/perl5/5.8.5/x86_64 +-linux-thread-multi/auto/threads/threads.so' for module threads: /hom +e/larry/project/client_script/lib64/perl5/5.8.5/x86_64-linux-thread-m +ulti/auto/threads/threads.so: cannot open shared object file: No such + file or directory at /usr/lib/perl5/5.8.5/i386-linux-thread-multi/XS +Loader.pm line 68.
|
---|