The module utility

Introduction

The Linux operating system makes extensive use of the “working environment”, which is a collection of individual environment variables.  An environment variable is a named object in the Linux shell that contains information used by one or more applications; two of the most used such variables are $HOME, which defines a user’s home directory name, and $PATH, which represents a list paths to different executables.  A large number of environment variables are already defined when a Linux shell is open but the environment can be customised, either by defining new environment variables relevant to certain applications (e.g. software license variables) or by modifying existing ones (e.g. adding a new path to $PATH).

module is a Linux utility, which is used to manage of working environment in preparation for running the applications installed on the ARC systems.  By loading the module for a certain installed application, the environment variables that are relevant for that application are automatically defined or modified.

Useful commands

The module utility is invoked by the command module.  This command must be followed by an instruction of what action is required and by the details of a pre-defined module.

The utility displays a help menu by doing

module help

The utility displays the available modules by issuing the command

module avail

or displays only the information related to a certain software package, e.g.

module avail intel-compilers

The avail instruction displays all the versions available for the installed applications, and shows which version is pre-defined as being the default. A software package is loaded with the load or the add instructions, e.g.

module load intel-compilers

If no version is specified, the default version of the software is loaded. Specific versions, other than the default can be loaded by specifying the version, e.g.

module load intel-compilers/11.1

The modules that are already loaded by users are displayed with the command

module list

A module can be “unloaded” with the unload or rm instructions, e.g.

module unload intel-compilers

Users who repeatedly use the same module may find the initadd command useful.  This makes the loading of the application specified by the user automatic at login, making the module load step unecessary.  For example, if the Intel compilers are used frequently, the command

module initadd intel-compilers

can be issued only once and all subsequent Linux sessions will automatically have the Intel compilers in the path.