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

Hello to all the Monks,

I'm trying to execute a script which depends on two modules (GRASS::raster and SMDR::setup_3001) in a grid environment. Once the job reach a node and before the execution, it installs the modules in $HOME/usr/local/perl_local_lib without any problem.

The first lines of the script are:

use warnings; use diagnostics; use Carp; use Getopt::Long qw(:config permute); use File::Temp; use File::Spec; use lib "$ENV{HOME}/usr/local/perl_local_lib"; use GRASS::raster qw(:all); use SMDR::setup_3001 qw(:all);
Although the  use lib... line is working and @INC is modified it fails at execution with the following error message:

Can't locate GRASS/raster.pm in @INC (@INC contains: /home/ienvmod008/ +usr/local/perl_local_lib /opt/glite/lib/perl5 /opt/gpt/lib/perl/i386- +linux-thread-multi /opt/gpt/lib/perl /usr/lib/perl5/5.8.0/i386-linux- +thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386 +-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/sit +e_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/ +lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .) at /home/ie +nvmod008/gram_scratch_4ua3ZvbJDO/https_3a_2f_2fi2grb01.ifca.es_3a9000 +_2fEGtV8vmZdn0cz95cNUieTQ_0/SMDR_Scripts_3001/smdr.setup.3001.pl line + 43. BEGIN failed--compilation aborted at /home/ienvmod008/gram_scratch_4ua +3ZvbJDO/https_3a_2f_2fi2grb01.ifca.es_3a9000_2fEGtV8vmZdn0cz95cNUieTQ +_0/SMDR_Scripts_3001/smdr.setup.3001.pl line 43 (#1) (F) You said to do (or require, or use) a file that couldn't be found. Perl looks for the file in all the locations mentioned in @ +INC, unless the file name included the full path to the file. Perhaps +you need to set the PERL5LIB or PERL5OPT environment variable to say w +here the extra library is, or maybe the script needs to add the library + name to @INC. Or maybe you just misspelled the name of the file. See perlfunc/require and lib.
The first item of @INC is the location specified by the  use lib statement, and i already tried defining the route to the lib using PERL5LIB and PERL5OPT but it didn't work either.

Any idea of why is this happening or how should i specify the location of the modules?

Thank you!

Replies are listed 'Best First'.
Re: Problem loading modules while executing in cluster
by snopal (Pilgrim) on Sep 18, 2007 at 18:29 UTC

    Since this appears to be a UNIX like environment, I'd check to see if the installer left funky permissions on the installation tree for the modules. They may well appear to be installed by the superuser, but the permissions of the executing node may not be able to follow the tree.

      Yes, it's a *NIX environment, but i change the permissions after the installation as all the files are delivered only as readable to the worker nodes.

      Thanks