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