| 1 |
# Common stuff for "bar" 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 bar |
| 7 |
# compilerTag: compiler was built for |
| 8 |
# simdTag: max CPU vectorization commands to support |
| 9 |
# avx, avx2, sse4.1, etc. |
| 10 |
|
| 11 |
# Declare the path where the packages are installed |
| 12 |
# The reference to the environment variable is a hack |
| 13 |
# for this example; normally one would hard code a path |
| 14 |
set rootdir $::env(MOD_GIT_ROOTDIR) |
| 15 |
set swroot $rootdir/doc/example/compiler-etc-dependencies/dummy-sw-root |
| 16 |
|
| 17 |
# Also get location of and load common procedures |
| 18 |
# This is a hack for the cookbook examples, in production |
| 19 |
# one should either |
| 20 |
# 1) declare the procedures in a site config file (preferred) |
| 21 |
# 2) hardcode the path to $tcllibdir and common_utilities.tcl |
| 22 |
set tcllibdir $rootdir/doc/example/compiler-etc-dependencies/tcllib |
| 23 |
source $tcllibdir/common_utilities.tcl |
| 24 |
|
| 25 |
proc ModulesHelp { } { |
| 26 |
global version compilerTag simdTag |
| 27 |
puts stderr " |
| 28 |
bar: Test dummy version of bar $version |
| 29 |
|
| 30 |
For testing packages depending on compilers/etc |
| 31 |
|
| 32 |
Bar: $version |
| 33 |
Compiler: $compilerTag |
| 34 |
SIMD Support: $simdTag |
| 35 |
|
| 36 |
" |
| 37 |
} |
| 38 |
|
| 39 |
module-whatis "Dummy bar $version ($compilerTag, $simdTag)" |
| 40 |
|
| 41 |
# Make sure loaded compiler matches what we want. |
| 42 |
LoadedCompilerMatches $compilerTag 1 1 |
| 43 |
# For Environment Modules 3.x, set requireIt to false |
| 44 |
#LoadedCompilerMatches $compilerTag 0 1 |
| 45 |
|
| 46 |
# Compute the installation prefix |
| 47 |
set pkgroot $swroot/bar |
| 48 |
set vroot $pkgroot/$version |
| 49 |
set prefix $vroot/$compilerTag/$simdTag |
| 50 |
|
| 51 |
# Set environment variables |
| 52 |
setenv BAR_DIR $prefix |
| 53 |
|
| 54 |
set bindir $prefix/bin |
| 55 |
set libdir $prefix/lib |
| 56 |
set incdir $prefix/include |
| 57 |
|
| 58 |
prepend-path PATH $bindir |
| 59 |
prepend-path LIBRARY_PATH $libdir |
| 60 |
prepend-path LD_LIBRARY_PATH $libdir |
| 61 |
prepend-path CPATH $incdir |
| 62 |
|
| 63 |
conflict bar |