HOWTO for modules:
When you login, you will find a minimal environment setup, with the default compilers and libraries set to the system installed GCC and Open-MPI for GCC. This is by design so that users can choose sets of configuration as needed for their apps.
To setup a sane environment for your needs, you can use "modules", a common utility for managing paths as sets of environment variables. This package allows the user to activate or disable entire sets of environment variables and paths needed for a package using a single command, and greatly simplfies managing your shell environment, particularly when using multiple types and versions of compilers and libraries.
top
Interactive module loading
To begin, you can list the available modules by executing the command
> module avail
The available modules are listed, some with a format like directories (for example "compilers/intel/9.1" activates the Intel v9.1 compilers.)
__ Runtime Usage ___
To enable a particular module in your current shell environment, you can use the "load" subcommand:
> module load [a module name]
Note that all of the current module names begin with /etc/modulefiles, hence, for example, to load the Intel v9.1 compilers, you would type:
> module load /etc/modulefiles/compilers/intel/9.1
This will overlay the environment for this module on the current environment, often prepending paths to PATH environent variables such as PATH and LD_LIBRARY_PATH.
To remove this module, use the "unload" subcommand:
> module load [a module name]
This will cleanly remove those added PATHs and environment variables, returning to the original environment.
To list your _current_ environment, use the "list" subcommand:
> module list
this will list the currently loaded modules.
__Usage for Init Scripts__
The previous changes will allow you to manage your environment in the current shell, but will not affect other shells, or new shells. Thus running mpirun may not capture these settings, since the new shells may not get the same environment.
top
Modifying your default environment
To manage your default environment through module, begin by adding to the end of your ~/.bashrc or ~/.cshrc startup script the line
module load null
This line is a place holder for loading other modules; the "null" module actually does nothing in and of itself to your environment.
Next, to add a module to your default environment, use the command
> module initadd [module name]
This will alter the line at the end of your startup script to include this module as well. In this way you can manage your default environment through modules without editing your startup scripts.
To disable a default module, use "initrm"
> module initrm [module name]
This removes that module from the module line in your startup script.
top
Other Options
To learn more about the module command, run
> module --help
or
> man module
You can also create your own modules to manage personal paths and environments. Modules are simply snippets of TCL code placed in a certain directory. For more information, look to the system modules installed in /etc/modulefiles and the module file man page
> man modulefile |