mirror of
https://github.com/envmodules/modules.git
synced 2026-06-14 00:42:43 +08:00
And include these modulefile examples as Tcl code in recipe document to get their content highlighted.
63 lines
1.6 KiB
Plaintext
63 lines
1.6 KiB
Plaintext
# Common stuff for "foo" modulefiles
|
|
# Using "modulepath based" strategy
|
|
#
|
|
# This file expects the following Tcl variables to have been
|
|
# previously set:
|
|
# version: version of foo
|
|
# compilerTag: compiler was built for
|
|
# mpiTag: mpi was built for
|
|
|
|
# Declare the path where the packages are installed
|
|
# The reference to the environment variable is a hack
|
|
# for this example; normally one would hard code a path
|
|
set rootdir $::env(MOD_GIT_ROOTDIR)
|
|
set swroot $rootdir/doc/example/compiler-etc-dependencies/dummy-sw-root
|
|
|
|
proc ModulesHelp { } {
|
|
global version compilerTag mpiTag
|
|
puts stderr "
|
|
foo: Test dummy version of foo $version
|
|
|
|
For testing packages depending on compilers/MPI
|
|
|
|
Foo: $version
|
|
Compiler: $compilerTag
|
|
MPI: $mpiTag
|
|
|
|
"
|
|
}
|
|
|
|
module-whatis "Dummy foo $version ($compilerTag, $mpiTag)"
|
|
|
|
# Compute the installation prefix
|
|
set pkgroot $swroot/foo
|
|
set vroot $pkgroot/$version
|
|
set prefix $vroot/$compilerTag/$mpiTag
|
|
|
|
|
|
# We need to prereq the compiler to allow autohandling to work
|
|
prereq $compilerTag
|
|
# and the MPI library if used
|
|
if { $mpiTag ne {nompi} } {
|
|
# And as we don't want to load intelmpi module if compiler is
|
|
# intel, we skip that case as well
|
|
set compFam [ lindex [ split $compilerTag / ] 0 ]
|
|
if { ($compFam ne {intel}) || ($mpiTag ne {intelmpi}) } {
|
|
prereq $mpiTag
|
|
}
|
|
}
|
|
|
|
# Set environment variables
|
|
setenv FOO_DIR $prefix
|
|
|
|
set bindir $prefix/bin
|
|
set libdir $prefix/lib
|
|
set incdir $prefix/include
|
|
|
|
prepend-path PATH $bindir
|
|
prepend-path LIBRARY_PATH $libdir
|
|
prepend-path LD_LIBRARY_PATH $libdir
|
|
prepend-path CPATH $incdir
|
|
|
|
conflict foo
|