Hi folks, I am trying to install a threads module downloaded from CPAN (
threads-1.71.tar) in my home directory (~/data_mirror/ver2/pmodules). The
version of the perl installed on my linux machine (at default path) does not
have the latest. I want to use the method $thr->is_joinable() to see if
thread is ready to join and it is not supported in the installed version.
 
$ perl -version
This is perl, v5.8.6 built for i686-linux-thread-multi

Here are the steps I followed,

1. cd ~/threads-1.71/
2. perl Makefile.PL PREFIX=~/data_mirror/ver2/pmodules
3. make install
   ==> compilation gives me error on -march=pentium3 option which I changed
to -march=opteron (processor is AMD dual core opteron) and then it works.

4. When I execute the following perl script I get the error,  can't load
threads.so. 
   -- It (threads.so) exists at the path reported in the error.
   -- I also set the LD_LIBRARY_PATH to directory where threads.so exists.

Help is really appreciated.. Also if this is not the right mailing list pl.
let me know the right one and I can post the message there. Thx.

$ perl yyy.pl
$VAR1 = [
            
'/homes/gogate/data_mirror/ver2/pmodules/lib/perl5/5.8.6/i686-linux-thread-m
ulti',
'/usr/local/lib/perl5/5.8.6/i686-linux-thread-multi',
'/usr/local/lib/perl5/5.8.6',
'/usr/local/lib/perl5/site_perl/5.8.6/i686-linux-thread-multi',
'/usr/local/lib/perl5/site_perl/5.8.6',
'/usr/local/lib/perl5/site_perl',
'.'
        ];
Can't load 
'/homes/gogate/data_mirror/ver2/pmodules/lib/perl5/5.8.6/i686-linux-thread-m
ulti/auto/threads/threads.so' for module threads:
/homes/gogate/data_mirror/ver2/pmodules/lib/perl5/5.8.6/i686-linux-thread-mu
lti/auto/threads/threads.so: cannot open shared object file: No such file or
directory at 
/homes/gogate/data_mirror/ver2/pmodules/lib/perl5/5.8.6/i686-linux-thread-mu
lti/XSLoader.pm line 70.
 at 
/homes/gogate/data_mirror/ver2/pmodules/lib/perl5/5.8.6/i686-linux-thread-mu
lti/threads.pm line 32
Compilation failed in require at yyy.pl line 25.
BEGIN failed--compilation aborted at yyy.pl line 25.
  
=======================================================
yyy.pl
=======================================================
use strict;
use warnings;
use lib 
"/homes/gogate/data_mirror/ver2/pmodules/lib/perl5/5.8.6/i686-linux-thread-m
ulti";
BEGIN { use Data::Dumper; print STDERR Dumper(\...@inc); }
use threads;

# Verify this Perl supports threads
require Config;
if (! $Config::Config{useithreads}) {
    die("This Perl not built to support threads\n");
}

sub start_thread {
   my $args = shift;
   print("Thread started: $args\n");
}

my @threads1 = ();
for (my $i=0; $i<5; $i++) {
  my $thr = threads->create('start_thread', 'argument');
  push (@threads1, $thr);
}

my $thread_count = threads->list();
my $running = threads->list(threads::running);
my $joinable = threads->list(threads::joinable);

print "THREAD COUNT: $thread_count\n";
print "R THREAD COUNT: $running\n";
print "J THREAD COUNT: $joinable\n";

for my $t (@threads1) {
  $t->join();
}
================================================================


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to