Environment Modules (software)
   HOME

TheInfoList



OR:

The Environment Modules system is a
software tool A programming tool or software development tool is a computer program that is used to software development, develop another computer program, usually by helping the developer manage computer files. For example, a programmer may use a tool called ...
to help users manage their
Unix Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
or
Linux Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
shell Shell may refer to: Architecture and design * Shell (structure), a thin structure ** Concrete shell, a thin shell of concrete, usually with no interior columns or exterior buttresses Science Biology * Seashell, a hard outer layer of a marine ani ...
environment, by allowing groups of related environment-variable settings to be made or removed dynamically.


Development

Modules has been around since the early 1990s and is used at some of the largest computer centers to deploy multiple versions of different software tools to users. The
National Energy Research Scientific Computing Center The National Energy Research Scientific Computing Center (NERSC) is a high-performance computing (supercomputer) research facility that was founded in 1974. The National User Facility is operated by Lawrence Berkeley National Laboratory for th ...
(NERSC) reports that they use Environment Modules to manage nearly all software. Environment Modules is specified as a Baseline Configuration requirement of the DoD High Performance Computing Modernization Program (HPCMP) Project Baseline Configuration team for participating DoD Supercomputing Resource Centers (DSRCs).


Modulefiles

The modules system is based on modulefiles, which specify groups of environment settings that need to be made together. Modulefiles can be installed in a central location for general use, or in a user directory for personal use. Environment Modules modulefiles are written in the
Tcl TCL or Tcl or TCLs may refer to: Business * TCL Technology, a Chinese consumer electronics and appliance company ** TCL Electronics, a subsidiary of TCL Technology * Texas Collegiate League, a collegiate baseball league * Trade Centre Limited ...
(Tool Command Language) and are interpreted by the modulecmd program via the module user interface. The key advantage of Environment Modules is that it is shell independent and supports all major shells such as Bash (bash),
KornShell KornShell (ksh) is a Unix shell which was developed by David Korn (computer scientist), David Korn at Bell Labs in the early 1980s and announced at USENIX Annual Technical Conference, USENIX on July 14, 1983. The initial development was base ...
(ksh),
Z shell The Z shell (Zsh) is a Unix shell that can be used as an interactive login shell and as a command interpreter for shell scripting. Zsh is an extended Bourne shell with many improvements, including some features of Bash, ksh, and tcsh. Zsh w ...
(zsh),
Bourne shell The Bourne shell (sh) is a shell command-line interpreter for computer operating systems. It first appeared on Version 7 Unix, as its default shell. Unix-like systems continue to have /bin/sh—which will be the Bourne shell, or a symbolic lin ...
(sh),
tcsh tcsh ( “tee-see-shell”, “tee-shell”, or as “tee see ess aitch”, tcsh) is a Unix shell based on and backward compatible with the C shell (csh). Shell It is essentially the C shell with programmable command-line completion, command- ...
, and
C shell The C shell (csh or the improved version, tcsh) is a Unix shell created by Bill Joy while he was a graduate student at University of California, Berkeley in the late 1970s. It has been widely distributed, beginning with the 2BSD release of the ...
(csh). The second key advantage is that it allows to use multiple versions of the program or package from the same account by just loading proper module. Those two advantages were instrumental in making Environment Modules a part of most HPC cluster setups. It also inspired several alternative implementation such as lmod from University of Texas, which is written in Lua instead of Tcl. Modulefiles are created on per application per version basis. They can be dynamically loaded, unloaded, or switched. Along with the capability of using multiple versions of the same software it also can be used to implement site policies regarding the access and use of applications.


Default modulefiles directory

The default modules search path is in a hidden configuration file you can display with: The directory used by some distributions (or any other directory) can be used after a build from source by modifying the file.


Add your own modules to the path

The module essentially performs these steps:


Use a version file within a hierarchical organization

The commands in this section require read/write/execute access to the directory. The or another directory can be used instead along with "" or modification of the configuration file specifying the default modules search path. The default directory is empty initially. Copy the null module to the default modulefiles directory to have it shown by "module avail". The following uses the null and module-info modules to show use of a version file within a hierarchical organization and their effect on module avail and module show: mkdir /etc/modulefiles/test cp $/modulefiles/null /etc/modulefiles/test/2.0 cp $/modulefiles/module-info /etc/modulefiles/test/1.0 module avail module show test Set the first version as the default: echo '#%Module' > /etc/modulefiles/test/.version echo 'set ModulesVersion "1.0"' >> /etc/modulefiles/test/.version module avail module show test module show test/2.0 Switch to the newer version as the default with: rm /etc/modulefiles/test/.version echo '#%Module' > /etc/modulefiles/test/.version echo 'set ModulesVersion "2.0"' >> /etc/modulefiles/test/.version module avail module show test After the above following a fresh install from source you would see: $ module avail -------------------- /usr/local/Modules/3.2.10/modulefiles --------------------- dot module-git module-info modules null use.own ------------------------------- /etc/modulefiles ------------------------------- null test/1.0 test/2.0(default) --------------------------- /home/user/privatemodules -------------------------- null $ module show test ------------------------------------------------------------------- /etc/modulefiles/test/2.0: module-whatis does absolutely nothing ------------------------------------------------------------------- $ module show test/1.0 ------------------------------------------------------------------- /etc/modulefiles/test/1.0: module-whatis returns all various module-info values +++ module-info +++++++++++++++++++++++++++++++ flags = 2 mode = display name = test/1.0 specified = test/1.0 shell = bash shelltype = sh version = test/1.0 user = advanced trace = 0 tracepat = -.* symbols = *undef* +++ info ++++++++++++++++++++++++++++++++++++++ hostname = localhost level = 1 loaded null = 0 library = /usr/local/lib/tcl8.6 nameofexecutable = sharedlibextension = .so tclversion = 8.6 patchlevel = 8.6.1 +++++++++++++++++++++++++++++++++++++++++++++++ -------------------------------------------------------------------


