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!


In reply to Problem loading modules while executing in cluster by lecot

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.