Debian Codegraph @

doc/source/other-implementations.rst

raw
1 .. _other-implementations:
2
3 Other ``module`` implementations
4 ================================
5
6 Since the inception of the Environment Modules project in 1991, the ``module``
7 command has become a de facto standard interface for dynamically modifying a
8 user's environment via modulefiles. Over time, several alternative
9 implementations of the ``module`` command have been developed.
10
11 This document provides an overview of known ``module`` command
12 implementations, with a particular focus on Lmod, the most widely adopted
13 alternative. The goal is to inform users and developers of the current
14 landscape of ``module`` system tools.
15
16 Lmod
17 ----
18
19 `Lmod`_ is an implementation of Environment Modules written in Lua. Its
20 development started in 2008 and along a years Lmod has introduced many new
21 features into the ``module`` world: software hierarchy, cache mechanism, Lua
22 modulefile support, ``ml`` command, etc.
23
24 Lmod gained popularity in the mid-2010s, during a period when the Modules
25 project was largely inactive. It is now widely adopted, particularly in the
26 HPC community.
27
28 .. _Lmod: https://github.com/TACC/Lmod/
29
30 Today, Lmod and Modules offer broadly similar feature sets. The following
31 table highlights features that are unique to each implementation.
32
33 .. list-table::
34 :header-rows: 1
35
36 * - Lmod 9.0.4
37 - Modules 5.6
38 * - * Integration with *nushell* and *rc* shells and *json* structured
39 output
40 * `Lua modulefile support`_
41 * `Inactive modules`_
42 * Save configuration under :envvar:`XDG_CONFIG_HOME`
43 * `i18n`_
44 * `Find best module`_
45 * `Path entry priorities`_
46 * `Update path entry order`_
47 * ``--regexp`` search option
48 * `settarg`_
49 * `Hook functions`_
50 * |LMOD_FILE_IGNORE_PATTERNS|_ environment variable
51 - * Integration with *cmd* and *pwsh* shells and *Tcl* language
52 * :ref:`Automated module handling<MODULES_AUTO_HANDLING>`
53 * :ref:`Advanced module version specifiers`
54 * :ref:`Module variants`
55 * :ref:`Virtual modules`
56 * :ref:`Sourcing modulefiles`
57 * Handle modulefile outside modulepath
58 * :ref:`Quarantine mechanism`
59 * :ref:`Case insensitive module load<Insensitive case>`
60 * Automatic ``latest`` and ``loaded`` symbols
61 * ``alias``, ``command``, ``loaded``, ``tags``, ``usergroups`` and
62 ``username`` sub-commands of :mfcmd:`module-info`
63 * :ref:`Super-sticky modules<Sticky modules>`
64 * :ref:`Fine-tuned output configuration<--output>`
65 * :ref:`Editing modulefiles`
66 * :ref:`Tag when loading module<More tagging capabilities>`
67 * :ref:`Stashing environment`
68 * :ref:`Extra specifier`
69 * Configurable :ref:`Abort on error` behavior
70 * Integration with *bash-eval* and *fish* shells in :mfcmd:`source-sh`
71 * :ref:`Specific modulepath for requirements`
72 * :ref:`Logging activity`
73 * :command:`envml` launcher
74
75 .. _Lua modulefile support: https://lmod.readthedocs.io/en/latest/050_lua_modulefiles.html
76 .. _Inactive modules: https://lmod.readthedocs.io/en/latest/010_user.html#module-hierarchy
77 .. _Find best module: https://lmod.readthedocs.io/en/latest/060_locating.html
78 .. _i18n: https://lmod.readthedocs.io/en/latest/185_localization.html
79 .. _Path entry priorities: https://lmod.readthedocs.io/en/latest/077_ref_counting.html#specifying-priorities-for-path-entries
80 .. _Update path entry order: https://lmod.readthedocs.io/en/latest/077_ref_counting.html
81 .. _settarg: https://lmod.readthedocs.io/en/latest/310_settarg.html
82 .. _Hook functions: https://lmod.readthedocs.io/en/latest/170_hooks.html#hook-functions
83 .. |LMOD_FILE_IGNORE_PATTERNS| replace:: ``LMOD_FILE_IGNORE_PATTERNS``
84 .. _LMOD_FILE_IGNORE_PATTERNS: https://lmod.readthedocs.io/en/latest/090_configuring_lmod.html#setting-environment-variables-or-cosmic-assign-at-startup
85
86 The following table highlights ``module`` sub-commands that are exclusive to
87 either Lmod or Modules. In some cases, similar functionality exists under
88 different sub-command names or mechanisms. A correspondence table is provided
89 at the end of this section to map these equivalents.
90
91 .. list-table::
92 :header-rows: 1
93
94 * - Lmod 9.0.4
95 - Modules 5.6
96 * - ``category``, ``overview``, ``tablelist``
97 - :subcmd:`aliases`, :subcmd:`append-path`, :subcmd:`cachebuild`,
98 :subcmd:`cacheclear`, :subcmd:`clear`, :subcmd:`config`,
99 :subcmd:`edit`, :subcmd:`info-loaded`, :subcmd:`initadd`,
100 :subcmd:`initclear`, :subcmd:`initlist`, :subcmd:`initprepend`,
101 :subcmd:`initrm`, :subcmd:`initswitch`, :subcmd:`is-saved`,
102 :subcmd:`is-used`, :subcmd:`lint`, :subcmd:`mod-to-sh`, :subcmd:`path`,
103 :subcmd:`paths`, :subcmd:`prepend-path`, :subcmd:`remove-path`,
104 :subcmd:`saverm`, :subcmd:`saveshow`, :subcmd:`sh-to-mod`,
105 :subcmd:`source`, :subcmd:`stash`, :subcmd:`stashclear`,
106 :subcmd:`stashlist`, :subcmd:`stashpop`, :subcmd:`stashrm`,
107 :subcmd:`stashshow`, :subcmd:`state`, :subcmd:`test`
108
109
110 The following table highlights Tcl modulefile commands that are exclusive to
111 either Lmod or Modules. In some cases, similar functionality exists under
112 different command names or mechanisms. A correspondence table is provided at
113 the end of this section to map these equivalents.
114
115 .. list-table::
116 :header-rows: 1
117
118 * - Lmod 9.0.4
119 - Modules 5.6
120 * - ``remove-property``
121 - :mfcmd:`getvariant`, :mfcmd:`is-saved`, :mfcmd:`is-used`,
122 :mfcmd:`lsb-release`, :mfcmd:`module-tag`, :mfcmd:`module-virtual`,
123 :mfcmd:`module-warn`, :mfcmd:`modulepath-label`,
124 :mfcmd:`modulepath-label`, :mfcmd:`provide`, :mfcmd:`reportWarning`,
125 :mfcmd:`uncomplete`, :mfcmd:`variant`, :mfcmd:`x-resource`
126
127 See the :ref:`Compatibility with Lmod Tcl modulefile` section for details on
128 how the implementation of the Tcl modulefile commands differ between Lmod and
129 Modules.
130
131 The following table provides a correspondence between features in Lmod and
132 Modules that offer similar functionality, even if they differ in name or
133 implementation.
134
135 .. list-table::
136 :header-rows: 1
137
138 * - Lmod 9.0.4
139 - Modules 5.6
140 * - `Module properties`_
141 - :ref:`Module tags`
142 * - `One name rule`_
143 - :mconfig:`unique_name_loaded` configuration option
144 * - `Custom labels for avail`_
145 - :mfcmd:`modulepath-label` modulefile command
146 * - `Extensions`_
147 - :mfcmd:`provide` modulefile command
148 * - `Irreversible module actions`_
149 - :ref:`Change modulefile command behavior`
150 * - `NAG file`_
151 - :mfcmd:`module-forbid`, :mfcmd:`module-warn` modulefile commands
152 * - Lmod + `XALT`_
153 - :ref:`Logging activity`
154 * - `Hook functions`_
155 - :ref:`Override any internal procedures or set trace hook<Site-specific
156 configuration>`
157 * - `Module hierarchy`_
158 - :ref:`Requiring via module`
159 * - `Autoswap`_
160 - :ref:`Conflict unload MIGRATING`
161 * - |LMOD_DOWNSTREAM_CONFLICTS|_ environment variable
162 - :ref:`Dependencies between modulefiles`
163 * - |LMOD_QUARANTINE_VARS|_ environment variable
164 - :mconfig:`protected_envvars` configuration option
165 * - |clearLmod|_ shell function
166 - ``module`` :subcmd:`clear`
167 * - |update_lmod_system_cache_files|_ script
168 - ``module`` :subcmd:`cachebuild`
169 * - |sh_to_modulefile|_ script
170 - ``module`` :subcmd:`sh-to-mod`
171 * - |check_module_tree_syntax|_ script
172 - ``module`` :subcmd:`lint`
173 * - ``module --checkSyntax load``
174 - ``module`` :subcmd:`lint`
175 * - ``module --config``
176 - ``module`` :subcmd:`config`
177 * - ``$LMOD_CMD bash load``
178 - ``module`` :subcmd:`mod-to-sh` ``bash``
179 * - ``module --raw show``
180 - ``EDITOR=cat module`` :subcmd:`edit`
181 * - ``module --location show``
182 - ``module`` :subcmd:`path`
183 * - ``module --mt``
184 - ``module`` :subcmd:`state`
185 * - ``module overview``
186 - ``module avail`` :option:`--no-indepth`
187 * - ``module --regexp avail``
188 - ``module avail`` :option:`--contains`
189 * - ``module --style=<style_name> avail``
190 - ``module avail`` :option:`--output` ``<element_list>``
191 * - ``module --no_extensions avail``
192 - ``module avail`` :option:`--output` ``-provided-alias``
193 * - ``module --terse_show_extensions avail``
194 - ``module avail --terse`` :option:`--output` ``+provided-alias``
195 * - ``module category``
196 - ``module`` :subcmd:`search`
197 * - ``module --brief list``
198 - ``module config`` :mconfig:`hide_auto_loaded` ``1``
199 * - ``module tablelist``
200 - ``module list`` :option:`--json`
201 * - ``module --pin_versions restore``
202 - ``module config`` :mconfig:`collection_pin_version` ``1`` +
203 ``module save`` + ``module restore``
204 * - ``module --initial_load restore``
205 - ``module restore`` during :ref:`Modules initialization<Initial
206 environment>`
207 * - ``atleast("foo","5.0")``
208 - |[email protected]:|_
209 * - ``atmost("foo","5.0")``
210 - |foo@:5.0|_
211 * - ``between("foo","5.0","7.0")``
212 - |[email protected]:7.0|_
213 * - ``latest("foo")``
214 - |foo@latest|_
215
216 .. _Irreversible module actions: https://lmod.readthedocs.io/en/latest/370_irreversible.html
217 .. _NAG file: https://lmod.readthedocs.io/en/latest/140_deprecating_modules.html
218 .. _Custom labels for avail: https://lmod.readthedocs.io/en/latest/200_avail_custom.html
219 .. _Extensions: https://lmod.readthedocs.io/en/latest/330_extensions.html
220 .. _Module properties: https://lmod.readthedocs.io/en/latest/145_properties.html
221 .. _One name rule: https://lmod.readthedocs.io/en/latest/010_user.html#users-can-only-have-one-version-active-the-one-name-rule
222 .. _XALT: https://github.com/xalt/xalt
223 .. _Module hierarchy: https://lmod.readthedocs.io/en/latest/080_hierarchy.html
224 .. _Autoswap: https://lmod.readthedocs.io/en/latest/060_locating.html#autoswapping-rules
225 .. |LMOD_DOWNSTREAM_CONFLICTS| replace:: ``LMOD_DOWNSTREAM_CONFLICTS``
226 .. _LMOD_DOWNSTREAM_CONFLICTS: https://lmod.readthedocs.io/en/latest/090_configuring_lmod.html#configuration-or-cosmic-assign-at-startup
227 .. |LMOD_QUARANTINE_VARS| replace:: ``LMOD_QUARANTINE_VARS``
228 .. _LMOD_QUARANTINE_VARS: https://lmod.readthedocs.io/en/latest/090_configuring_lmod.html#environment-variables-only
229 .. |clearLmod| replace:: ``clearLmod``
230 .. _clearLmod: https://lmod.readthedocs.io/en/latest/010_user.html#clearlmod-complete-remove-lmod-setup
231 .. |check_module_tree_syntax| replace:: ``check_module_tree_syntax``
232 .. _check_module_tree_syntax: https://lmod.readthedocs.io/en/latest/360_check_syntax.html
233 .. |update_lmod_system_cache_files| replace:: ``update_lmod_system_cache_files``
234 .. _update_lmod_system_cache_files: https://lmod.readthedocs.io/en/latest/130_spider_cache.html
235 .. |sh_to_modulefile| replace:: ``sh_to_modulefile``
236 .. _sh_to_modulefile: https://lmod.readthedocs.io/en/latest/260_sh_to_modulefile.html#converting-shell-scripts-to-modulefiles
237 .. |[email protected]:| replace:: ``[email protected]:``
238 .. [email protected]\:: module.html#version-specifiers
239 .. |foo@:5.0| replace:: ``foo@:5.0``
240 .. _foo@\:5.0: module.html#version-specifiers
241 .. |[email protected]:7.0| replace:: ``[email protected]:7.0``
242 .. [email protected]\:7.0: module.html#version-specifiers
243 .. |foo@latest| replace:: ``foo@latest``
244 .. _foo@latest: module.html#version-specifiers
245
246 Other alternatives
247 ------------------
248
249 This section intends to reference all other existing alternative ``module``
250 implementations.
251
252 * `Modulecmd.py`_: Environment Modules implementation in Python
253 * `Pmodules`_: Environment Modules implementation in Bash
254 * `RSModules`_: Environment Modules implementation in Rust
255
256 .. _Modulecmd.py: https://github.com/tjfulle/Modulecmd.py
257 .. _Pmodules: https://github.com/Pmodules/Pmodules
258 .. _RSModules: https://github.com/fretn/rsmodules
259
260 If you know of a ``module`` implementation project that's not listed here,
261 please :ref:`let us know<Community>` so we can include it.
262
263 Related projects
264 ----------------
265
266 Beyond alternative implementations of the ``module`` command, several projects
267 have been developed along the years to extend its functionality or provide
268 additional tools that enhance how modulefiles are handled.
269
270 * `Devel::IPerl::Plugin::EnvironmentModules`_: interact with Environment
271 Modules in a Jupyter IPerl kernel
272 * `Env::Modulecmd`_: interface to ``modulecmd`` from Perl
273 * `environmentmodules`_: Python interface for Environment Modules
274 * `flavours`_: extension built on top of Modules v3 to provide module auto
275 handling mechanisms
276 * `Mii`_: a smart search engine for module environments
277 * `RenvModule`_: interface to Environment Modules within the R environment
278
279 .. _Devel\:\:IPerl\:\:Plugin\:\:EnvironmentModules: https://github.com/kiwiroy/Devel-IPerl-Plugin-EnvironmentModules
280 .. _Env\:\:Modulecmd: https://metacpan.org/pod/Env::Modulecmd
281 .. _environmentmodules: https://github.com/ben-albrecht/environmentmodules
282 .. _flavours: https://sourceforge.net/projects/flavours/
283 .. _Mii: https://github.com/codeandkey/mii
284 .. _RenvModule: https://cran.r-project.org/web/packages/RenvModule/index.html
285
286 If you're aware of a ``module``-related project missing from this list, feel
287 free to :ref:`contact us<Community>` so we can add it.