Automatic modules initialization

Environment Modules on
Scientific Linux Scientific Linux (SL) is a discontinued Linux distribution produced by Fermilab, CERN, DESY and by ETH Zurich. It is a Free and open-source software, free and open-source operating system based on Red Hat Enterprise Linux. This product is derive ...
,
CentOS CentOS (, from Community Enterprise Operating System; also known as CentOS Linux) is a discontinued Linux distribution that provided a free and open-source community-supported computing platform, functionally compatible with its upstream (softw ...
, and
Red Hat Enterprise Linux Red Hat Enterprise Linux (RHEL) is a commercial Linux distribution developed by Red Hat. Red Hat Enterprise Linux is released in server versions for x86-64, Power ISA, ARM64, and IBM Z and a desktop version for x86-64. Fedora Linux and ...
distributions in the environment-modules package include and scripts for the directory that make modules initialization part of the default shell initialization. One of the advantages of Environment Modules is a single modulefile that supports bash, ksh, zsh, sh as well as tcsh and csh shell users for environment setup and initialization. This makes managing complex environments a bit less complicated. For a source build the automation for all users can be manually configured.


bash, ksh, zsh, sh automatic modules initialization

from the file in the 3.2.10 modules build directory. trap "" 1 2 3 case "$0" in -bash, bash, */bash) . /usr/local/Modules/default/init/bash ;; -ksh, ksh, */ksh) . /usr/local/Modules/default/init/ksh ;; -zsh, zsh, */zsh) . /usr/local/Modules/default/init/zsh ;; *) . /usr/local/Modules/default/init/sh ;; # default esac trap 1 2 3 Copy the file from the 3.2.10 modules build directory to the system initialization directory: $ sudo cp etc/global/profile.modules /etc/profile.d/modules.sh Add a version 3.2.10 symbolic link for the above generic addresses: $ cd /usr/local/Modules $ sudo ln -sT 3.2.10 default


tcsh, csh automatic modules initialization

A symbolic link to the file in the 3.2.10 modules build directory can enable automatic modules initialization for these users.


Installing on Linux


yum and rpm

On Scientific Linux, CentOS, and RHEL distributions Environment Modules is in the environment-modules package which can be installed with: sudo yum install environment-modules Once installed the package information can be viewed with: rpm -qi environment-modules rpm -ql environment-modules


apt and dpkg

On
Ubuntu Ubuntu ( ) is a Linux distribution based on Debian and composed primarily of free and open-source software. Developed by the British company Canonical (company), Canonical and a community of contributors under a Meritocracy, meritocratic gover ...
or systems using
apt-get Advanced Package Tool (APT) is a free-software user interface that works with core libraries to handle the installation and removal of software on Debian and Debian-based Linux distributions. APT simplifies the process of managing software on ...
, Environment Modules can be installed with: sudo apt-get install environment-modules Once installed the package information can be viewed with: dpkg -L environment-modules


Linux from source

Although installing from a
Linux distributions A Linux distribution, often abbreviated as distro, is an operating system that includes the Linux kernel for its kernel (operating system), kernel functionality. Although the name does not imply distribution (marketing), product distribution pe ...
repository using that distributions update manager is the easiest the software can be installed from source. Resolve dependencies is the most difficult task for an installation from source. The typical configure, make, install cycle can become painfully slow as each configure improvement reveals another dependency not available in your default environment. This section includes the steps to install the Environment Modules package on source including compiling the Tcl from source as a dependency.


8.6.1 version of Tcl built from /usr/local/src

Although the
PCLinuxOS PCLinuxOS, often shortened to PCLOS, is a rolling release Linux distribution for x86-64 computers, with KDE Plasma, MATE, and XFCE as its default user interfaces. It is a primarily FOSS operating system for personal computers aimed at ease of us ...
64-bit repositories include Tcl they do not include a development package with the configuration files required to build Environment Modules on Linux from source. Building Tcl from source will make the required files available. Extract source after downloading Configure, make, install


3.2.10 version of modules built from /usr/local/src

Extract source after downloading Configure, make, install


References


External links

* * {{GitHub, envmodules/modules * John L. Furlani
Modules: Providing a Flexible User Environment
''Proceedings of the Fifth Large Installation Systems Administration Conference (LISA V)'', pp. 141–152, San Diego, CA, September 30 - October 3, 1991. * http://lmod.sourceforge.net - alternative implementation using Lua instead of Tcl * http://www.lysator.liu.se/cmod/ - alternative implementation using C only
PennState Environment Modules User Guide

Drag your design environment kicking and screaming into the '90s with Modules!
- SNUB Boston 2001 - Erich Whitney, Axiowave Networks, Mark Sprague, ATI Research
Xsede Software Environments
The Extreme Science and Engineering Discovery Environment ― National Science Foundation
NICS Modules Description
― The National Institute for Computational Sciences at Oak Ridge National Laboratory ― Department of Energy
Lmod
Lua-based module system
Spack
― Package Manager for HPC Software developed at
Lawrence Livermore National Laboratory Lawrence Livermore National Laboratory (LLNL) is a Federally funded research and development centers, federally funded research and development center in Livermore, California, United States. Originally established in 1952, the laboratory now i ...
Free software programmed in Tcl Unix software