Environment modules are used on HPC to allow multiple versions of any given piece of software to sit on the same OS, giving you the ability to choose a version of software. When viewed from an individual user point of view this may seem complex, however it is necessary in a multi-user environment.
Note: It is possible to have two or more versions of the same module loaded, but this cause problems and should be avoided. The reason for this is often that a major version change in software can result in significantly different syntax, so software developers maintain multiple, independent streams of their software. All aliases defined above can be considered examples of this.
module avail |
module help grass |
module list |
module load gcc/6 |
module load java |
NOTE: The default software version will generally be the safest (e.g., version distributed by RedHat).
An example of a command to switch to another version of the same software is:
module switch java/1.6.0-openjdk |
module unload java |
In some cases, you may want/need to add the version.
There will be occasions where is easier to make a fresh start, in which case you simply run the command
module purge |
Most module files, when loaded, will set an environment variable <SOFTWARE>_HOME
which holds the installation home for the software. For example, try
module load vcftools echo $VCFTOOLS_HOME ls -lR $VCFTOOLS_HOME |
The most common environment variable modified by the loading of an environment variable is PATH
.
Other commonly modified environment variables are: MANPATH
, LD_LIBRARY_PATH
, CLFAGS
, CXXFLAGS
, and LDFLAGS
.
Environment modules are not usually created for Python extensions. Loading a specific python version will usually enable use of all extensions. Note that some extensions may not be available for all versions of python.
Software that includes perl extensions will usually modify the PERLLIB
and/or PERL5LIB
environment variables.
For Java based software, there will often be an alias set the simplifies things for users. For example a
module load picard |
will create a picard
alias that expands to java -jar $PICARD_HOME/picard.jar