Using Environment Modules

This article describes the usage of shell environment modules.

About the module environment
On a complex computer system with a wide choice of software packages and software versions it can be challenging to set up the correct environment to manage this. For instance, managing diverse MPI software or application packages on the same system. The need for various versions of a software package only adds to this complexity. Paths, binary names and libraries are at risk of getting easily mixed.

If the above mixture is the case you could, as an end user, never be quite sure which libraries have been used for the compilation of a program as multiple libraries with the same name may be installed. Very often you would like to test new versions of a software package before (asking for) a permanent shared installation of the software. The module environment makes this process easy.

If the module environment application has been installed correctly the actual module command will be part of your shell commands and the feature it offers will be integrated into your shell.

Listing all available modules:

module available

Available module command options

Running the module command without arguments produces a nice overview of what it can do.


gives a nice overview of the currently available commands.
  Modules Release 3.2.6 2007-02-14 (Copyright GNU GPL v2 1991):
  Usage: module [ switches ] [ subcommand ] [subcommand-args ]
        -H|--help               this usage info
        -V|--version            modules version & configuration options
        -f|--force              force active dependency resolution
        -t|--terse              terse    format avail and list format
        -l|--long               long     format avail and list format
        -h|--human              readable format avail and list format
        -v|--verbose            enable  verbose messages
        -s|--silent             disable verbose messages
        -c|--create             create caches for avail and apropos
        -i|--icase              case insensitive
        -u|--userlvl <lvl>      set user level to (nov[ice],exp[ert],adv[anced])
  Available SubCommands and Args:
        + add|load              modulefile [modulefile ...]
        + rm|unload             modulefile [modulefile ...]
        + switch|swap           [modulefile1] modulefile2
        + display|show          modulefile [modulefile ...]
        + avail                 [modulefile [modulefile ...]]
        + use [-a|--append]     dir [dir ...]
        + unuse                 dir [dir ...]
        + update
        + refresh
        + purge
        + list
        + clear
        + help                  [modulefile [modulefile ...]]
        + whatis                [modulefile [modulefile ...]]
        + apropos|keyword       string
        + initadd               modulefile [modulefile ...]
        + initprepend           modulefile [modulefile ...]
        + initrm                modulefile [modulefile ...]
        + initswitch            modulefile1 modulefile2
        + initlist
        + initclear

Module close match loading

If you load a module without providing the exact string as provided by the:

module av

command and instead invoke
module load myapp/intel

the module application will look for the closest match for myapp/intel and will load the contents of /cvos/shared/modulefiles/myapp/intel/1.0a into your environment. (Keep this in mind when multiple versions of applications are installed.) When loaded the $PATH, $MANPATH and $LD_RUN_PATH variables will dynamically be updated to reflect the additional values set in the loaded module.


  1. Load a few modules from your .bashrc to make sure your favorite tools are within easy reach. Especially useful for running jobs.
  2. Embed the module load commands into your queuing system job scripts. This will make sure your job loads the same environment.
  3. Please always refer to the application specific manuals or INSTALL/README files to obtain the path, special variables, librarypath, ld_runtime settings when creating a module.
  4. Ask your system administrator to write wrapper modules. This would allow you to embed module loads inside job-scripts like "module load myapplication/latest" where your system administrator would have control over a "latest" module loading other modules!

If you want to load or ad a module by hand at the shell level you would type

module load myapp/intel/1.0a

Unloading your module:

module del myapp/intel/1.0a

Removing all modules from your environment

module purge

Copyright 2002-2014 ClusterVision BV