| 1 |
# Common stuff for "foo" modulefiles |
| 2 |
# Using "modulerc 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 |
# Also get location of and load common procedures |
| 17 |
# This is a hack for the cookbook examples, in production |
| 18 |
# one should either |
| 19 |
# 1) declare the procedures in a site config file (preferred) |
| 20 |
# 2) hardcode the path to $tcllibdir and common_utilities.tcl |
| 21 |
set tcllibdir $rootdir/doc/example/compiler-etc-dependencies/tcllib |
| 22 |
source $tcllibdir/common_utilities.tcl |
| 23 |
|
| 24 |
proc ModulesHelp { } { |
| 25 |
global version compilerTag mpiTag |
| 26 |
puts stderr " |
| 27 |
foo: Test dummy version of foo $version |
| 28 |
|
| 29 |
For testing packages depending on compilers/MPI |
| 30 |
|
| 31 |
Foo: $version |
| 32 |
Compiler: $compilerTag |
| 33 |
MPI: $mpiTag |
| 34 |
|
| 35 |
" |
| 36 |
} |
| 37 |
|
| 38 |
module-whatis "Dummy foo $version ($compilerTag, $mpiTag)" |
| 39 |
|
| 40 |
# Make sure loaded compiler and MPI match what we want. |
| 41 |
# And load them if not already loaded |
| 42 |
LoadedCompilerMatches $compilerTag 1 1 |
| 43 |
# But don't load intelmpi if compiler is intel |
| 44 |
LoadedMpiMatches $mpiTag 1 1 1 |
| 45 |
# For Env Modules 3.x, set requireIt to false |
| 46 |
#LoadedCompilerMatches $compilerTag 0 1 |
| 47 |
#LoadedMpiMatches $mpiTag 0 1 1 |
| 48 |
|
| 49 |
# Compute the installation prefix |
| 50 |
set pkgroot $swroot/foo |
| 51 |
set vroot $pkgroot/$version |
| 52 |
set prefix $vroot/$compilerTag/$mpiTag |
| 53 |
|
| 54 |
# Set environment variables |
| 55 |
setenv FOO_DIR $prefix |
| 56 |
|
| 57 |
set bindir $prefix/bin |
| 58 |
set libdir $prefix/lib |
| 59 |
set incdir $prefix/include |
| 60 |
|
| 61 |
prepend-path PATH $bindir |
| 62 |
prepend-path LIBRARY_PATH $libdir |
| 63 |
prepend-path LD_LIBRARY_PATH $libdir |
| 64 |
prepend-path CPATH $incdir |
| 65 |
|
| 66 |
conflict foo |