Updated references to spack module in the documentation.

This commit is contained in:
Massimiliano Culpo 2018-04-11 22:53:09 +02:00 committed by Todd Gamblin
parent 6ab57571c2
commit e81c0c3e2c
5 changed files with 46 additions and 55 deletions

View file

@ -314,7 +314,7 @@ See the `Argparse documentation <https://docs.python.org/2.7/library/argparse.ht
for more details on how to add arguments. for more details on how to add arguments.
Some commands have a set of subcommands, like ``spack compiler find`` or Some commands have a set of subcommands, like ``spack compiler find`` or
``spack module refresh``. You can add subparsers to your parser to handle ``spack lmod refresh``. You can add subparsers to your parser to handle
this. Check out ``spack edit --command compiler`` for an example of this. this. Check out ``spack edit --command compiler`` for an example of this.
A lot of commands take the same arguments and flags. These arguments should A lot of commands take the same arguments and flags. These arguments should

View file

@ -816,7 +816,7 @@ This problem is related to OpenSSL, and in some cases might be solved
by installing a new version of ``git`` and ``openssl``: by installing a new version of ``git`` and ``openssl``:
#. Run ``spack install git`` #. Run ``spack install git``
#. Add the output of ``spack module loads git`` to your ``.bashrc``. #. Add the output of ``spack tcl loads git`` to your ``.bashrc``.
If this doesn't work, it is also possible to disable checking of SSL If this doesn't work, it is also possible to disable checking of SSL
certificates by using: certificates by using:
@ -861,7 +861,7 @@ or alternately:
.. code-block:: console .. code-block:: console
$ spack module loads curl >>~/.bashrc $ spack tcl loads curl >>~/.bashrc
or if environment modules don't work: or if environment modules don't work:

View file

@ -181,7 +181,7 @@ To identify just the one built with the Intel compiler.
.. _cmd-spack-module-loads: .. _cmd-spack-module-loads:
^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
``spack module loads`` ``spack tcl loads``
^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
In some cases, it is desirable to load not just a module, but also all In some cases, it is desirable to load not just a module, but also all
@ -195,21 +195,13 @@ Scripts to load modules recursively may be made with the command:
.. code-block:: console .. code-block:: console
$ spack module loads --dependencies <spec> $ spack tcl loads --dependencies <spec>
An equivalent alternative using `process substitution <http://tldp.org/LDP/abs/html/process-sub.html>`_ is: An equivalent alternative using `process substitution <http://tldp.org/LDP/abs/html/process-sub.html>`_ is:
.. code-block :: console .. code-block :: console
$ source <( spack module loads --dependencies <spec> ) $ source <( spack tcl loads --dependencies <spec> )
.. warning::
The ``spack load`` command does not currently accept the
``--dependencies`` flag. Use ``spack module loads`` instead, for
now.
.. See #1662
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -219,12 +211,12 @@ Module Commands for Shell Scripts
Although Spack is flexible, the ``module`` command is much faster. Although Spack is flexible, the ``module`` command is much faster.
This could become an issue when emitting a series of ``spack load`` This could become an issue when emitting a series of ``spack load``
commands inside a shell script. By adding the ``--shell`` flag, commands inside a shell script. By adding the ``--shell`` flag,
``spack module find`` may also be used to generate code that can be ``spack tcl find`` may also be used to generate code that can be
cut-and-pasted into a shell script. For example: cut-and-pasted into a shell script. For example:
.. code-block:: console .. code-block:: console
$ spack module loads --dependencies py-numpy git $ spack tcl loads --dependencies py-numpy git
# bzip2@1.0.6%gcc@4.9.3=linux-x86_64 # bzip2@1.0.6%gcc@4.9.3=linux-x86_64
module load bzip2-1.0.6-gcc-4.9.3-ktnrhkrmbbtlvnagfatrarzjojmkvzsx module load bzip2-1.0.6-gcc-4.9.3-ktnrhkrmbbtlvnagfatrarzjojmkvzsx
# ncurses@6.0%gcc@4.9.3=linux-x86_64 # ncurses@6.0%gcc@4.9.3=linux-x86_64
@ -264,9 +256,9 @@ Module Prefixes
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
On some systems, modules are automatically prefixed with a certain On some systems, modules are automatically prefixed with a certain
string; ``spack module loads`` needs to know about that prefix when it string; ``spack tcl loads`` needs to know about that prefix when it
issues ``module load`` commands. Add the ``--prefix`` option to your issues ``module load`` commands. Add the ``--prefix`` option to your
``spack module loads`` commands if this is necessary. ``spack tcl loads`` commands if this is necessary.
For example, consider the following on one system: For example, consider the following on one system:
@ -275,11 +267,11 @@ For example, consider the following on one system:
$ module avail $ module avail
linux-SuSE11-x86_64/antlr-2.7.7-gcc-5.3.0-bdpl46y linux-SuSE11-x86_64/antlr-2.7.7-gcc-5.3.0-bdpl46y
$ spack module loads antlr # WRONG! $ spack tcl loads antlr # WRONG!
# antlr@2.7.7%gcc@5.3.0~csharp+cxx~java~python arch=linux-SuSE11-x86_64 # antlr@2.7.7%gcc@5.3.0~csharp+cxx~java~python arch=linux-SuSE11-x86_64
module load antlr-2.7.7-gcc-5.3.0-bdpl46y module load antlr-2.7.7-gcc-5.3.0-bdpl46y
$ spack module loads --prefix linux-SuSE11-x86_64/ antlr $ spack tcl loads --prefix linux-SuSE11-x86_64/ antlr
# antlr@2.7.7%gcc@5.3.0~csharp+cxx~java~python arch=linux-SuSE11-x86_64 # antlr@2.7.7%gcc@5.3.0~csharp+cxx~java~python arch=linux-SuSE11-x86_64
module load linux-SuSE11-x86_64/antlr-2.7.7-gcc-5.3.0-bdpl46y module load linux-SuSE11-x86_64/antlr-2.7.7-gcc-5.3.0-bdpl46y
@ -631,37 +623,36 @@ The allowed values for the ``autoload`` statement are either ``none``,
Maintaining Module Files Maintaining Module Files
------------------------ ------------------------
Spack not only provides great flexibility in the generation of module files Each type of module file has a command with the same name associated
and in the customization of both their layout and content, but also ships with with it. The actions these commands permit are usually associated
a tool to ease the burden of their maintenance in production environments. with the maintenance of a production environment. Here's, for instance,
This tool is the ``spack module`` command: a sample of the features of the ``spack tcl`` command:
.. command-output:: spack tcl --help .. command-output:: spack tcl --help
.. _cmd-spack-module-refresh: .. _cmd-spack-module-refresh:
^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
``spack module refresh`` Refresh the set of modules
^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
The command that regenerates module files to update their content or The subcommand that regenerates module files to update their content or
their layout is ``module refresh``: their layout is ``refresh``:
.. command-output:: spack tcl refresh --help .. command-output:: spack tcl refresh --help
A set of packages can be selected using anonymous specs for the optional A set of packages can be selected using anonymous specs for the optional
``constraint`` positional argument. The argument ``--module-type`` identifies ``constraint`` positional argument. Optionally the entire tree can be deleted
the type of module files to refresh. Optionally the entire tree can be deleted
before regeneration if the change in layout is radical. before regeneration if the change in layout is radical.
.. _cmd-spack-module-rm: .. _cmd-spack-module-rm:
^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^
``spack module rm`` Delete module files
^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^
If instead what you need is just to delete a few module files, then the right If instead what you need is just to delete a few module files, then the right
command is ``module rm``: subcommand is ``rm``:
.. command-output:: spack tcl rm --help .. command-output:: spack tcl rm --help

