Private Module Example
The modules package allows you to pick which software packages and version you wish to use. It has the advanatages in easily handling PATH, MANPATH and other important variables for you as well as making rolling out new version a much simplier process.
Users can make their own module files, privatemodules must go in
/home/username/privatemodules/
There is a structure to the layout of the privatemodules folder. Normally a software package, is given a folder inside privatemodules and the individual modulefiles are given versions as names.
Example privatemodules Folder
In this case a folder openmpi/ has two files, 1.2.5-intel 1.3.2-gcc representing two versions of the same module.
openmpi/1.2.5-intel
openmpi/1.3.2-gcc
Example module file
Read each line of the example carefully, the first line (#%Module1.0) is required to work,
#%Module1.0#######################################################################
## modules modulefile
##
#this is a comment, white space is allowed
#output on module help modulefile
proc ModulesHelp { } {
global version modroot
puts stderr "\tOpenMPI- loads the MPI compiler environment"
puts stderr "\tThe MPI environment is OpenMPI"
puts stderr "\n\tThis adds $modroot/* to several of the"
puts stderr "\tenvironment variables."
puts stderr "\n\tVersion $version\n"
}
#outputs on module whatis
module-whatis "loads the OpenMPI/INTEL compiler environment"
module-whatis "Vendor Website: http://www.open-mpi.org/"
# for module file internal use only refer to value in script with $varname
set modroot /home/software/rhel5/openmpi-1.2.3/intel-5.1
#environment variables to set/add to.
#sets MPI_HOME to value $modroot
setenv MPI_HOME $modroot
#appends to PATH
append-path PATH $modroot/bin
append-path LD_LIBRARY_PATH $modroot/lib
append-path LD_LIBRARY_PATH $modroot/lib/openmpi
#modules that can not be loaded conflict openmpi lam mpich
#prereq for modules that must be loaded before this module
prereq nag/7
#when module loaded
if { [ module-info mode load ] } {
#messages to users on load
#puts stderr "message to users on load\n"
}


