| 1 |
# Common stuff for "foo" modulefiles |
| 2 |
# Using "modulepath based" strategy |
| 3 |
# |
| 4 |
# This file expects the following Tcl variables to have been |
| 5 |
# previously set: |
| 6 |
# version: version of foo |
| 7 |
# compilerTag: compiler was built for |
| 8 |
# mpiTag: mpi was built for |
| 9 |
|
| 10 |
# Declare the path where the packages are installed |
| 11 |
# The reference to the environment variable is a hack |
| 12 |
# for this example; normally one would hard code a path |
| 13 |
set rootdir $::env(MOD_GIT_ROOTDIR) |
| 14 |
set swroot $rootdir/doc/example/compiler-etc-dependencies/dummy-sw-root |
| 15 |
|
| 16 |
proc ModulesHelp { } { |
| 17 |
global version compilerTag mpiTag |
| 18 |
puts stderr " |
| 19 |
foo: Test dummy version of foo $version |
| 20 |
|
| 21 |
For testing packages depending on compilers/MPI |
| 22 |
|
| 23 |
Foo: $version |
| 24 |
Compiler: $compilerTag |
| 25 |
MPI: $mpiTag |
| 26 |
|
| 27 |
" |
| 28 |
} |
| 29 |
|
| 30 |
module-whatis "Dummy foo $version ($compilerTag, $mpiTag)" |
| 31 |
|
| 32 |
# Compute the installation prefix |
| 33 |
set pkgroot $swroot/foo |
| 34 |
set vroot $pkgroot/$version |
| 35 |
set prefix $vroot/$compilerTag/$mpiTag |
| 36 |
|
| 37 |
|
| 38 |
# We need to prereq the compiler to allow autohandling to work |
| 39 |
prereq $compilerTag |
| 40 |
# and the MPI library if used |
| 41 |
if { $mpiTag ne {nompi} } { |
| 42 |
# And as we don't want to load intelmpi module if compiler is |
| 43 |
# intel, we skip that case as well |
| 44 |
set compFam [ lindex [ split $compilerTag / ] 0 ] |
| 45 |
if { ($compFam ne {intel}) || ($mpiTag ne {intelmpi}) } { |
| 46 |
prereq $mpiTag |
| 47 |
} |
| 48 |
} |
| 49 |
|
| 50 |
# Set environment variables |
| 51 |
setenv FOO_DIR $prefix |
| 52 |
|
| 53 |
set bindir $prefix/bin |
| 54 |
set libdir $prefix/lib |
| 55 |
set incdir $prefix/include |
| 56 |
|
| 57 |
prepend-path PATH $bindir |
| 58 |
prepend-path LIBRARY_PATH $libdir |
| 59 |
prepend-path LD_LIBRARY_PATH $libdir |
| 60 |
prepend-path CPATH $incdir |
| 61 |
|
| 62 |
conflict foo |