- Infos im HLRS Wiki sind nicht rechtsverbindlich und ohne Gewähr -
The Environment Modules package provides for the dynamic modification of a user's environment via modulefiles.
Each modulefile contains the information needed to configure the shell for an application. Once the Modules package is initialized, the environment can be modified on a per-module basis using the module command which interprets modulefiles. Typically modulefiles instruct the module command to alter or set shell environment variables such as PATH, MANPATH, etc. modulefiles may be shared by many users on a system and users may have their own collection to supplement or replace the shared modulefiles.
Modules can be loaded and unloaded dynamically and atomically, in an clean fashion. All popular shells are supported, including bash, ksh, zsh, sh, csh, tcsh, as well as some scripting languages such as perl.
Modules are useful in managing different versions of applications. Modules can also be bundled into metamodules that will load an entire suite of different applications.
The environmental setting using the Environment Modules Project method will not be saved and will be lost for a new session. A new session (login, new job) will have the default environment. The Cluster system uses modules in the user environment to support multiple versions of software, such as compilers, and to create integrated software packages. As new versions of the supported software become available, they are added automatically to the programming environment, while earlier versions are retained to support legacy applications. By specifying the module to load, you can choose the default version of an application, or another version. Modules also porvide a simple mechanism for updating certain environment variables, such as PATH, MANPATH, and LD_LIBRARY_PATH.
The following topics describe the fundamentals of using the modules environment.
- to invoke the module command, type:
module option args
module help modulecommandThe help command will provide more detailed information on the specified module. Without argument modulecommand you will get online help for the module command.
module availThe avail option displays all the modules that are available on the system. Where there is more than one version of a module, the default version is denoted by (default).
module listThe list option displays all the modules that are currently loaded into your user environment.
module add / module load modulenameThe add option and the load option have the same function - to load the specified module into your user environment.
module rm / module unload modulenameThe rm option and the unload option have the same function - to unload the specified module from your user environment. Before loading a module that replaces another version of the same package, you should always unload the module that is to be replaced.
module display modulenameThe display option shows the changes that the specified module will make in your environment, for example, what will be added to the PATH and MANPATH environment variables.
module switch modulename/currentversionmodulename/newversionThe switch option replaces the currently loaded version of a module with a different version. When the new verion is loaded, the man page for the specified software will also be updated.
- using $HOME/.modulerc
This file can be used to load or to define your own environment during each login. An example looks like this:
#%Module1.0# set version 1.0 module load use.own
The module use.own will add $HOME/privatemodules to the list of directories that the module command will search for modules. Place your own module files here. This module, when loaded, will create this directory if necessary.