diff options
Diffstat (limited to 'lib/spack/docs/module_file_support.rst')
-rw-r--r-- | lib/spack/docs/module_file_support.rst | 99 |
1 files changed, 50 insertions, 49 deletions
diff --git a/lib/spack/docs/module_file_support.rst b/lib/spack/docs/module_file_support.rst index 6b874fbe97..37dd03547f 100644 --- a/lib/spack/docs/module_file_support.rst +++ b/lib/spack/docs/module_file_support.rst @@ -1,3 +1,8 @@ +.. Copyright 2013-2018 Lawrence Livermore National Security, LLC and other + Spack Project Developers. See the top-level COPYRIGHT file for details. + + SPDX-License-Identifier: (Apache-2.0 OR MIT) + .. _modules: ======= @@ -113,8 +118,10 @@ Modules Dotkit ========================= ========================== And you can use the same shortened names you use everywhere else in -Spack. For example, this will add the ``mpich`` package built with -``gcc`` to your path: +Spack. + +For example, if you are using dotkit, this will add the ``mpich`` +package built with ``gcc`` to your path: .. code-block:: console @@ -122,16 +129,16 @@ Spack. For example, this will add the ``mpich`` package built with # ... wait for install ... - $ spack use mpich %gcc@4.4.7 + $ spack use mpich %gcc@4.4.7 # dotkit Prepending: mpich@3.0.4%gcc@4.4.7 (ok) $ which mpicc ~/spack/opt/linux-debian7-x86_64/gcc@4.4.7/mpich@3.0.4/bin/mpicc -Or, similarly with modules, you could type: +Or, similarly if you are using modules, you could type: .. code-block:: console - $ spack load mpich %gcc@4.4.7 + $ spack load mpich %gcc@4.4.7 # modules These commands will add appropriate directories to your ``PATH``, ``MANPATH``, ``CPATH``, and ``LD_LIBRARY_PATH``. When you no longer @@ -178,9 +185,9 @@ To identify just the one built with the Intel compiler. .. _cmd-spack-module-loads: -^^^^^^^^^^^^^^^^^^^^^^ -``spack module loads`` -^^^^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^^^^^^ +``spack module tcl loads`` +^^^^^^^^^^^^^^^^^^^^^^^^^^ In some cases, it is desirable to load not just a module, but also all the modules it depends on. This is not required for most modules @@ -193,21 +200,13 @@ Scripts to load modules recursively may be made with the command: .. code-block:: console - $ spack module loads --dependencies <spec> + $ spack module tcl loads --dependencies <spec> An equivalent alternative using `process substitution <http://tldp.org/LDP/abs/html/process-sub.html>`_ is: .. code-block :: console - $ source <( spack module loads --dependencies <spec> ) - -.. warning:: - - The ``spack load`` command does not currently accept the - ``--dependencies`` flag. Use ``spack module loads`` instead, for - now. - -.. See #1662 + $ source <( spack module tcl loads --dependencies <spec> ) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -217,12 +216,12 @@ Module Commands for Shell Scripts Although Spack is flexible, the ``module`` command is much faster. This could become an issue when emitting a series of ``spack load`` commands inside a shell script. By adding the ``--shell`` flag, -``spack module find`` may also be used to generate code that can be +``spack module tcl find`` may also be used to generate code that can be cut-and-pasted into a shell script. For example: .. code-block:: console - $ spack module loads --dependencies py-numpy git + $ spack module tcl loads --dependencies py-numpy git # bzip2@1.0.6%gcc@4.9.3=linux-x86_64 module load bzip2-1.0.6-gcc-4.9.3-ktnrhkrmbbtlvnagfatrarzjojmkvzsx # ncurses@6.0%gcc@4.9.3=linux-x86_64 @@ -262,9 +261,9 @@ Module Prefixes ^^^^^^^^^^^^^^^ On some systems, modules are automatically prefixed with a certain -string; ``spack module loads`` needs to know about that prefix when it +string; ``spack module tcl loads`` needs to know about that prefix when it issues ``module load`` commands. Add the ``--prefix`` option to your -``spack module loads`` commands if this is necessary. +``spack module tcl loads`` commands if this is necessary. For example, consider the following on one system: @@ -273,11 +272,11 @@ For example, consider the following on one system: $ module avail linux-SuSE11-x86_64/antlr-2.7.7-gcc-5.3.0-bdpl46y - $ spack module loads antlr # WRONG! + $ spack module tcl loads antlr # WRONG! # 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 - $ spack module loads --prefix linux-SuSE11-x86_64/ antlr + $ spack module 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 module load linux-SuSE11-x86_64/antlr-2.7.7-gcc-5.3.0-bdpl46y @@ -290,15 +289,15 @@ installation of a package. The table below summarizes the essential information associated with the different file formats that can be generated by Spack: - +-----------------------------+--------------------+-------------------------------+----------------------------------+----------------------+ - | | **Hook name** | **Default root directory** | **Default template file** | **Compatible tools** | - +=============================+====================+===============================+==================================+======================+ - | **Dotkit** | ``dotkit`` | share/spack/dotkit | templates/modules/modulefile.dk | DotKit | - +-----------------------------+--------------------+-------------------------------+----------------------------------+----------------------+ - | **TCL - Non-Hierarchical** | ``tcl`` | share/spack/modules | templates/modules/modulefile.tcl | Env. Modules/LMod | - +-----------------------------+--------------------+-------------------------------+----------------------------------+----------------------+ - | **Lua - Hierarchical** | ``lmod`` | share/spack/lmod | templates/modules/modulefile.lua | LMod | - +-----------------------------+--------------------+-------------------------------+----------------------------------+----------------------+ + +-----------------------------+--------------------+-------------------------------+----------------------------------------------+----------------------+ + | | **Hook name** | **Default root directory** | **Default template file** | **Compatible tools** | + +=============================+====================+===============================+==============================================+======================+ + | **Dotkit** | ``dotkit`` | share/spack/dotkit | share/spack/templates/modules/modulefile.dk | DotKit | + +-----------------------------+--------------------+-------------------------------+----------------------------------------------+----------------------+ + | **TCL - Non-Hierarchical** | ``tcl`` | share/spack/modules | share/spack/templates/modules/modulefile.tcl | Env. Modules/LMod | + +-----------------------------+--------------------+-------------------------------+----------------------------------------------+----------------------+ + | **Lua - Hierarchical** | ``lmod`` | share/spack/lmod | share/spack/templates/modules/modulefile.lua | LMod | + +-----------------------------+--------------------+-------------------------------+----------------------------------------------+----------------------+ Spack ships with sensible defaults for the generation of module files, but @@ -485,6 +484,9 @@ you will prevent the generation of module files for any package that is compiled with ``gcc@4.4.7``, with the only exception of any ``gcc`` or any ``llvm`` installation. + +.. _modules-naming-scheme: + """"""""""""""""""""""""""" Customize the naming scheme """"""""""""""""""""""""""" @@ -629,39 +631,38 @@ The allowed values for the ``autoload`` statement are either ``none``, Maintaining Module Files ------------------------ -Spack not only provides great flexibility in the generation of module files -and in the customization of both their layout and content, but also ships with -a tool to ease the burden of their maintenance in production environments. -This tool is the ``spack module`` command: +Each type of module file has a command with the same name associated +with it. The actions these commands permit are usually associated +with the maintenance of a production environment. Here's, for instance, +a sample of the features of the ``spack module tcl`` command: -.. command-output:: spack module --help +.. command-output:: spack module tcl --help .. _cmd-spack-module-refresh: -^^^^^^^^^^^^^^^^^^^^^^^^ -``spack module refresh`` -^^^^^^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^^^^^^ +Refresh the set of modules +^^^^^^^^^^^^^^^^^^^^^^^^^^ -The command that regenerates module files to update their content or -their layout is ``module refresh``: +The subcommand that regenerates module files to update their content or +their layout is ``refresh``: -.. command-output:: spack module refresh --help +.. command-output:: spack module tcl refresh --help A set of packages can be selected using anonymous specs for the optional -``constraint`` positional argument. The argument ``--module-type`` identifies -the type of module files to refresh. Optionally the entire tree can be deleted +``constraint`` positional argument. Optionally the entire tree can be deleted before regeneration if the change in layout is radical. .. _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 -command is ``module rm``: +subcommand is ``rm``: -.. command-output:: spack module rm --help +.. command-output:: spack module tcl rm --help .. note:: We care about your module files! |