system "module add gromacs";
Guest lordyHi
Ich hätte versucht aus Perl heraus Kommandos mittels "system" an Linux abzusetzen leider funktioniert das nicht immer so ganz. Beispielsweise ist es auf einem Server nötig ein Module zu laden. Was mittels
wunderbar funktioniert aber leider nicht von Perl aus:
Code: (dl )system "module add gromacs";
Can't exec "module": No such file or directory at ../start_pr.pl line 18.
Was muss ich da anders machen?
xyz@xyz> which module
which: no module in (/usr/local/packages/budgets/bolt/bin:/usr/local/packages/budgets/bin:/opt/pbs/10.2.2.113537/bin:/opt/cray/atp/1.6.0/bin:/opt/cray/xt-asyncpe/5.17/bin:/opt/cray/rca/1.0.0-2.0400.31553.3.58.gem/bin:/opt/cray/pmi/4.0.0-1.0000.9282.69.4.gem/bin:/opt/toolworks/totalview.8.11.0-0/bin:/opt/totalview-support/1.1.4/bin:/opt/cray/cce/8.1.4/cray-binutils/x86_64-unknown-linux-gnu/bin:/opt/cray/cce/8.1.4/craylibs/x86-64/bin:/opt/cray/cce/8.1.4/cftn/bin:/opt/cray/cce/8.1.4/CC/bin:/opt/cray/llm/default/bin:/opt/cray/llm/default/etc:/opt/cray/xpmem/0.1-2.0400.31280.3.1.gem/bin:/opt/cray/dmapp/3.2.1-1.0400.4255.2.159.gem/bin:/opt/cray/ugni/2.3-1.0400.4374.4.88.gem/bin:/opt/cray/udreg/2.3.1-1.0400.4264.3.1.gem/bin:/opt/cray/lustre-cray_gem_s/1.8.6_2.6.32.45_0.3.2_1.0400.6453.7.1-1.0400.38471.0.0/sbin:/opt/cray/lustre-cray_gem_s/1.8.6_2.6.32.45_0.3.2_1.0400.6453.7.1-1.0400.38471.0.0/bin:/opt/cray/MySQL/5.0.64-1.0000.5053.22.1/sbin:/opt/cray/MySQL/5.0.64-1.0000.5053.22.1/bin:/opt/cray/sdb/1.0-1.0400.32124.7.19.gem/bin:/opt/cray/nodestat/2.2-1.0400.31264.2.5.gem/bin:/opt/modules/3.2.6.7/bin:/home/e10/e10/bknapp/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib64/jvm/jre/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:.:/opt/cray/bin)
Guest lordyAlso "which module" liefert:
Code: (dl )which: no module in (/usr/local/packages/budgets/bolt/bin:/usr/local/packages/budgets/bin:/opt/pbs/10.2.2.113537/bin:/opt/cray/atp/1.6.0/bin:/opt/cray/xt-asyncpe/5.17/bin:/opt/cray/rca/1.0.0-2.0400.31553.3.58.gem/bin:/opt/cray/pmi/4.0.0-1.0000.9282.69.4.gem/bin:/opt/toolworks/totalview.8.11.0-0/bin:/opt/totalview-support/1.1.4/bin:/opt/cray/cce/8.1.4/cray-binutils/x86_64-unknown-linux-gnu/bin:/opt/cray/cce/8.1.4/craylibs/x86-64/bin:/opt/cray/cce/8.1.4/cftn/bin:/opt/cray/cce/8.1.4/CC/bin:/opt/cray/llm/default/bin:/opt/cray/llm/default/etc:/opt/cray/xpmem/0.1-2.0400.31280.3.1.gem/bin:/opt/cray/dmapp/3.2.1-1.0400.4255.2.159.gem/bin:/opt/cray/ugni/2.3-1.0400.4374.4.88.gem/bin:/opt/cray/udreg/2.3.1-1.0400.4264.3.1.gem/bin:/opt/cray/lustre-cray_gem_s/1.8.6_2.6.32.45_0.3.2_1.0400.6453.7.1-1.0400.38471.0.0/sbin:/opt/cray/lustre-cray_gem_s/1.8.6_2.6.32.45_0.3.2_1.0400.6453.7.1-1.0400.38471.0.0/bin:/opt/cray/MySQL/5.0.64-1.0000.5053.22.1/sbin:/opt/cray/MySQL/5.0.64-1.0000.5053.22.1/bin:/opt/cray/sdb/1.0-1.0400.32124.7.19.gem/bin:/opt/cray/nodestat/2.2-1.0400.31264.2.5.gem/bin:/opt/modules/3.2.6.7/bin:/home/e10/e10/bknapp/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib64/jvm/jre/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:.:/opt/cray/bin)
2013-04-24T11:15:44 Linuxernaja, wenn es eine (selbstdefinierte (User oder Distribution)) Funktion der Shell ist, dann greift which da nicht (afaik).
Je nach Konfiguration des which kann es auch sein, dass which keine Aliase erkennt...
Es gibt da schon noch Möglichkeiten, warum ein Kommando funktioniert, which aber das Kommando nicht finden kann.
1
2
3
$ which which
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
/usr/bin/which
1
2
3
4
5
6
7
8
9
10
type module
module is a function
module ()
{
eval `/opt/modules/3.2.6.7/bin/modulecmd bash $*`
}
alias module
-bash: alias: module: not found
/opt/modules/3.2.6.7/bin/modulecmd bash add gromacs
1
2
3
GMXLIB=/usr/local/packages/gmx/4.6.0-phase3/share/gromacs/top ;export GMXLIB;GMX_DIR=/usr/local/packages/gmx/4.6.0-phase3 ;export GMX_DIR;GMX_INCLUDE_OPTS=/usr/local/packages/gmx/4.6.0-phase3/include ;export GMX_INCLUDE_OPTS;LD_LIBRARY_PATH=/usr/local/packages/gmx/4.6.0-phase3/lib ;
...und noch sehr viel mehr
1 2 3 4 5 6 7
my @cmd = ( '/path/to/module.sh', 'add', 'modulename', ); system( @cmd ) == 0 or die "Could not execute '@cmd': $!\n";
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
xzy@xzy> cat ./module.sh
#! /bin/sh
eval `/opt/modules/3.2.6.7/bin/modulecmd bash $*`
xzy@xzy> ./module.sh add gromacs
xzy@xzy> grompp -h
If 'grompp' is not a typo you can run the following command to lookup the package that contains the binary:
command-not-found grompp
-bash: grompp: command not found
xzy@xzy> module add gromacs
xzy@xzy> grompp -h
:-) G R O M A C S (-:
Getting the Right Output Means no Artefacts in Calculating Stuff
:-) VERSION 4.6-GPU-dev-20120501-ec56c (-: