# Common stuff for "openmpi" modulefiles
# Using "flavours" strategy
#
# Expects the following Tcl variables to have been previously set:
#	version: version of openmpi

# Common parts of modulefile for openmpi

# Initialise "flavours"
package require flavours
flavours init

proc ModulesHelp { } {
   global version
   puts stderr "
openmpi: Test dummy version of OpenMPI $version

For testing packages depending on compilers/MPI

"
}

module-whatis "Dummy openmpi $version"

# Construct flavour name
flavours prereq -class compiler
flavours conflict openmpi

# 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

flavours root     $swroot/openmpi/$version
flavours revision 1
flavours commit

# Set environment variables
setenv MPI_DIR [flavours path]

# Prepend to environment variables (paths relative to
# the directory containing the flavour)
flavours prepend-path PATH            bin
flavours prepend-path LIBRARY_PATH    lib
flavours prepend-path LD_LIBRARY_PATH lib
flavours prepend-path CPATH           include

# Reload any modules with this as a prerequisite
flavours cleanup
