Main Content Region

Environment Modules

The 'environment-modules' software provides a means to have many different pieces of software easily available on the command-line, including multiple versions of a single piece of software.

Basic Commands

module list
shows which modules are currently loaded in your session
module avail shows available modules
module add <module> add/load a module
module rm <module> remove/unload a module

For more details on those commands, see the next sections.

module list

If you have nothing currently loaded, running this command will show something like:

[paddy@lonsdale01 ~]$ module list
No Modulefiles Currently Loaded.

Or, if you do have modules loaded, it will show something like:

[paddy@lonsdale01 ~]$ module list
Currently Loaded Modulefiles:
  1) gcc/4.6.3-gnu  2) openmpi/1.6.1-gnu4.6.3

module avail

This will vary depending on what software has been made available on the system. It could be something like:

[paddy@lonsdale01 ~]$ module avail

-------------------------------- /usr/share/Modules/modulefiles --------------------------------
dot         module-cvs  module-info modules     null        use.own

---------------------------------- /home/support/modulefiles -----------------------------------
apps                                        intel/cc/64/11.0.074
cports                                      intel/fc/64/11.0.074
default-gcc-openmpi-apps-libs-recommended   libs
default-intel-openmpi-apps-libs-recommended local/64
gcc/4.6.3/openmpi/64/1.6.1                  man
gcc/64/4.6.3                                mdgtools
intel/11.0.074/openmpi/64/1.6.1             null
intel/12.1/composer_xe_2011_sp1.9.293       proxy
intel/12.1/openmpi/64/1.6.1                 tcin

As you can see, there may be different versions of the same application or library available.

module add <module>

When adding, you can specify the module name (e.g. fluent) and it will load the latest version.

module load fluent

Alternatively, you can load a specific version by copying and pasting the full module name:

module load fluent/6.2.16

module rm <module>

Similarly for removing:

module rm fluent

Configuring modules to be loaded at every login

You can configure modules to be loaded at every login as follows:

module initadd <module>

Note: module initadd Error

The above module initadd command may fail with the following error:

Modulecmd Init.c 507 WARN 164 Cannot find a module load command in any of the 'bash' startup files

If you do get that error then do this first:

echo "module add null" >> ~/.bashrc

You should then be able to run module initadd as normal.