Content deleted Content added
Importing Wikidata short description: "Tool for dynamic modification of a user's shell environment during a session" |
No edit summary |
||
Line 1:
{{Short description|Tool for dynamic modification of a user's shell environment during a session}}
{{how-to|date=February 2015}}
{{Infobox software
| name = Environment Modules
Line 9 ⟶ 8:
| operating_system = [[Unix-like]]
| license = [[GNU General Public License#Version 2]]
| website = {{URL|
}}
The '''Environment Modules''' system is a tool to help users manage their [[Unix]] or [[Linux]] shell environment, by allowing groups of related environment-variable settings to be made or removed dynamically.
Line 20 ⟶ 18:
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.
The key advantage of Environment Modules is that it is shell independent and supports all major shells such as [[Bash (Unix shell)|bash]], [[KornShell|ksh]], [[Z shell|zsh]], sh, [[tcsh]], and [[C shell|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 (programming language)|Lua]] instead of
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.
Line 38 ⟶ 36:
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">
mkdir /etc/modulefiles/test
Line 55 ⟶ 53:
module show test
</syntaxhighlight>
Set the first version as the default:
<syntaxhighlight lang="bash">
Line 63 ⟶ 62:
module show test/2.0
</syntaxhighlight>
Switch to the newer version as the default with:
<syntaxhighlight lang="bash">
Line 71:
module show test
</syntaxhighlight>
After the above following a fresh install from source you would see:
<syntaxhighlight lang="console">
Line 123 ⟶ 124:
== Automatic modules initialization ==
Environment Modules on [[Scientific Linux]], [[CentOS]], and
For a source build the automation for all users can be manually configured.
Line 131 ⟶ 132:
{{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 161 ⟶ 162:
On Scientific Linux, CentOS, and RHEL distributions Environment Modules is in the environment-modules package which can be installed with:
<syntaxhighlight lang="console">
</syntaxhighlight>
Once installed the package information can be viewed with:
<syntaxhighlight lang="console">
rpm -qi environment-modules▼
</syntaxhighlight>
=== Installing Environment Modules on Linux using apt and dpkg ===
On Ubuntu or systems using {{Mono|apt-get}}, Environment Modules can be installed with:
<syntaxhighlight lang="console">
</syntaxhighlight>
Once installed the package information can be viewed with:
<syntaxhighlight lang="console">
</syntaxhighlight>
=== Installing Environment Modules on 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
* [http://nickgeoghegan.net/linux/installing-environment-modules Installing Environment Modules]
==== 8.6.1 version of
Although the PCLinuxOS 64-bit repositories include [[Tcl
Tcl
Extract source after downloading
{{sxhl|2=bash|
}}
Configure, make, install
{{sxhl|2=bash|
}}
Line 203 ⟶ 212:
Extract source after downloading
{{sxhl|2=bash|
}}
Configure, make, install
Line 215 ⟶ 224:
== See also ==
{{Portal|Free and open-source software}}
* [[Tcl]]
Line 221 ⟶ 231:
== External links ==
*
* John L. Furlani, [http://modules.sourceforge.net/docs/Modules-Paper.pdf 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
|