Content deleted Content added
m →See also: (at least this edit merge needed) |
Delaruellex (talk | contribs) m →History: add ref for Modules 4.0.0 release |
||
(13 intermediate revisions by 5 users not shown) | |||
Line 1:
{{Short description|
{{how-to|date=February 2015}}
{{Infobox software
| name = Environment Modules
| logo = Environment_Modules_logo.svg
| latest_release_version = 5.
| latest_release_date = {{Start date and age|
| operating_system = [[Unix-like]]
| programming_language = [[Tcl]]
Line 11:
| website = {{URL|https://modules.sourceforge.net/}}
}}
The '''Environment Modules''' system is a [[software
Modules has been around since the early 1990s<ref>{{cite journal |last=Furlani |first=John L. |date=September 30 – October 3, 1991 |title=Modules: Providing a Flexible User Environment |url=http://modules.sourceforge.net/docs/Modules-Paper.pdf |journal=Proceedings of the Fifth Large Installation Systems Administration Conference (LISA V) |___location=San Diego, CA |pages=141–152 |access-date=9 February 2014}}</ref> and is used at some of the largest computer centers<ref>{{cite web|url=http://www.nics.tennessee.edu/computing-resources/kraken/modules |title=NICS User Support Kraken Modules Description |date=22 May 2011 |website=The National Institute for Computational Sciences (NICS) |publisher=Oak Ridge National Laboratory - Department of Energy |access-date=9 February 2014 |url-status=dead |archive-url=https://web.archive.org/web/20140222062335/http://www.nics.tennessee.edu/computing-resources/kraken/modules |archive-date=22 February 2014 }}</ref> to deploy multiple versions of different software tools to users. The [[National Energy Research Scientific Computing Center]] (NERSC) reports that they use Environment Modules to manage nearly all software.<ref>{{cite web |url=https://www.nersc.gov/users/software/nersc-user-environment/modules/ |title=NERSC Modules Software Environment |author=<!--Staff writer(s); no by-line.--> |date=2014-02-07 <!--15:11:50--> |website=The National Energy Research Scientific Computing Center (NERSC) |publisher=Office of Science - Department of Energy |access-date=19 February 2014}}</ref> Environment Modules is specified as a Baseline Configuration requirement of the DoD High Performance Computing Modernization Program (HPCMP)<ref>{{cite web|url=http://centers.hpc.mil/consolidated/bc/policies.php?choice=modules |title=Use of Modules for Accessing Multiple Versions of Software |date=20 Mar 2008 |website=Baseline Configuration |publisher=DoD High Performance Computing Modernization Program (HPCMP) |access-date=9 February 2014 |url-status=dead |archive-url=https://web.archive.org/web/20140222063501/http://centers.hpc.mil/consolidated/bc/policies.php?choice=modules |archive-date=22 February 2014 }}</ref> Project Baseline Configuration<ref>{{cite web|url=http://centers.hpc.mil/consolidated/bc/index.php |title=DoD High Performance Computing Modernization Program Baseline Configuration |website=Baseline Configuration |publisher=DoD High Performance Computing Modernization Program (HPCMP) |access-date=9 February 2014 |url-status=dead |archive-url=https://web.archive.org/web/20140222063504/http://centers.hpc.mil/consolidated/bc/index.php |archive-date=22 February 2014 }}</ref> team for participating DoD Supercomputing Resource Centers (DSRCs).▼
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 {{mono|PATH}} or {{mono|LD_LIBRARY_PATH}}.
Environment Modules is shell independent and supports all major Unix shells ([[Bash (Unix shell)|Bash]], [[KornShell|ksh]], [[Z shell|zsh]], [[Fish (Unix shell)|Fish]], [[Bourne shell|sh]], [[tcsh]], and [[C shell|csh]]), Windows shells ([[CMD.EXE]] and [[PowerShell]]) and several [[Scripting language|Scripting languages]] ([[Perl]], [[Python (programming language)|Python]], [[Ruby (programming language)|Ruby]], [[Tcl]], [[CMake]] and [[R (programming language)|R]])
== modulefiles ==▼
Environment Modules handles all kind of items part of shell environment, including [[environment variable]], [[Alias (command)|shell alias]], shell function and [[command-line completion]].
The modules system is based on modulefiles,<ref>{{cite web |url=http://modules.sourceforge.net/man/modulefile.html |title=modulefile - files containing Tcl code for the Modules package |author=John L. Furlani & Peter W. Osel |date=July 2009 |website=SourceForge |publisher=man page |access-date=9 February 2014}}</ref> 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 (Tool Command Language)]] and are interpreted by the modulecmd program via the module<ref>{{cite web |url=http://modules.sourceforge.net/man/module.html |title=module - command interface to the Modules package |author=John L. Furlani & Peter W. Osel |date=July 2009 |website=SourceForge |publisher=man page |access-date=9 February 2014}}</ref> user interface.▼
== History ==
Environment Modules was first developed in the early 1990s<ref>{{cite journal |last=Furlani |first=John L. |date=September 30 – October 3, 1991 |title=Modules: Providing a Flexible User Environment |url=https://modules.sourceforge.net/docs/Modules-Paper.pdf |journal=Proceedings of the Fifth Large Installation Systems Administration Conference (LISA V) |___location=San Diego, CA |pages=141–152 |access-date=9 February 2014}}</ref> by John L. Furlani at [[Sun Microsystems]]. Version 1 was developed as pure shell scripts. With version 2 Environment Modules became a [[C (programming language)|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<ref>{{cite web |url=https://sourceforge.net/p/modules/mailman/message/2787194/ |title=Module 3.0 Beta 1 is out |date=4 October 1996 |website=SourceForge }}</ref>. 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)<ref>{{cite web |url=https://sourceforge.net/p/modules/mailman/message/2787533/ |title=Modules 3.1.0 almost ready |date=28 June 2000 |website=SourceForge }}</ref>.
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.▼
▲
In 2004, Mark Lakata of [[MIPS Technologies]] developed a pure [[Tcl]] reimplementation of Environment Modules<ref>{{cite web |url=https://sourceforge.net/p/modules/mailman/message/2788094/ |title=pure TCL implementation of module |date=29 October 2002 |website=SourceForge }}</ref>. 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<ref>{{cite web |url=https://sourceforge.net/p/modules/mailman/message/20574133/ |title=Announcing Lmod: A new module system |date=16 October 2008 |website=SourceForge }}</ref>, 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 (programming language)|C]] implementation of Environment Modules was discontinued. In the following years, the Lmod project grew in popularity within the [[high-performance computing|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 (programming language)|C]] version<ref>{{cite web |url=https://sourceforge.net/p/modules/mailman/message/36077942/ |title=Modules 4.0.0 released |date=16 October 2017 |website=SourceForge }}</ref>. Since then, new features have been introduced regularly to enhance usability and extend functionality<ref>{{cite web |url=https://modules.readthedocs.io/en/stable/MIGRATING.html |title=New features |date=31 July 2025 |website=Read the Docs }}</ref>.
== Modulefiles ==
▲The modules system is based on modulefiles,<ref>{{cite web |url=
▲
▲=== Default modulefiles directory ===
The default modules search path is in a hidden configuration file you can display with:
{{sxhl|2=console|
Line 34 ⟶ 50:
=== Add your own modules to the path ===
The {{mono|${MODULESHOME}/modulefiles/'''use.own'''}} module essentially performs these steps:
{{sxhl|2=bash|
}}
=== Use a version file within a hierarchical organization ===
The commands in this section require read/write/execute access to the {{Mono|/etc/modulefiles}} directory. The {{Mono|$HOME/privatemodules}} or another directory can be used instead along with "{{Mono|module use --append}}" or modification of the configuration file specifying the default modules search path.
The default {{Mono|modulefiles}} 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:
<syntaxhighlight lang="bash">
</syntaxhighlight>
Set the first version as the default:
<syntaxhighlight lang="bash">
</syntaxhighlight>
Switch to the newer version as the default with:
<syntaxhighlight lang="bash">
</syntaxhighlight>
Line 124 ⟶ 138:
== Automatic modules initialization ==
Environment Modules on [[Scientific Linux]], [[CentOS]], and [[Red Hat Enterprise Linux]] distributions in the environment-modules package include {{mono|modules.csh}} and {{mono|modules.sh}} scripts for the {{mono|/etc/profile.d}} 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.
Line 133 ⟶ 146:
{{mono|/etc/profile.d/modules.sh}} from the {{mono|etc/global/profile.modules}} file in the 3.2.10 modules build directory.
<syntaxhighlight lang="bash">
</syntaxhighlight>
Copy the {{mono|etc/global/profile.modules}} file from the 3.2.10 modules build directory to the system initialization directory:
Line 155 ⟶ 168:
=== tcsh, csh automatic modules initialization ===
A {{mono|/etc/profile.d/modules.csh}} symbolic link to the {{mono|etc/global/profile.modules}} 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:
<syntaxhighlight lang="bash">
Line 185 ⟶ 195:
=== Linux from source ===
Although installing from a [[Linux distributions]] 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.<ref>http://nickgeoghegan.net/linux/installing-environment-modules</ref>
==== 8.6.1 version of Tcl built from /usr/local/src ====
Although the [[PCLinuxOS]] 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.<ref>
Extract source after downloading
Line 205 ⟶ 214:
==== 3.2.10 version of modules built from /usr/local/src ====
Extract source after downloading
{{sxhl|2=bash|
Line 218 ⟶ 226:
sudo make install
}}
▲== See also ==
{{Portal|Free and open-source software}}▼
== References ==
Line 226 ⟶ 231:
== External links ==
▲{{Portal|Free and open-source software}}
* {{Official website|https://modules.sourceforge.net/}}
* {{GitHub|envmodules/modules}}
* John L. Furlani, [
* http://www.lysator.liu.se/cmod/ - alternative implementation using C only
* [https://web.archive.org/web/20140203041538/http://rcc.its.psu.edu/user_guides/system_utilities/modules/ PennState Environment Modules User Guide]
* [
* [https://web.archive.org/web/20150217180220/https://www.xsede.org/software-environments Xsede Software Environments]. The Extreme Science and Engineering Discovery Environment ― National Science Foundation
* [http://www.nics.tennessee.edu/computing-resources/modules NICS Modules Description] ― The National Institute for Computational Sciences at Oak Ridge National Laboratory ― Department of Energy
Line 240 ⟶ 245:
[[Category:Free software programmed in Tcl]]
[[Category:Unix software]]
[[Category:Science software]]
[[Category:System administration]]
|