We install our software as modules and we manage them using Lmod. Lmod is a system for manipulating environment variables that inform the user environment of where to find software and libraries based on text based files called modules. The module is a series of directives that outline what changes to make when the module is loaded so that the software or library will be available for use, the same as if it were installed in a standard system location.
Important Notes:
Software built in general compute trees (default) is meant to be able to run on all of the general access compute nodes. Also, the newer versions of the modules may also be in the newer tree. If you are looking for using such modules, check the page Module Systems -- Advanced.
Simply stated, a module is a packaging of definitions of environment variables into a script. In general, there is a module defined for each application, and that module defines the environment appropriately for that application. To use the application, you need to load the module first using the module command:
module load <software-module>
For an example, if the software-module is "matlab", it becomes "module load matlab".
If there are more versions, let's say matlab/R2020b, then it becomes:
module load matlab/R2020b
To load the sotware-module, use the command:
module load <software-module>
To unload it, use:
module unload <software-module>
To see which modules you have loaded, use:
module list
Modules are organized into a hierarchy so that some modules can only be loaded after other modules have been loaded. To see the modules that can be loaded in the current environment use the command:
module avail
If you want to check the versions of a particular software such as matlab, then type:
module avail matlab
output:
...
matlab/R2020b matlab/R2021b matlab/R2023a (D) matlab/R2025a
To search all modules and determine what additional modules are required to use a specific software, you can use the "module spider <name>" command. For example, R has dependency modules that must be loaded before R itself. First list available versions:
module spider R
Output:
-------------------------------------------------------------------------
R:
-------------------------------------------------------------------------
Description:
R is a free software environment for statistical computing and graphics.
Versions:
R/4.1.2-foss-2021b
R/4.2.2-foss-2022b
R/4.4.0-gfbf-2023b
R/4.4.1-gfbf-2023a
R/4.4.1-gfbf-2023b
R/4.4.2-gfbf-2024a
Then select a specific version and use the command on the specific version:
module spider R/4.4.2-gfbf-2024a
Output:
-----------------------------------------------------------------------------
R: R/4.0.2
-----------------------------------------------------------------------------
Description:
R is a free software environment for statistical computing and graphics.
This module can be loaded directly: module load R/4.4.2-gfbf-2024a
Now, you need to load the R/4.4.2 module as:
module load R/4.4.2-gfbf-2024a
To get the version, path of executable and libraries, and other information about the software-module (e.g. matlab):
module display <software-module>
For matlab, the selected output includes:
-------------------------------------------------------------------
whatis("Name: matlab")
whatis("Version R2023a")
whatis("Category: library")
whatis("Description: Matlab R2023a")
pushenv("MATLAB","/usr/local/software/matlab/R2023a")
pushenv("MATLAB_COMM","native")
prepend_path("PATH","/usr/local/software/matlab/R2023a/bin")
prepend_path("LD_LIBRARY_PATH","/usr/local/software/matlab/R2023a/runtime/glnxa64")
...
-------------------------------------------------------------------
Here, the binary path for Matlab version 2023a is /usr/local/matlab/R2023a/bin