| 1 |
.. _provide: |
| 2 |
|
| 3 |
provide modulefile command |
| 4 |
========================== |
| 5 |
|
| 6 |
This design document describes the :mfcmd:`provide` Tcl command that defines |
| 7 |
one or multiple module aliases targeting currently evaluating module. |
| 8 |
|
| 9 |
Command specification |
| 10 |
--------------------- |
| 11 |
|
| 12 |
The command has following syntax:: |
| 13 |
|
| 14 |
provide modulefile... |
| 15 |
|
| 16 |
Each modulefile argument corresponds to a module alias to define onto current |
| 17 |
modulefile. At least one argument should be provided, an error is raised |
| 18 |
otherwise. Modulefile specification should correspond to a module name and |
| 19 |
version. Variant cannot be specified. Each individual string is interpreted as |
| 20 |
a module name and version. |
| 21 |
|
| 22 |
This command is only available in modulefile evaluation contexts. |
| 23 |
|
| 24 |
``provide`` command is only effective during ``load`` evaluations. It |
| 25 |
corresponds to a *no-operation* on other evaluation modes. |
| 26 |
|
| 27 |
``provide`` only defines aliases, thus ``conflict`` definitions are expected |
| 28 |
to avoid these names to be provided by several loaded modules. |
| 29 |
|
| 30 |
extensions modulefile command |
| 31 |
----------------------------- |
| 32 |
|
| 33 |
The :mfcmd:`extensions` modulefile command introduced by Lmod is now |
| 34 |
implemented as a bare command alias onto :mfcmd:`provide`. |
| 35 |
|
| 36 |
Provided alias |
| 37 |
-------------- |
| 38 |
|
| 39 |
Module alias defined with ``provide`` command are not distinguished from other |
| 40 |
aliases defined with ``family`` or ``module-alias``. These aliases are |
| 41 |
recorded in :envvar:`__MODULES_LMALTNAME` with `al` type like other aliases. |
| 42 |
|
| 43 |
It appears easier for the user to only face one kind of element (alias) rather |
| 44 |
requiring them to learn multiple concepts (family, extensions, alias). All of |
| 45 |
this is just different names applying to a given modulefile. |
| 46 |
|
| 47 |
A new item for output configuration is introduced: ``provided-alias``. It adds |
| 48 |
module aliases information into the generated output and enables the |
| 49 |
evaluation of modulefiles to fetch aliases provided by them (i.e., defined |
| 50 |
within them by ``provide`` or ``family`` modulefile commands). |
| 51 |
``provided-alias`` implies ``alias`` item. |
| 52 |
|
| 53 |
A given provided alias may be defined by several modulefiles. When reported |
| 54 |
first defined target is retained. Which means that first scanned modulefile |
| 55 |
wins. |
| 56 |
|
| 57 |
*FUTURE*: keep all target definitions to be able to report all of them if |
| 58 |
asked. |
| 59 |
|
| 60 |
.. vim:set tabstop=2 shiftwidth=2 expandtab autoindent: |