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

Can't load threads.so error

by sunshine_august (Scribe)
on Sep 27, 2008 at 11:21 UTC ( [id://714010]=perlquestion: print w/replies, xml ) Need Help??

sunshine_august has asked for the wisdom of the Perl Monks concerning the following question:

Dear all monks:

I try to use threads in my project, and I have installed threads to my own local lib directory in my project directory, when I try to run the script in 64bit box, It throws error msg like these:

Can't load '/home/larry/project/sysmonitor/lib/perl5/5.8.5/i386-linux- +thread-multi/auto/threads/threads.so' for module threads: /home/larry +/project/sysmonitor/lib/perl5/5.8.5/i386-linux-thread-multi/auto/thre +ads/threads.so: cannot open shared object file: No such file or direc +tory at /usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/XSLoader.pm +line 68. at /home/larry/project/sysmonitor/lib/perl5/5.8.5/i386-linux-thread-m +ulti/threads.pm line 32 Compilation failed in require at ./monitorSrv.pl line 47. BEGIN failed--compilation aborted at ./monitorSrv.pl line 47.
and I have add the lib directory by "use lib"like this:
use strict; use warnings; #use diagnostics; use FindBin; use lib "$FindBin::Bin/lib64/perl5/5.8.5/x86_64-linux-thread-multi"; use lib "$FindBin::Bin/lib64/perl5/5.8.5/x86_64-linux-thread-multi/au +to"; use lib "$FindBin::Bin/lib64/perl5/site_perl/5.8.5"; use lib "$FindBin::Bin/lib64/perl5/site_perl/5.8.5/auto"; use lib "$FindBin::Bin/lib64/perl5/site_perl/5.8.5/x86_64-linux-threa +d-multi"; use lib "$FindBin::Bin/lib64/perl5/site_perl/5.8.5/x86_64-linux-threa +d-multi/auto"; use lib "$FindBin::Bin/lib/perl5/5.8.5/i386-linux-thread-multi"; use lib "$FindBin::Bin/lib/perl5/5.8.5/i386-linux-thread-multi/auto"; use lib "$FindBin::Bin/lib/perl5/site_perl/5.8.5"; use lib "$FindBin::Bin/lib/perl5/site_perl/5.8.5/auto"; use lib "$FindBin::Bin/lib/perl5/site_perl/5.8.5/i386-linux-thread-mu +lti"; use lib "$FindBin::Bin/lib/perl5/site_perl/5.8.5/i386-linux-thread-mu +lti/auto";
And I check the threads.so, It is laid on where it should be:
[larry@localhost sysmonitor]$ ll /home/larry/project/sysmonitor/lib/pe +rl5/5.8.5/i386-linux-thread-multi/auto/threads/threads.so -rwxrwxr-x 1 larry larry 110977 Sep 27 16:46 /home/larry/project/sysm +onitor/lib/perl5/5.8.5/i386-linux-thread-multi/auto/threads/threads.s +o
Because, I sometimes test my script at 32 bit box, sometimes 64bit, so I install both arch threads, and I check their location:
/home/larry/project/sysmonitor/lib64/perl5/5.8.5/x86_64-linux-thread-m +ulti/threads.pm /home/larry/project/sysmonitor/lib/perl5/5.8.5/i386-linux-thread-multi +/threads.pm
I guess may be this is the evil that cause the problem.
but, Can't the perl find the right arch threads.pm by itself? Or, there is some way to instrust the perl to find the right threads.pm.
Can any one give some tips. I am very confused about this problem.

Replies are listed 'Best First'.
Re: Can't load threads.so error
by chromatic (Archbishop) on Sep 27, 2008 at 17:12 UTC

    You don't need the auto/ paths; perl will add those for you. What does "$FindBin::Bin/lib64/perl5/5.8.5/x86_64-linux-thread-multi"; expand to?

      "$FindBin::Bin/lib64/perl5/5.8.5/x86_64-linux-thread-multi" expand to "/home/larry/project/sysmonitor/lib64/perl5/5.8.5/x86_64-linux-thread-multi"

      I wander why there are two different path for the module, one is ..../lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi/, another is ..../lib64/perl5/5.8.5/x86_64-linux-thread-multi/. one with 'site_perl', one is not. what does 'site_perl' mean?

Re: Can't load threads.so error
by sunshine_august (Scribe) on Sep 28, 2008 at 06:01 UTC

    I remove the the Module I installed in the project local lib, and lib64, and reinstall all the modules I need, and, add a LD_LIBRARY_PATH to indicate the *.so I install in project local lib. now, It works.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-25 23:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found