| 1 |
# Common modulefile for openmpi |
| 2 |
# Using "modulepath" strategy |
| 3 |
# Expects the following variables to have been |
| 4 |
# previously defined: |
| 5 |
# version: version of openmpi |
| 6 |
# compilerTag: compiler being used with |
| 7 |
|
| 8 |
# Declare the path where the packages are installed |
| 9 |
# The reference to the environment variable is a hack |
| 10 |
# for this example; normally one would hard code a path |
| 11 |
set rootdir $::env(MOD_GIT_ROOTDIR) |
| 12 |
set swroot $rootdir/doc/example/compiler-etc-dependencies/dummy-sw-root |
| 13 |
|
| 14 |
proc ModulesHelp { } { |
| 15 |
global version compilerTag |
| 16 |
puts stderr " |
| 17 |
openmpi: Test dummy version of OpenMPI $version |
| 18 |
|
| 19 |
For testing packages depending on compilers/MPI |
| 20 |
Version: $version |
| 21 |
Compiler: $compilerTag |
| 22 |
|
| 23 |
" |
| 24 |
} |
| 25 |
|
| 26 |
module-whatis "Dummy openmpi $version (for $compilerTag)" |
| 27 |
|
| 28 |
# Find the software root. In production, you should |
| 29 |
# hardcode to your real software root |
| 30 |
set gitroot $::env(MOD_GIT_ROOTDIR) |
| 31 |
set swroot $gitroot/doc/example/compiler-etc-dependencies/dummy-sw-root |
| 32 |
|
| 33 |
# Compute the installation prefix |
| 34 |
set pkgroot $swroot/openmpi |
| 35 |
set vroot $pkgroot/$version |
| 36 |
set prefix $vroot/$compilerTag |
| 37 |
|
| 38 |
# We need to prereq the compiler to allow autohandling to work |
| 39 |
prereq $compilerTag |
| 40 |
|
| 41 |
# Set environment variables |
| 42 |
setenv MPI_DIR $prefix |
| 43 |
|
| 44 |
set bindir $prefix/bin |
| 45 |
set libdir $prefix/lib |
| 46 |
set incdir $prefix/include |
| 47 |
|
| 48 |
prepend-path PATH $bindir |
| 49 |
prepend-path LIBRARY_PATH $libdir |
| 50 |
prepend-path LD_LIBRARY_PATH $libdir |
| 51 |
prepend-path CPATH $incdir |
| 52 |
|
| 53 |
# Add the proper modulepath |
| 54 |
# In production this should be hard-coded, but using $gitroot for cookbook |
| 55 |
set modpathroot $gitroot/doc/example/compiler-etc-dependencies/modulepath |
| 56 |
set newmodpath $modpathroot/CompilerMPI/$compilerTag/openmpi/$version |
| 57 |
module use $newmodpath |