View file

@ -422,7 +422,7 @@ Next you should regenerate all the module files:
.. code-block:: console .. code-block:: console
root@module-file-tutorial:/# spack module refresh --module-type tcl root@module-file-tutorial:/# spack tcl refresh
==> You are about to regenerate tcl module files for: ==> You are about to regenerate tcl module files for:
-- linux-ubuntu16.04-x86_64 / gcc@5.4.0 ------------------------- -- linux-ubuntu16.04-x86_64 / gcc@5.4.0 -------------------------
@ -484,7 +484,7 @@ and regenerate the module files:
.. code-block:: console .. code-block:: console
root@module-file-tutorial:/# spack module refresh --module-type tcl --delete-tree root@module-file-tutorial:/# spack tcl refresh --delete-tree
==> You are about to regenerate tcl module files for: ==> You are about to regenerate tcl module files for:
-- linux-ubuntu16.04-x86_64 / gcc@5.4.0 ------------------------- -- linux-ubuntu16.04-x86_64 / gcc@5.4.0 -------------------------
@ -538,7 +538,7 @@ exceptions to the blacklist rules you can use ``whitelist``:
.. code-block:: console .. code-block:: console
root@module-file-tutorial:/# spack module refresh --module-type tcl -y root@module-file-tutorial:/# spack tcl refresh -y
==> Regenerating tcl module files ==> Regenerating tcl module files
@ -584,7 +584,7 @@ If you try to regenerate the module files now you will get an error:
.. code-block:: console .. code-block:: console
root@module-file-tutorial:/# spack module refresh --module-type tcl --delete-tree -y root@module-file-tutorial:/# spack tcl refresh --delete-tree -y
==> Error: Name clashes detected in module files: ==> Error: Name clashes detected in module files:
file: /usr/local/share/spack/modules/linux-ubuntu16.04-x86_64/netlib-scalapack-2.0.2-gcc-7.2.0 file: /usr/local/share/spack/modules/linux-ubuntu16.04-x86_64/netlib-scalapack-2.0.2-gcc-7.2.0
@ -631,7 +631,7 @@ Regenerating module files now we obtain:
.. code-block:: console .. code-block:: console
root@module-file-tutorial:/# spack module refresh --module-type tcl --delete-tree -y root@module-file-tutorial:/# spack tcl refresh --delete-tree -y
==> Regenerating tcl module files ==> Regenerating tcl module files
root@module-file-tutorial:/# module avail root@module-file-tutorial:/# module avail
@ -677,7 +677,7 @@ The final result should look like:
.. code-block:: console .. code-block:: console
root@module-file-tutorial:/# spack module refresh --module-type tcl --delete-tree -y root@module-file-tutorial:/# spack tcl refresh --delete-tree -y
==> Regenerating tcl module files ==> Regenerating tcl module files
root@module-file-tutorial:/# module avail root@module-file-tutorial:/# module avail
@ -748,7 +748,7 @@ Regenerating the module files results in something like:
.. code-block:: console .. code-block:: console
:emphasize-lines: 15 :emphasize-lines: 15
root@module-file-tutorial:/# spack module refresh -y --module-type tcl root@module-file-tutorial:/# spack tcl refresh -y
==> Regenerating tcl module files ==> Regenerating tcl module files
root@module-file-tutorial:/# module show gcc root@module-file-tutorial:/# module show gcc
@ -819,10 +819,10 @@ This time we will be more selective and regenerate only the ``gcc`` and
.. code-block:: console .. code-block:: console
root@module-file-tutorial:/# spack module refresh -y --module-type tcl gcc root@module-file-tutorial:/# spack tcl refresh -y gcc
==> Regenerating tcl module files ==> Regenerating tcl module files
root@module-file-tutorial:/# spack module refresh -y --module-type tcl openmpi root@module-file-tutorial:/# spack tcl refresh -y openmpi
==> Regenerating tcl module files ==> Regenerating tcl module files
root@module-file-tutorial:/# module show gcc root@module-file-tutorial:/# module show gcc
@ -926,7 +926,7 @@ and regenerating the module files for every package that depends on ``python``:
.. code-block:: console .. code-block:: console
root@module-file-tutorial:/# spack module refresh -y --module-type tcl ^python root@module-file-tutorial:/# spack tcl refresh -y ^python
==> Regenerating tcl module files ==> Regenerating tcl module files
Now the ``py-scipy`` module will be: Now the ``py-scipy`` module will be:
@ -1102,7 +1102,7 @@ If we now regenerate the module files:
.. code-block:: console .. code-block:: console
root@module-file-tutorial:/# spack module refresh --module-type lmod --delete-tree -y root@module-file-tutorial:/# spack lmod refresh --delete-tree -y
==> Regenerating lmod module files ==> Regenerating lmod module files
and update ``MODULEPATH`` to point to the ``Core``: and update ``MODULEPATH`` to point to the ``Core``:
@ -1293,7 +1293,7 @@ After module files have been regenerated as usual:
root@module-file-tutorial:/# module purge root@module-file-tutorial:/# module purge
root@module-file-tutorial:/# spack module refresh --delete-tree -y -m lmod root@module-file-tutorial:/# spack lmod refresh --delete-tree -y
==> Regenerating lmod module files ==> Regenerating lmod module files
we can see that now we have additional components in the hierarchy: we can see that now we have additional components in the hierarchy:

