Modules framework
All systems at CSCS use the Modules framework to simplify access to various compiler suites, libraries, tools and applications. The choice is let to the user to load its preferred programming environment. When loading 1 of the 5 programming environments (cray, gnu, intel, pathscale or pgi), a set of useful modules is loaded by default, including the compiler (pgi for PrgEnv-pgi for instance), the Cray Scientific Library (xt-libsci) and several others. To see which modules are currently loaded, issue the command:
> module list
To list all the modules that are available on the system issue the command:
> module avail
For many modules (particularly compiler modules) there will be several different versions of the module available, one of which will be tagged as "(default)". The default version of a module can be referred to by its name without including the forward slash and version number.
Modules are typically used to set environment variables (PATH, MANPATH, LD_LIBRARY_PATH, etc), and some modules might load other modules. To show what a module does issue the command:
> module show <module_file>
For example:
> module show fftw/2.1.5.1
-------------------------------------------------------------------
/opt/modulefiles/fftw/2.1.5.1:
conflict fftw/3.1.1
prepend-path PATH /opt/fftw/2.1.5.1/cnos/bin
prepend-path LD_LIBRARY_PATH /opt/fftw/2.1.5.1/cnos/lib
prepend-path MANPATH /opt/fftw/2.1.5.1/cnos/man
append-path PE_PRODUCT_LIST FFTW
setenv FFTW_POST_LINK_OPTS -L/opt/fftw/2.1.5.1/cnos/lib
setenv FFTW_INCLUDE_OPTS -I/opt/fftw/2.1.5.1/cnos/include
setenv FFTW_DIR /opt/fftw/2.1.5.1/cnos/lib
setenv FFTW_INC /opt/fftw/2.1.5.1/cnos/include
-------------------------------------------------------------------
To get more information on a particular module file issue the command:
> module help <module_file>
For example:
> module help PrgEnv-gnu
----------- Module Specific Help for 'PrgEnv-gnu' ------
Cray XE6 Programming Environment: modulefile PrgEnv-gnu/4.0.46
This module loads the product modules that define the
system paths and environment variables needed
to build an application using gcc for XE on gemini.
To run a Cray (or other) default environment, unload PrgEnv-gnu and load PrgEnv-cray.
Each PrgEnv* module must be loaded and unloaded together.
You may swap product components or swap the entire PrgEnv*
module, but you may not unload any of its products individually.
PrgEnv-gnu is loaded including the following products:
gcc
xt-totalview
atp
pmi
xt-libsci
xt-asyncpe
Loading, unloading and switching modules
To load the default version of a module, use the module load command, e.g.
> module load fftw
To unload the module, use the module unload command, e.g.
> module unload fftw
To switch to a different version of the same module, use the module switch command (or equivalently, the module swap command), e.g.
> module switch fftw/2.1.5.1 fftw/3.2.1
To load (or unload) a specific version of the module, use the module load (or module unload) command, e.g.
> module load fftw/3.2.1

