Skip to main content

Environment Modules

Environment Modules let you dynamically load and unload software packages without conflicts between versions. Always load the modules your job needs before running it.

Common Commands

Finding Modules

# List all available modules
module avail

# Search for a specific module
module avail gcc

# Get detailed info including dependencies
module spider gcc/gcc-12.1.0

Loading and Unloading

# Load a module
module load gcc/gcc-12.1.0

# List currently loaded modules
module list

# Unload a specific module
module unload gcc/gcc-12.1.0

# Unload all modules
module purge

Inspecting a Module

# See what environment variables a module will set
module show gcc/gcc-12.1.0

In Job Scripts

Load modules inside your job script, after the #SBATCH directives:

#!/bin/bash
#SBATCH --job-name=my_job
#SBATCH ...

module purge
module load gcc/gcc-12.1.0

./my_program

Starting with module purge ensures your job is not affected by any modules loaded in your shell session.