How to use environment modules
Environment modules are a convenient and efficient way to use non-standard and version-specific software in Unity. The following guide will show you how to enable and disable modules, view all currently active modules, search for modules, and unload all active modules.
List all available modules
To list all available modules, use any of the four commands listed below:
module available
module avail
module av
ml av
The module available
command outputs a list of all the modules available in Unity, as shown in the following example:
------------------------------------------------- /modules/modulefiles -------------------------------------------------
R/3.6.2 cuda/10.1.243 (D) gcc/9.2.0 julia/1.1.1 openmpi/4.0.4
cmake/3.7.2 cuda/11.0.1 glxgears/1.0 jupyter/3.6.8 python/2.7.16
cmake/3.15.0 (D) fd3dspher/1.0 gmsh/4.4.1 mathematica/12.0 python/3.7.4 (D)
cuda/8.0.61 gcc/5.5.0 gpu-burn/default mesa/19.0.8 qt/5.13.1
cuda/9.0.176 gcc/6.5.0 gromacs/2020.2C miniconda/3.7 stress/1.0.4
cuda/9.2.148 gcc/7.4.0 (D) gromacs/2020.2G (D) opencl/2.2.11 vtk/8.2.0
module spider
command in your terminal.Search for modules
To search for specific module types in the available modules list, use the module avail
command followed by the type(s) of modules you are searching for. In the following example, module avail gcc
only filters the gcc
modules:
module avail gcc
Replace gcc
with any category to search for modules within that category.
Load modules
To load a module, use the module load
command followed by the module of choice. In the following example, module load gcc/9.2.0
loads the module gcc/9.2.0
:
module load gcc/9.2.0
module avail
. To see a full list, go to the module hierarchy.Unload modules
To unload modules, use the module unload
command followed by the module(s) of choice. In the following example, module unload gcc
unloads all gcc
modules:
module unload gcc
Unload all active modules
To unload all active modules, use the following command:
module purge
The module purge
command quickly unloads all modules that are currently active.
List currently loaded modules
To list the modules that are currently loaded, use the following command:
module list
Do not mistake the module list
command for module avail
. While module avail
lists all available modules, module list
shows all modules that are currently loaded.