Environment Modules (software)
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 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 or.Environment Modules is shell independent and supports all major Unix shells, Windows shells and several Scripting languages
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 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. R.K. Owen at the National Energy Research Scientific Computing Center 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.
During the 2000s, Environment Modules gained traction in the high-performance computing world and started to be used at the largest computing centers. Environment Modules was specified as a Baseline Configuration requirement of the DoD High Performance Computing Modernization Program.
In 2004, Mark Lakata of MIPS Technologies developed a pure Tcl reimplementation of Environment Modules. 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 introduced Lmod, 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. He released version 4, based on the pure Tcl implementation, which was adapted to maintain compatibility with the earlier C version. Since then, new features have been introduced regularly to enhance usability and extend functionality.
In 2025, Modules became a Linux Foundation project part of the High Performance Software Foundation.
Architecture
Environment Modules provides the command along with a shell function or alias named. The command interprets modulefiles, 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,, or. The example below shows a simple modulefile for a sample software package:
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 using Unload a modulefile with Switch between modulefiles using View available modulefiles with Display content of a modulefile using List currently loaded modulefiles with Save currently loaded modulefiles in a collection using Restore environment described by a collection with Enable a modulepath with
Usage examples
Create sample modulefiles in a user-specific modulepath:Viewing available modules:
Loading a module:
List loaded modules:
Switching versions:
Unloading all loaded modules:
Define a default version for sample test module:
Load default test module: