Environment Modules (software)
Page Module:Infobox/styles.css has no content.
| Environment Modules | |
|---|---|
| Lua error in package.lua at line 80: module 'Module:InfoboxImage/data' not found. | |
| Written in | Tcl |
| Operating system | Unix-like |
| License | GNU General Public License#Version 2 |
| Website | envmodules |
Script error: No such module "Check for conflicting parameters".
The Environment Modules system is a software tool designed to help users dynamically modify their shell environment. It provides a mechanism for managing and switching between sets of environment variable settings, often used to configure different software packages, compilers, and libraries.
Overview
Environment Modules allows users to dynamically configure their shell environment without permanently altering login scripts. This is especially useful in high-performance computing (HPC) environments where users may need to access multiple versions of the same application. Users load and unload scripts called modulefiles to modify environment variables such as Page Template:Mono/styles.css has no content.PATH or Page Template:Mono/styles.css has no content.LD_LIBRARY_PATH.
Environment Modules is shell independent and supports all major Unix shells (Bash, ksh, Zsh, Fish, sh, tcsh, and csh), Windows shells (CMD.EXE and PowerShell) and several Scripting languages (Perl, Python, Ruby, Tcl, CMake and R)
Environment Modules handles all kinds of items part of the shell environment, including environment variable, shell alias, shell function and command-line completion.
History
Environment Modules was first developed in the early 1990s[1] by John L. Furlani at Sun Microsystems. Version 1 was developed as pure shell scripts. With version 2 Environment Modules became a C program evaluating modulefiles written in Tcl.
In the mid 1990s Peter W. Osel at Siemens and Jens Hamisch at Strawberry released the 3.0beta version.[2] R.K. Owen at the National Energy Research Scientific Computing Center (NERSC) took over the project in the late 1990s and ported it to Linux. He released version 3.1 in 2000 under the GNU General Public License (GPL).[3]
During the 2000s, Environment Modules gained traction in the high-performance computing (HPC) world and started to be used at the largest computing centers.[4][5] Environment Modules was specified as a Baseline Configuration requirement of the DoD High Performance Computing Modernization Program (HPCMP).[6]
In 2004, Mark Lakata of MIPS Technologies developed a pure Tcl reimplementation of Environment Modules.[7] Maintenance of this alternative version was later continued by Kent Mein at the University of Minnesota.
In 2008, Robert McLay of the Texas Advanced Computing Center (TACC) introduced Lmod,[8] an alternative implementation project of Environment Modules written in Lua.
After the release of version 3.2.10 in December 2012, development of the C implementation of Environment Modules was discontinued. In the following years, the Lmod project grew in popularity within the HPC community.
In 2017, stewardship of the Environment Modules project was transferred to Xavier Delaruelle of the French Alternative Energies and Atomic Energy Commission (CEA). He released version 4, based on the pure Tcl implementation, which was adapted to maintain compatibility with the earlier C version.[9] Since then, new features have been introduced regularly to enhance usability and extend functionality.[10]
In 2025, Modules became a Linux Foundation project part of the High Performance Software Foundation (HPSF).[11]
Architecture
Environment Modules provides the command Page Template:Mono/styles.css has no content.modulecmd.tcl along with a shell function or alias named Page Template:Mono/styles.css has no content.module.[12] The command interprets modulefiles,[13] scripts written in Tcl that define environment modifications, and produces the corresponding shell code. The shell function or alias then evaluates this code to update the current shell session accordingly.
A modulefile typically modifies environment variables such as Page Template:Mono/styles.css has no content.PATH, Page Template:Mono/styles.css has no content.MANPATH, or Page Template:Mono/styles.css has no content.LD_LIBRARY_PATH. The example below shows a simple modulefile for a sample software package:
#%Module
module-whatis {Example software version 1.2}
set root /usr/local/example-1.2
prepend-path PATH $root/bin
prepend-path LD_LIBRARY_PATH $root/lib
append-path MANPATH $root/man
Modulefiles are organized into directories known as modulepaths. These modulepaths can be centrally managed to provide system-wide access or placed in personal directories for user-specific configurations.
Users can:
- Load a modulefile (i.e., apply environment changes defined) using Page Template:Mono/styles.css has no content.module load
- Unload a modulefile (i.e., undo its environment changes) with Page Template:Mono/styles.css has no content.module unload
- Switch between modulefiles using Page Template:Mono/styles.css has no content.module switch
- View available modulefiles with Page Template:Mono/styles.css has no content.module avail
- Display content of a modulefile using Page Template:Mono/styles.css has no content.module display
- List currently loaded modulefiles with Page Template:Mono/styles.css has no content.module list
- Save currently loaded modulefiles in a collection using Page Template:Mono/styles.css has no content.module save
- Restore environment described by a collection with Page Template:Mono/styles.css has no content.module restore
- Enable a modulepath with Page Template:Mono/styles.css has no content.module use
Usage examples
Create sample modulefiles in a user-specific modulepath:
$ mkdir -p $HOME/privatemodules/test
$ echo '#%Module' >$HOME/privatemodules/test/1.0
$ echo '#%Module' >$HOME/privatemodules/test/2.0
$ module use $HOME/privatemodules
Viewing available modules:
$ module avail
---- /home/user/privatemodules ---------------------------
test/1.0 test/2.0
---- /usr/share/Modules/modulefiles ------------------------
dot module-git module-info modules null use.own
Loading a module:
$ module load test/2.0
List loaded modules:
$ module list
Currently Loaded Modulefiles:
1) test/2.0
Switching versions:
$ module switch test/2.0 test/1.0
Unloading all loaded modules:
$ module purge
Define a default version for sample test module:
$ echo '#%Module' >$HOME/privatemodules/test/.modulerc
$ echo 'module-version test/1.0 default' >>$HOME/privatemodules/test/.modulerc
Load default test module:
$ module load test
$ module list
Currently Loaded Modulefiles:
1) test/1.0
Availability
Environment Modules is distributed by a wide range of Linux and Unix operating systems.[14] It is available under the package name Page Template:Mono/styles.css has no content.environment-modules in Debian, Ubuntu, Red Hat Enterprise Linux and Fedora. The software is also packaged for macOS through the Homebrew project, and a version is available for Windows systems. Where pre-packaged distributions are not provided, the project supplies source code and documentation to support manual installation and configuration.[15][16]
References
Page Template:Reflist/styles.css has no content.
- ^ Page Module:Citation/CS1/styles.css has no content.Furlani, John L. (September 30 – October 3, 1991). "Modules: Providing a Flexible User Environment" (PDF). Proceedings of the Fifth Large Installation Systems Administration Conference (LISA V). San Diego, CA: 141–152. Retrieved 9 February 2014.
- ^ Page Module:Citation/CS1/styles.css has no content."Module 3.0 Beta 1 is out". SourceForge. 4 October 1996.
- ^ Page Module:Citation/CS1/styles.css has no content."Modules 3.1.0 almost ready". SourceForge. 28 June 2000.
- ^ Page Module:Citation/CS1/styles.css has no content."NICS User Support Kraken Modules Description". The National Institute for Computational Sciences (NICS). Oak Ridge National Laboratory - Department of Energy. 22 May 2011. Archived from the original on 22 February 2014. Retrieved 9 February 2014.
- ^ Page Module:Citation/CS1/styles.css has no content."NERSC Modules Software Environment". The National Energy Research Scientific Computing Center (NERSC). Office of Science - Department of Energy. 2014-02-07. Archived from the original on 7 November 2012. Retrieved 3 September 2025.
- ^ Page Module:Citation/CS1/styles.css has no content."Use of Modules for Accessing Multiple Versions of Software". Baseline Configuration. DoD High Performance Computing Modernization Program (HPCMP). 20 Mar 2008. Archived from the original on 22 February 2014. Retrieved 9 February 2014.
- ^ Page Module:Citation/CS1/styles.css has no content."pure TCL implementation of module". SourceForge. 29 October 2002.
- ^ Page Module:Citation/CS1/styles.css has no content."Announcing Lmod: A new module system". SourceForge. 16 October 2008.
- ^ Page Module:Citation/CS1/styles.css has no content."Modules 4.0.0 released". SourceForge. 16 October 2017.
- ^ Page Module:Citation/CS1/styles.css has no content."New features". Read the Docs. 25 November 2025.
- ^ Page Module:Citation/CS1/styles.css has no content."High Performance Software Foundation Welcomes Modules as HPSF Project". HPSF. 10 November 2025.
- ^ Page Module:Citation/CS1/styles.css has no content."module". Read the Docs. 25 November 2025.
- ^ Page Module:Citation/CS1/styles.css has no content."modulefile". Read the Docs. 25 November 2025.
- ^ Page Module:Citation/CS1/styles.css has no content."Versions for environment-modules". Repology. Retrieved 4 September 2025.
- ^ Page Module:Citation/CS1/styles.css has no content."Installing Modules on Unix". Read the Docs. 25 November 2025.
- ^ Page Module:Citation/CS1/styles.css has no content."Installing Modules on Windows". Read the Docs. 25 November 2025.
External links
Lua error in mw.title.lua at line 404: bad argument #2 to 'title.new' (unrecognized namespace name 'Portal').
- Official website
- modules on GitHub
- 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.
- 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
- cmod ― Alternative C implementation developed in the 1990s
- Lmod ― Lua-based module system
- Spack ― Flexible package manager for HPC software
- EasyBuild ― Software build and installation framework to manage software on HPC systems