Skip to content

Environment modules#

Environment modules or short modules allow to have different versions of compilers, applications, and libraries installed, but only make one specific version available to your shell. This works by adjusting the environment variables of your shell during loading and unloading of modules.

Most of the installed software on our systems we provide through modules. However, available modules and versions available differ between clusters.

module command#

Modules are managed through the module command followed by a sub command. The following table lists the most important:

Command Effect
module avail Lists all available modules.
module whatis Shows an over-verbose listing of all available modules.
module list Shows which modules are currently loaded.
module load <pkg> Loads the module <pkg>, that means it makes all the settings that are necessary for using the package <pkg> (e.g. search paths).
module load <pkg>/<version> Loads version <version> of module <pkg> instead of the default version.
module unload <pkg> Removes the module <pkg>, i.e, it undoes what the load command did.
module help <pkg> Shows a detailed description for module <pkg>.
module show <pkg> Shows the environment variables module <pkg> actually sets/modifies.

module command only affect your current shell.

Every time you open a new shell, i.e. by logging out and in again or inside every batch job, you have to set up your environment by loading the needed modules again.

Some modules cannot be loaded together. In some cases, such a conflict is detected automatically during the load command, in which case an error message is printed and no modifications are made.

A module can depend on other modules. The dependent modules are automatically loaded with the requested module

Important modules#

Module Provides
gcc GCC compiler suite, see Compilers for details.
intel Intel Classic/OneAPI compilers, see Compilers for details.
intelmpi Provides Intel MPI, see MPI for details.
openmpi Provides Open MPI, see MPI for details.
python Provides an Anaconda Python, see Python for details.

Defining own module tree#

Some users or groups require software or specific software versions not provided by the NHR@FAU module system. For them we offer the user-spack modules which integrates itself into the available module tree. If you need other software but still want the easy management through modules, you can create an own module tree.

Create a folder in your home directory ($HOME/.modulefiles) for the module tree. Inside this folder, create a folder for each module you want ($HOME/.modulefiles/mymod). Inside this folder, create a file for the version (can also be a name or similar). The module will be present as mymod/version in the end. In most cases the file is very simple and has a common structure.

It is recommended to install software not in your $HOME folder but $WORK.

Module file mymod/<version>

# Descriptive text
module-whatis "This is my module"

# conflicting modules to load only one version at a time
#conflict mymod

# Define base path to the installed software
set rootdir_name /base/path/of/own/software

# Add bin directory to $PATH
prepend-path PATH "$rootdir_name/bin"

# Add sbin directory to $PATH if needed
#prepend-path PATH "$rootdir_name/sbin"

# Add library directory to $LD_LIBRARY_PATH
prepend-path LD_LIBRARY_PATH "$rootdir_name/lib"

# Man pages of the software (if available)
#prepend-path MANPATH "$rootdir_name/man"

# Set own environment variables
setenv MYVAR "foobar"

# Remove variables from environment
# unsetenv NOTMYVAR

In order to append your module tree to the NHR@FAU modules, run module use -a $HOME/.modulefiles.

If you have multiple versions of a module, it is helpful to define a default version. You can do that by creating a file in the module ($HOME/.modulefiles/mymod/.version):

Default module file .version
set ModulesVersion "default"