modulefile.rst (modules-5.1.1.tar.bz2) | : | modulefile.rst (modules-5.2.0.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 68 | skipping to change at line 68 | |||
Modules Specific Tcl Commands | Modules Specific Tcl Commands | |||
----------------------------- | ----------------------------- | |||
The Modules Package uses commands which are extensions to the "standard" | The Modules Package uses commands which are extensions to the "standard" | |||
Tool Command Language :manpage:`Tcl(n)` package. Unless otherwise specified, | Tool Command Language :manpage:`Tcl(n)` package. Unless otherwise specified, | |||
the Module commands return the empty string. Some commands behave differently | the Module commands return the empty string. Some commands behave differently | |||
when a *modulefile* is loaded or unloaded. The command descriptions assume | when a *modulefile* is loaded or unloaded. The command descriptions assume | |||
the *modulefile* is being loaded. | the *modulefile* is being loaded. | |||
.. mfcmd:: always-load [--tag taglist] modulefile... | .. mfcmd:: always-load [--optional] [--tag taglist] modulefile... | |||
Load *modulefile* and apply the ``keep-loaded`` tag to it in order to avoid | Load *modulefile* and apply the ``keep-loaded`` tag to it in order to avoid | |||
the automatic unload of this *modulefile* when modules dependent of it are | the automatic unload of this *modulefile* when modules dependent of it are | |||
unloaded. | unloaded. | |||
*modulefile* is declared as a requirement of currently loading module. This | *modulefile* is declared as a requirement of currently loading module. This | |||
command acts as an alias of :mfcmd:`module load<module>` command. If more | command acts as an alias of :mfcmd:`module load<module>` command. If more | |||
than one *modulefile* are specified, then this list acts as a Boolean AND | than one *modulefile* are specified, then this list acts as a Boolean AND | |||
operation, which means all specified *modulefiles* are required. | operation, which means all specified *modulefiles* are required. | |||
When the ``--optional`` option is set, each specified *modulefile* is | ||||
declared as an optional requirement. A *modulefile* that cannot be loaded, | ||||
will not stop the evaluation. | ||||
The ``--tag`` option accepts a list of module tags to apply to *modulefile* | The ``--tag`` option accepts a list of module tags to apply to *modulefile* | |||
once loaded in addition to the ``keep-loaded`` tag. *taglist* corresponds to | once loaded in addition to the ``keep-loaded`` tag. *taglist* corresponds to | |||
the concatenation of multiple tags separated by colon character. *taglist* | the concatenation of multiple tags separated by colon character. *taglist* | |||
should not contain tags inherited from *modulefile* state or from other | should not contain tags inherited from *modulefile* state or from other | |||
modulefile commands. If module is already loaded, tags from *taglist* are | modulefile commands. If module is already loaded, tags from *taglist* are | |||
added to the list of tags already applied to this module. | added to the list of tags already applied to this module. | |||
.. only:: html | .. only:: html | |||
.. versionadded:: 5.1 | .. versionadded:: 5.1 | |||
.. versionchanged:: 5.2 | ||||
Option ``--optional`` added | ||||
.. mfcmd:: append-path [-d C|--delim C|--delim=C] [--duplicates] variable value. .. | .. mfcmd:: append-path [-d C|--delim C|--delim=C] [--duplicates] variable value. .. | |||
See :mfcmd:`prepend-path`. | See :mfcmd:`prepend-path`. | |||
.. mfcmd:: break | .. mfcmd:: break | |||
This is not a Modules-specific command, it's actually part of Tcl, which | This is not a Modules-specific command, it's actually part of Tcl, which | |||
has been overloaded similar to the :mfcmd:`continue` and :mfcmd:`exit` | has been overloaded similar to the :mfcmd:`continue` and :mfcmd:`exit` | |||
commands to have the effect of causing the module not to be listed as loaded | commands to have the effect of causing the module not to be listed as loaded | |||
and not affect other modules being loaded concurrently. All non-environment | and not affect other modules being loaded concurrently. All non-environment | |||
skipping to change at line 175 | skipping to change at line 182 | |||
.. mfcmd:: continue | .. mfcmd:: continue | |||
This is not a modules specific command but another overloaded Tcl command | This is not a modules specific command but another overloaded Tcl command | |||
and is similar to the :mfcmd:`break` or :mfcmd:`exit` commands except the | and is similar to the :mfcmd:`break` or :mfcmd:`exit` commands except the | |||
module will be listed as loaded as well as performing any environment or Tcl | module will be listed as loaded as well as performing any environment or Tcl | |||
commands up to this point and then continuing on to the next module on | commands up to this point and then continuing on to the next module on | |||
the command line. The :mfcmd:`continue` command will only have this effect if | the command line. The :mfcmd:`continue` command will only have this effect if | |||
not used within a Tcl loop though. | not used within a Tcl loop though. | |||
.. mfcmd:: depends-on [--tag taglist] modulefile... | .. mfcmd:: depends-on [--optional] [--tag taglist] modulefile... | |||
Alias of :mfcmd:`prereq-all` command. | Alias of :mfcmd:`prereq-all` command. | |||
.. only:: html | .. only:: html | |||
.. versionadded:: 5.1 | .. versionadded:: 5.1 | |||
.. versionchanged:: 5.2 | ||||
Option ``--optional`` added | ||||
.. mfcmd:: exit [N] | .. mfcmd:: exit [N] | |||
This is not a modules specific command but another overloaded Tcl command | This is not a modules specific command but another overloaded Tcl command | |||
and is similar to the :mfcmd:`break` or :mfcmd:`continue` commands. However, | and is similar to the :mfcmd:`break` or :mfcmd:`continue` commands. However, | |||
this command will cause the immediate cessation of this module and any | this command will cause the immediate cessation of this module and any | |||
additional ones on the command line. This module and the subsequent | additional ones on the command line. This module and the subsequent | |||
modules will not be listed as loaded. No environment commands will be | modules will not be listed as loaded. No environment commands will be | |||
performed in the current module. | performed in the current module. | |||
.. mfcmd:: family name | .. mfcmd:: family name | |||
skipping to change at line 376 | skipping to change at line 386 | |||
| | file and sourced | interpretation | | | | file and sourced | interpretation | | |||
| | script file | | | | | script file | | | |||
+================================+=====================+=====================+ | +================================+=====================+=====================+ | |||
| :subcmd:`load`, | Same sub-commands | *None* | | | :subcmd:`load`, | Same sub-commands | *None* | | |||
| :subcmd:`load-any`, | available than for | | | | :subcmd:`load-any`, | available than for | | | |||
| :subcmd:`switch`, | modulefile and | | | | :subcmd:`switch`, | modulefile and | | | |||
| :subcmd:`try-load`, | :subcmd:`config` | | | | :subcmd:`try-load`, | :subcmd:`config` | | | |||
| :subcmd:`unload`, | sub-command. | | | | :subcmd:`unload`, | sub-command. | | | |||
| :subcmd:`unuse`, :subcmd:`use`.| | | | | :subcmd:`unuse`, :subcmd:`use`.| | | | |||
| Also available but not recomm\ | | | | | Also available but not recomm\ | | | | |||
| anded for use from regular | | | | | ended for use from regular | | | | |||
| modulefile: :subcmd:`aliases`, | | | | | modulefile: :subcmd:`aliases`, | | | | |||
| :subcmd:`avail`, | | | | | :subcmd:`avail`, | | | | |||
| :subcmd:`display`, | | | | | :subcmd:`display`, | | | | |||
| :subcmd:`initadd`, | | | | | :subcmd:`initadd`, | | | | |||
| :subcmd:`initclear`, | | | | | :subcmd:`initclear`, | | | | |||
| :subcmd:`initlist`, | | | | | :subcmd:`initlist`, | | | | |||
| :subcmd:`initprepend`, | | | | | :subcmd:`initprepend`, | | | | |||
| :subcmd:`initrm`, | | | | | :subcmd:`initrm`, | | | | |||
| :subcmd:`initswitch`, | | | | | :subcmd:`initswitch`, | | | | |||
| :subcmd:`list`, | | | | | :subcmd:`list`, | | | | |||
skipping to change at line 600 | skipping to change at line 610 | |||
**module-info command** [commandname] | **module-info command** [commandname] | |||
Returns the currently running :file:`modulecmd.tcl`'s command as a string | Returns the currently running :file:`modulecmd.tcl`'s command as a string | |||
if no *commandname* is given. | if no *commandname* is given. | |||
Returns ``1`` if :file:`modulecmd.tcl`'s command is *commandname*. | Returns ``1`` if :file:`modulecmd.tcl`'s command is *commandname*. | |||
*commandname* can be: ``load``, ``unload``, ``refresh``, ``reload``, | *commandname* can be: ``load``, ``unload``, ``refresh``, ``reload``, | |||
``source``, ``switch``, ``display``, ``avail``, ``aliases``, ``list``, | ``source``, ``switch``, ``display``, ``avail``, ``aliases``, ``list``, | |||
``whatis``, ``search``, ``purge``, ``restore``, ``help``, ``test``, | ``whatis``, ``search``, ``purge``, ``restore``, ``help``, ``test``, | |||
``try-load`` or ``load-any``. | ``try-load``, ``load-any``, ``mod-to-sh``, ``reset``, ``stash`` or | |||
``stashpop``. | ||||
.. only:: html | .. only:: html | |||
.. versionadded:: 4.0 | .. versionadded:: 4.0 | |||
**module-info loaded** modulefile | **module-info loaded** modulefile | |||
Returns the names of currently loaded modules matching passed *modulefile*. | Returns the names of currently loaded modules matching passed *modulefile*. | |||
The parameter *modulefile* might either be a fully qualified *modulefile* | The parameter *modulefile* might either be a fully qualified *modulefile* | |||
with name and version or just a directory which in case all loaded | with name and version or just a directory which in case all loaded | |||
skipping to change at line 652 | skipping to change at line 663 | |||
**module-info shell** [shellname] | **module-info shell** [shellname] | |||
Return the current shell under which :file:`modulecmd.tcl` was invoked if | Return the current shell under which :file:`modulecmd.tcl` was invoked if | |||
no *shellname* is given. The current shell is the first parameter of | no *shellname* is given. The current shell is the first parameter of | |||
:file:`modulecmd.tcl`, which is normally hidden by the :command:`module` | :file:`modulecmd.tcl`, which is normally hidden by the :command:`module` | |||
alias. | alias. | |||
If a *shellname* is given, returns ``1`` if :file:`modulecmd.tcl`'s current | If a *shellname* is given, returns ``1`` if :file:`modulecmd.tcl`'s current | |||
shell is *shellname*, returns ``0`` otherwise. *shellname* can be: ``sh``, | shell is *shellname*, returns ``0`` otherwise. *shellname* can be: ``sh``, | |||
``bash``, ``ksh``, ``zsh``, ``csh``, ``tcsh``, ``fish``, ``tcl``, ``perl``, | ``bash``, ``ksh``, ``zsh``, ``csh``, ``tcsh``, ``fish``, ``cmd``, ``tcl``, | |||
``python``, ``ruby``, ``lisp``, ``cmake``, ``r``. | ``perl``, ``python``, ``ruby``, ``lisp``, ``cmake``, ``r``. | |||
**module-info shelltype** [shelltypename] | **module-info shelltype** [shelltypename] | |||
Return the family of the shell under which *modulefile* was invoked if no | Return the family of the shell under which *modulefile* was invoked if no | |||
*shelltypename* is given. As of :mfcmd:`module-info shell<module-info>` this | *shelltypename* is given. As of :mfcmd:`module-info shell<module-info>` this | |||
depends on the first parameter of :file:`modulecmd.tcl`. The output reflects | depends on the first parameter of :file:`modulecmd.tcl`. The output reflects | |||
a shell type determining the shell syntax of the commands produced by | a shell type determining the shell syntax of the commands produced by | |||
:file:`modulecmd.tcl`. | :file:`modulecmd.tcl`. | |||
If a *shelltypename* is given, returns ``1`` if :file:`modulecmd.tcl`'s | If a *shelltypename* is given, returns ``1`` if :file:`modulecmd.tcl`'s | |||
current shell type is *shelltypename*, returns ``0`` otherwise. | current shell type is *shelltypename*, returns ``0`` otherwise. | |||
*shelltypename* can be: ``sh``, ``csh``, ``fish``, ``tcl``, ``perl``, | *shelltypename* can be: ``sh``, ``csh``, ``fish``, ``cmd``, ``tcl``, | |||
``python``, ``ruby``, ``lisp``, ``cmake``, ``r``. | ``perl``, ``python``, ``ruby``, ``lisp``, ``cmake``, ``r``. | |||
**module-info specified** | **module-info specified** | |||
Return the module designation (name, version and variants) specified that | Return the module designation (name, version and variants) specified that | |||
led to current *modulefile* evaluation. | led to current *modulefile* evaluation. | |||
**module-info symbols** modulefile | **module-info symbols** modulefile | |||
Returns a list of all symbolic versions assigned to the passed | Returns a list of all symbolic versions assigned to the passed | |||
*modulefile*. The parameter *modulefile* might either be a full qualified | *modulefile*. The parameter *modulefile* might either be a full qualified | |||
skipping to change at line 865 | skipping to change at line 876 | |||
:mfcmd:`remove-path`. | :mfcmd:`remove-path`. | |||
If *value* corresponds to the concatenation of multiple elements separated by | If *value* corresponds to the concatenation of multiple elements separated by | |||
colon, or *delimiter*, character, each element is treated separately. | colon, or *delimiter*, character, each element is treated separately. | |||
.. only:: html | .. only:: html | |||
.. versionchanged:: 4.1 | .. versionchanged:: 4.1 | |||
Option ``--duplicates`` added | Option ``--duplicates`` added | |||
.. mfcmd:: prereq [--tag taglist] modulefile... | .. mfcmd:: prereq [--optional] [--tag taglist] modulefile... | |||
:mfcmd:`prereq` controls whether or not the *modulefile* will be loaded. The | :mfcmd:`prereq` controls whether or not the *modulefile* will be loaded. The | |||
:mfcmd:`prereq` command lists *modulefiles* which must have been previously | :mfcmd:`prereq` command lists *modulefiles* which must have been previously | |||
loaded before the current *modulefile* will be loaded. If a list contains | loaded before the current *modulefile* will be loaded. If a list contains | |||
more than one *modulefile*, then each member of the list acts as a Boolean OR | more than one *modulefile*, then each member of the list acts as a Boolean OR | |||
operation. Multiple :mfcmd:`prereq` commands may be used to create a Boolean | operation. Multiple :mfcmd:`prereq` commands may be used to create a Boolean | |||
AND operation. If one of the requirements have not been satisfied, an error | AND operation. If one of the requirements have not been satisfied, an error | |||
is reported and the current *modulefile* makes no changes to the user's | is reported and the current *modulefile* makes no changes to the user's | |||
environment. | environment. | |||
If an argument for :mfcmd:`prereq` is a directory and any *modulefile* from | If an argument for :mfcmd:`prereq` is a directory and any *modulefile* from | |||
the directory has been loaded, then the prerequisite is met. For example, | the directory has been loaded, then the prerequisite is met. For example, | |||
specifying X11 as a :mfcmd:`prereq` means that any version of X11, X11/R4 or | specifying X11 as a :mfcmd:`prereq` means that any version of X11, X11/R4 or | |||
X11/R5, must be loaded before proceeding. | X11/R5, must be loaded before proceeding. | |||
The parameter *modulefile* may also be a symbolic modulefile name or a | The parameter *modulefile* may also be a symbolic modulefile name or a | |||
modulefile alias. It may also leverage a specific syntax to finely select | modulefile alias. It may also leverage a specific syntax to finely select | |||
module version (see `Advanced module version specifiers`_ section below). | module version (see `Advanced module version specifiers`_ section below). | |||
When the ``--optional`` option is set, the whole list of specified | ||||
*modulefiles* is declared as an optional requirement list. Evaluation is not | ||||
stopped if no *modulefile* from the list is loaded. | ||||
If the :mconfig:`auto_handling` configuration option is enabled | If the :mconfig:`auto_handling` configuration option is enabled | |||
:mfcmd:`prereq` will attempt to load specified modulefile if not found loaded | :mfcmd:`prereq` will attempt to load specified modulefile if not found loaded | |||
yet (see :envvar:`MODULES_AUTO_HANDLING` in :ref:`module(1)`). | yet (see :envvar:`MODULES_AUTO_HANDLING` in :ref:`module(1)`). | |||
The ``--tag`` option accepts a list of module tags to apply to *modulefile* | The ``--tag`` option accepts a list of module tags to apply to *modulefile* | |||
once loaded. *taglist* corresponds to the concatenation of multiple tags | once loaded. *taglist* corresponds to the concatenation of multiple tags | |||
separated by colon character. *taglist* should not contain tags inherited | separated by colon character. *taglist* should not contain tags inherited | |||
from *modulefile* state or from other modulefile commands. If module is | from *modulefile* state or from other modulefile commands. If module is | |||
already loaded, tags from *taglist* are added to the list of tags already | already loaded, tags from *taglist* are added to the list of tags already | |||
applied to this module. | applied to this module. | |||
.. only:: html | .. only:: html | |||
.. versionchanged:: 4.2 | .. versionchanged:: 4.2 | |||
An attempt to load modulefile is made if :mconfig:`auto_handling` | An attempt to load modulefile is made if :mconfig:`auto_handling` | |||
configuration option is enabled | configuration option is enabled | |||
.. versionchanged:: 5.1 | .. versionchanged:: 5.1 | |||
Option ``--tag`` added | Option ``--tag`` added | |||
.. mfcmd:: prereq-all [--tag taglist] modulefile... | .. versionchanged:: 5.2 | |||
Option ``--optional`` added | ||||
.. mfcmd:: prereq-all [--optional] [--tag taglist] modulefile... | ||||
Declare *modulefile* as a requirement of currently loading module. This | Declare *modulefile* as a requirement of currently loading module. This | |||
command acts as an alias of :mfcmd:`prereq` command. If more than one | command acts as an alias of :mfcmd:`prereq` command. If more than one | |||
*modulefile* are specified, then this list acts as a Boolean AND operation, | *modulefile* are specified, then this list acts as a Boolean AND operation, | |||
which means all specified *modulefiles* are required. | which means all specified *modulefiles* are required. | |||
When the ``--optional`` option is set, each specified *modulefile* is | ||||
declared as an optional requirement. A *modulefile* that cannot be loaded, | ||||
will not stop the evaluation. | ||||
.. only:: html | .. only:: html | |||
.. versionadded:: 5.1 | .. versionadded:: 5.1 | |||
.. mfcmd:: prereq-any [--tag taglist] modulefile... | .. versionchanged:: 5.2 | |||
Option ``--optional`` added | ||||
.. mfcmd:: prereq-any [--optional] [--tag taglist] modulefile... | ||||
Alias of :mfcmd:`prereq` command. | Alias of :mfcmd:`prereq` command. | |||
.. only:: html | .. only:: html | |||
.. versionadded:: 5.1 | .. versionadded:: 5.1 | |||
.. versionchanged:: 5.2 | ||||
Option ``--optional`` added | ||||
.. mfcmd:: pushenv variable value | .. mfcmd:: pushenv variable value | |||
Set environment *variable* to *value* and save previous value of *variable* | Set environment *variable* to *value* and save previous value of *variable* | |||
to restore it when *modulefile* is unloaded. Like for :mfcmd:`setenv` | to restore it when *modulefile* is unloaded. Like for :mfcmd:`setenv` | |||
modulefile command, changes made to *variable* with :mfcmd:`pushenv` are | modulefile command, changes made to *variable* with :mfcmd:`pushenv` are | |||
applied to *variable* in Tcl's ``env`` array to update environment *variable* | applied to *variable* in Tcl's ``env`` array to update environment *variable* | |||
value in current evaluation context. | value in current evaluation context. | |||
When *modulefile* is unloaded, the *value* saved from the :mfcmd:`pushenv` | When *modulefile* is unloaded, the *value* saved from the :mfcmd:`pushenv` | |||
command of this modulefile is removed from saved value stack list. *variable* | command of this modulefile is removed from saved value stack list. *variable* | |||
skipping to change at line 1051 | skipping to change at line 1079 | |||
Abort *load* evaluation of *modulefile* if name specified to designate it is | Abort *load* evaluation of *modulefile* if name specified to designate it is | |||
not the fully qualified one. Module alias or a symbolic version names are | not the fully qualified one. Module alias or a symbolic version names are | |||
considered fully qualified names, exception made for the *default* symbol. | considered fully qualified names, exception made for the *default* symbol. | |||
.. only:: html | .. only:: html | |||
.. versionadded:: 5.1 | .. versionadded:: 5.1 | |||
.. mfcmd:: set-alias alias-name alias-string | .. mfcmd:: set-alias alias-name alias-string | |||
Sets an alias or function with the name *alias-name* in the user's | Sets an alias with the name *alias-name* in the user's environment to the | |||
environment to the string *alias-string*. For some shells, aliases are not | string *alias-string*. For some shells, aliases are not possible and the | |||
possible and the command has no effect. When a *modulefile* is unloaded, | command has no effect (see `Shell support`_ section). When a *modulefile* is | |||
:mfcmd:`set-alias` becomes :mfcmd:`unset-alias`. | unloaded, :mfcmd:`set-alias` becomes :mfcmd:`unset-alias`. | |||
.. mfcmd:: set-function function-name function-string | .. mfcmd:: set-function function-name function-string | |||
Creates a function with the name *function-name* in the user's environment | Creates a function with the name *function-name* in the user's environment | |||
with the function body *function-string*. For some shells, functions are not | with the function body *function-string*. For some shells, functions are not | |||
possible and the command has no effect. When a *modulefile* is unloaded, | possible and the command has no effect (see `Shell support`_ section). When a | |||
:mfcmd:`set-function` becomes :mfcmd:`unset-function`. | *modulefile* is unloaded, :mfcmd:`set-function` becomes | |||
:mfcmd:`unset-function`. | ||||
.. only:: html | .. only:: html | |||
.. versionadded:: 4.2 | .. versionadded:: 4.2 | |||
.. mfcmd:: setenv [--set-if-undef] variable value | .. mfcmd:: setenv [--set-if-undef] variable value | |||
Set environment *variable* to *value*. The :mfcmd:`setenv` command will also | Set environment *variable* to *value*. The :mfcmd:`setenv` command will also | |||
change the process' environment. A reference using Tcl's env associative | change the process' environment. A reference using Tcl's env associative | |||
array will reference changes made with the :mfcmd:`setenv` command. Changes | array will reference changes made with the :mfcmd:`setenv` command. Changes | |||
skipping to change at line 1686 | skipping to change at line 1715 | |||
by loading or unloading additional modulefiles. When the :option:`--no-auto` | by loading or unloading additional modulefiles. When the :option:`--no-auto` | |||
option is set on :command:`module` command when loading or unload modulefile, | option is set on :command:`module` command when loading or unload modulefile, | |||
automated module handling mechanisms are disabled and dependencies have to be | automated module handling mechanisms are disabled and dependencies have to be | |||
solved manually. When dependencies are not satisfied, modulefile fails to load | solved manually. When dependencies are not satisfied, modulefile fails to load | |||
or unload. | or unload. | |||
Adding the ``--not-req`` option when expressing dependencies in modulefile | Adding the ``--not-req`` option when expressing dependencies in modulefile | |||
with the :mfcmd:`module` command will attempt to load or unload the designated | with the :mfcmd:`module` command will attempt to load or unload the designated | |||
modulefile but it will not mark them as pre-requirement or conflict. | modulefile but it will not mark them as pre-requirement or conflict. | |||
Adding the ``--optional`` option on :mfcmd:`prereq`, :mfcmd:`prereq-any`, | ||||
:mfcmd:`prereq-all`, :mfcmd:`depends-on` or :mfcmd:`always-load` modulefile | ||||
commands declares the pre-requirement as optional. If an optional | ||||
pre-requirement is not found loaded or cannot be automatically loaded, the | ||||
dependency expressed is yet considered satisfied. When an optional requirement | ||||
is loaded afterward, the dependent module will get automatically reloaded if | ||||
the :mconfig:`auto_handling` configuration option is enabled. | ||||
By adding the :option:`--force` option to the :command:`module` command when | By adding the :option:`--force` option to the :command:`module` command when | |||
loading or unloading modulefile, the consistency checks are by-passed. This | loading or unloading modulefile, the consistency checks are by-passed. This | |||
option cannot be used when expressing dependencies in modulefiles. If a module | option cannot be used when expressing dependencies in modulefiles. If a module | |||
has been force loaded whereas its requirements are not loaded or whereas a | has been force loaded whereas its requirements are not loaded or whereas a | |||
conflicting module is also loaded, the user environment is said inconsistent. | conflicting module is also loaded, the user environment is said inconsistent. | |||
Note that a pre-requirement should be found in the loaded module list prior | Note that a pre-requirement should be found in the loaded module list prior | |||
its dependent module. User environment is considered inconsistent if | its dependent module. User environment is considered inconsistent if | |||
pre-requirement module is found loaded after dependent module, as the | pre-requirement module is found loaded after dependent module, as the | |||
environment changes may have been done in the wrong priority order. | environment changes may have been done in the wrong priority order. | |||
skipping to change at line 1787 | skipping to change at line 1824 | |||
requirements defined with the :mfcmd:`depends-on` command are not | requirements defined with the :mfcmd:`depends-on` command are not | |||
automatically loaded and an error is raised if none of these requirements are | automatically loaded and an error is raised if none of these requirements are | |||
found loaded. | found loaded. | |||
On :subcmd:`module load-any<load-any>` sub-command and modulefile command, a | On :subcmd:`module load-any<load-any>` sub-command and modulefile command, a | |||
modulefile evaluation error is not reported and :subcmd:`module | modulefile evaluation error is not reported and :subcmd:`module | |||
load-any<load-any>` continues to the next modulefile instead of aborting the | load-any<load-any>` continues to the next modulefile instead of aborting the | |||
whole process. No attempt to load listed modulefiles is made if one of these | whole process. No attempt to load listed modulefiles is made if one of these | |||
modulefiles is found already loaded. | modulefiles is found already loaded. | |||
On :mfcmd:`module try-load<module>` modulefile command, each modulefile | ||||
specified is considered an optional pre-requirement. If it is loaded | ||||
afterward and if the :mconfig:`auto_handling` configuration option is enabled, | ||||
the dependent module will get automatically reloaded. | ||||
.. _Shell support: | ||||
Shell support | ||||
------------- | ||||
The :file:`modulecmd.tcl` program that evaluates *modulefiles* supports a | ||||
variety of shells or languages: *sh* family shells (*sh*, *bash*, *ksh* and | ||||
*zsh*), *csh* family shells (*csh* and *tcsh*), *fish*, *cmd*, *python*, | ||||
*perl*, *ruby*, *tcl*, *cmake*, *r*, and *lisp*. | ||||
Modulefiles produce environment changes when evaluated, like defining an | ||||
environment variable. The :file:`modulecmd.tcl` program outputs the | ||||
corresponding code for the selected "shell". Thereafter this code is evaluated | ||||
by the :command:`module` alias or function to update the current environment. | ||||
Depending on the "shell" kind, not all the environment changes that can be | ||||
defined in modulefiles are supported. The following table summarizes the | ||||
changes that are supported by the shells supported by :file:`modulecmd.tcl`. | ||||
+--------+-----------------------+----------------------+----------------------- | ||||
--+---------------------+----------------+---------------------+ | ||||
| | Environment variables | Shell alias | Shell functions | ||||
| Command completion | :mfcmd:`chdir` | :mfcmd:`x-resource` | | ||||
| | (:mfcmd:`setenv`, | (:mfcmd:`set-alias`, | (:mfcmd:`set-function` | ||||
, | (:mfcmd:`complete`, | | | | ||||
| | :mfcmd:`unsetenv`, | :mfcmd:`unset-alias`)| :mfcmd:`unset-function | ||||
`)| :mfcmd:`uncomplete`)| | | | ||||
| | :mfcmd:`pushenv`, | | | ||||
| | | | | ||||
| | :mfcmd:`append-path`, | | | ||||
| | | | | ||||
| | :mfcmd:`prepend-path`,| | | ||||
| | | | | ||||
| | :mfcmd:`remove-path`) | | | ||||
| | | | | ||||
+--------+-----------------------+----------------------+----------------------- | ||||
--+---------------------+----------------+---------------------+ | ||||
| sh | ⦁ | ⦁ | ⦁ | ||||
| | ⦁ | ⦁ | | ||||
+--------+-----------------------+----------------------+----------------------- | ||||
--+---------------------+----------------+---------------------+ | ||||
| bash | ⦁ | ⦁ | ⦁ | ||||
| ⦁ | ⦁ | ⦁ | | ||||
+--------+-----------------------+----------------------+----------------------- | ||||
--+---------------------+----------------+---------------------+ | ||||
| ksh | ⦁ | ⦁ | ⦁ | ||||
| | ⦁ | ⦁ | | ||||
+--------+-----------------------+----------------------+----------------------- | ||||
--+---------------------+----------------+---------------------+ | ||||
| zsh | ⦁ | ⦁ | ⦁ | ||||
| | ⦁ | ⦁ | | ||||
+--------+-----------------------+----------------------+----------------------- | ||||
--+---------------------+----------------+---------------------+ | ||||
| csh | ⦁ | ⦁ | | ||||
| | ⦁ | ⦁ | | ||||
+--------+-----------------------+----------------------+----------------------- | ||||
--+---------------------+----------------+---------------------+ | ||||
| tcsh | ⦁ | ⦁ | | ||||
| ⦁ | ⦁ | ⦁ | | ||||
+--------+-----------------------+----------------------+----------------------- | ||||
--+---------------------+----------------+---------------------+ | ||||
| fish | ⦁ | ⦁ | ⦁ | ||||
| ⦁ | ⦁ | ⦁ | | ||||
+--------+-----------------------+----------------------+----------------------- | ||||
--+---------------------+----------------+---------------------+ | ||||
| cmd | ⦁ | ⦁ | | ||||
| | ⦁ | | | ||||
+--------+-----------------------+----------------------+----------------------- | ||||
--+---------------------+----------------+---------------------+ | ||||
| python | ⦁ | | | ||||
| | ⦁ | ⦁ | | ||||
+--------+-----------------------+----------------------+----------------------- | ||||
--+---------------------+----------------+---------------------+ | ||||
| perl | ⦁ | | | ||||
| | ⦁ | ⦁ | | ||||
+--------+-----------------------+----------------------+----------------------- | ||||
--+---------------------+----------------+---------------------+ | ||||
| ruby | ⦁ | | | ||||
| | ⦁ | ⦁ | | ||||
+--------+-----------------------+----------------------+----------------------- | ||||
--+---------------------+----------------+---------------------+ | ||||
| tcl | ⦁ | | | ||||
| | ⦁ | ⦁ | | ||||
+--------+-----------------------+----------------------+----------------------- | ||||
--+---------------------+----------------+---------------------+ | ||||
| cmake | ⦁ | | | ||||
| | | ⦁ | | ||||
+--------+-----------------------+----------------------+----------------------- | ||||
--+---------------------+----------------+---------------------+ | ||||
| r | ⦁ | | | ||||
| | ⦁ | ⦁ | | ||||
+--------+-----------------------+----------------------+----------------------- | ||||
--+---------------------+----------------+---------------------+ | ||||
| lisp | ⦁ | | | ||||
| | ⦁ | ⦁ | | ||||
+--------+-----------------------+----------------------+----------------------- | ||||
--+---------------------+----------------+---------------------+ | ||||
The :mfcmd:`source-sh` command evaluates a shell script and produces the | ||||
modulefile commands corresponding to the environment changes made by this | ||||
script. :mfcmd:`source-sh` is able to evaluate *sh*, *bash*, *ksh*, *zsh*, | ||||
*csh*, *tcsh* and *fish* shell scripts. :mfcmd:`source-sh` produces | ||||
environment changes corresponding to the kinds listed in the above table. | ||||
Based on the evaluated script, refer to the above table to know the | ||||
environment changes that will be rendered for the shell specified to | ||||
:file:`modulecmd.tcl` program. | ||||
ENVIRONMENT | ENVIRONMENT | |||
----------- | ----------- | |||
See the :ref:`ENVIRONMENT<module ENVIRONMENT>` section in the | See the :ref:`ENVIRONMENT<module ENVIRONMENT>` section in the | |||
:ref:`module(1)` man page. | :ref:`module(1)` man page. | |||
SEE ALSO | SEE ALSO | |||
-------- | -------- | |||
:ref:`module(1)`, :ref:`ml(1)`, :manpage:`Tcl(n)`, :manpage:`TclX(n)`, | :ref:`module(1)`, :ref:`ml(1)`, :manpage:`Tcl(n)`, :manpage:`TclX(n)`, | |||
End of changes. 19 change blocks. | ||||
17 lines changed or deleted | 166 lines changed or added |