View file

@ -276,11 +276,11 @@ have some drawbacks:
2. The ``spack spec`` and ``spack install`` commands use a 2. The ``spack spec`` and ``spack install`` commands use a
sophisticated concretization algorithm that chooses the "best" sophisticated concretization algorithm that chooses the "best"
among several options, taking into account ``packages.yaml`` file. among several options, taking into account ``packages.yaml`` file.
The ``spack load`` and ``spack module loads`` commands, on the The ``spack load`` and ``spack tcl loads`` commands, on the
other hand, are not very smart: if the user-supplied spec matches other hand, are not very smart: if the user-supplied spec matches
more than one installed package, then ``spack module loads`` will more than one installed package, then ``spack tcl loads`` will
fail. This may change in the future. For now, the workaround is to fail. This may change in the future. For now, the workaround is to
be more specific on any ``spack module loads`` lines that fail. be more specific on any ``spack tcl loads`` lines that fail.
"""""""""""""""""""""" """"""""""""""""""""""
@ -290,7 +290,7 @@ Generated Load Scripts
Another problem with using `spack load` is, it is slow; a typical user Another problem with using `spack load` is, it is slow; a typical user
environment could take several seconds to load, and would not be environment could take several seconds to load, and would not be
appropriate to put into ``.bashrc`` directly. It is preferable to use appropriate to put into ``.bashrc`` directly. It is preferable to use
a series of ``spack module loads`` commands to pre-compute which a series of ``spack tcl loads`` commands to pre-compute which
modules to load. These can be put in a script that is run whenever modules to load. These can be put in a script that is run whenever
installed Spack packages change. For example: installed Spack packages change. For example:
@ -301,7 +301,7 @@ installed Spack packages change. For example:
# Generate module load commands in ~/env/spackenv # Generate module load commands in ~/env/spackenv
cat <<EOF | /bin/sh >$HOME/env/spackenv cat <<EOF | /bin/sh >$HOME/env/spackenv
FIND='spack module loads --prefix linux-SuSE11-x86_64/' FIND='spack tcl loads --prefix linux-SuSE11-x86_64/'
\$FIND modele-utils \$FIND modele-utils
\$FIND emacs \$FIND emacs
@ -346,14 +346,14 @@ Users may now put ``source ~/env/spackenv`` into ``.bashrc``.
Some module systems put a prefix on the names of modules created Some module systems put a prefix on the names of modules created
by Spack. For example, that prefix is ``linux-SuSE11-x86_64/`` in by Spack. For example, that prefix is ``linux-SuSE11-x86_64/`` in
the above case. If a prefix is not needed, you may omit the the above case. If a prefix is not needed, you may omit the
``--prefix`` flag from ``spack module loads``. ``--prefix`` flag from ``spack tcl loads``.
""""""""""""""""""""""" """""""""""""""""""""""
Transitive Dependencies Transitive Dependencies
""""""""""""""""""""""" """""""""""""""""""""""
In the script above, each ``spack module loads`` command generates a In the script above, each ``spack tcl loads`` command generates a
*single* ``module load`` line. Transitive dependencies do not usually *single* ``module load`` line. Transitive dependencies do not usually
need to be loaded, only modules the user needs in ``$PATH``. This is need to be loaded, only modules the user needs in ``$PATH``. This is
because Spack builds binaries with RPATH. Spack's RPATH policy has because Spack builds binaries with RPATH. Spack's RPATH policy has
@ -394,13 +394,13 @@ Unfortunately, Spack's RPATH support does not work in all case. For example:
In cases where RPATH support doesn't make things "just work," it can In cases where RPATH support doesn't make things "just work," it can
be necessary to load a module's dependencies as well as the module be necessary to load a module's dependencies as well as the module
itself. This is done by adding the ``--dependencies`` flag to the itself. This is done by adding the ``--dependencies`` flag to the
``spack module loads`` command. For example, the following line, ``spack tcl loads`` command. For example, the following line,
added to the script above, would be used to load SciPy, along with added to the script above, would be used to load SciPy, along with
Numpy, core Python, BLAS/LAPACK and anything else needed: Numpy, core Python, BLAS/LAPACK and anything else needed:
.. code-block:: sh .. code-block:: sh
spack module loads --dependencies py-scipy spack tcl loads --dependencies py-scipy
^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
Dummy Packages Dummy Packages
@ -630,7 +630,7 @@ environments:
and extension packages. and extension packages.
* Views and activated extensions maintain state that is semantically * Views and activated extensions maintain state that is semantically
equivalent to the information in a ``spack module loads`` script. equivalent to the information in a ``spack tcl loads`` script.
Administrators might find things easier to maintain without the Administrators might find things easier to maintain without the
added "heavyweight" state of a view. added "heavyweight" state of a view.