Modules
The module system is a tool to manage all the different software we have installed in the central software tree.
module commands
The most importan commands:
module avail - lists all avaible modules, even those which are not loaded
module list - lists all loaded modules
module load <modulename> - loads the module <modulename>. Before the use of any software in the tree you have to use this command. If you do not specify a version it will automatically load the newest one.
module unload <modulename> - reverse load.
module switch <old-module> <new-module> - unloads <old-module> and loads <new-module>
module show <modulename> - lists the changes to the environment if a modules gets loaded.
Module names and newest versions
Module names, such as those shown by module avail or module list, are always made up of: program name / program version. For instance, the module for the Intel compiler with version 23.2.1 has the name intel/23.2.1 . For a list of the available versions, just enter the program name after module avail: e.g., module avail intel. Note: always choose a version, otherwise the newest version is used, which will change from time to time!
Loading modules automatically
For your applications you have to load the appropriate module. If you regularly use the same programs and do not want to load the modules after each login, you can enter the module load commands in your login shell script (.bashrc, .cshrc, etc). If you are not dependent on a special version of a software, you can only enter the program name without specifying a version number. But we advise against this procedure. Occasionally updates will be made and therefore the newest version will change, with the user using a different version without noticing. All previously installed versions will remain and can be loaded by specifying the version.
Shell alias
If you work a lot with the module command, it is a good idea to define an alias for the commands. Here is an example for the tcsh:
alias ma "module avail"
alias mi "module list"
alias ml "module load"
alias mu "module unload"
alias ms "module show"
Using modules in scripts
In order to be able to use the module system correctly in scripts, it is required that you specify a source before calling a module.
# in tcsh
source /sw/share/Modules/init/tcsh
# in bash
source /sw/share/Modules/init/bash