Environment Modules
Overview
Environment modules provide a flexible way to manage your software environment on shared systems such as HPC clusters.
They allow you to dynamically modify your shell environment to: - Load specific software packages - Switch between versions - Manage dependencies cleanly
Why use environment modules?
On shared systems, multiple users and applications require different software versions.
Environment modules help: - Avoid conflicts between software - Ensure reproducibility - Simplify environment setup - Provide access to centrally installed tools
Basic usage
The module command is used to interact with environment modules.
The module command is used to manage environment modules, and has many options, the most useful of which are detailed below. For all the available commands see the Lmod user guide
Discovering available modules
To see all available modules:
module avail
...
---------------- /cvmfs/fsl.fmrib.ox.ac.uk/el9/modules ----------------
fsl/4.1.9 fsl_sub/2.8.3 (L)
fsl/5.0.9 fsl_sub_config/1.0.0
fsl/5.0.11 fsl_sub_config/1.0.1
fsl/6.0.7.3 (D) fsl_sub_config/1.0.2 (L,D)
---------------- /cvmfs/matlab.fmrib.ox.ac.uk/modules -----------------
MATLAB/R2012a MATLAB_MCR/R2012a MATLAB_MCR/R2019b
MATLAB/R2014b MATLAB_MCR/R2012b MATLAB_MCR/R2023a
MATLAB/R2023b (D) MATLAB_MCR/R2014b MATLAB_MCR/R2023b (D)
...
This lists software grouped by category.
For a more concise summary:
Loading modules
To load a module:
Example:
Module versions
Modules are typically named like:
Example:
If no version is specified, the default version is loaded.
Checking loaded modules
To list currently loaded modules:
Unloading modules
To unload a specific module:
Example:
To remove all modules:
Switching modules
To switch versions:
Example:
Tips
- Always check loaded modules before running jobs
- Use specific versions for reproducibility
- Add frequently used modules to your shell config if appropriate