diff options
Diffstat (limited to 'lib/spack/docs/module_file_support.rst')
-rw-r--r-- | lib/spack/docs/module_file_support.rst | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/lib/spack/docs/module_file_support.rst b/lib/spack/docs/module_file_support.rst index ba964c2d61..aa7eb57653 100644 --- a/lib/spack/docs/module_file_support.rst +++ b/lib/spack/docs/module_file_support.rst @@ -119,7 +119,7 @@ For example this will add the ``mpich`` package built with ``gcc`` to your path: # ... wait for install ... - $ spack load mpich %gcc@4.4.7 # modules + $ spack load mpich %gcc@4.4.7 $ which mpicc ~/spack/opt/linux-debian7-x86_64/gcc@4.4.7/mpich@3.0.4/bin/mpicc @@ -129,27 +129,29 @@ want to use a package, you can type unload or unuse similarly: .. code-block:: console - $ spack unload mpich %gcc@4.4.7 # modules + $ spack unload mpich %gcc@4.4.7 .. note:: - The ``load`` and ``unload`` subcommands are - only available if you have enabled Spack's shell support *and* you - have environment-modules installed on your machine. + The ``load`` and ``unload`` subcommands are only available if you + have enabled Spack's shell support. These command DO NOT use the + underlying Spack-generated module files. -^^^^^^^^^^^^^^^^^^^^^^ -Ambiguous module names -^^^^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^ +Ambiguous specs +^^^^^^^^^^^^^^^ -If a spec used with load/unload or use/unuse is ambiguous (i.e. more -than one installed package matches it), then Spack will warn you: +If a spec used with load/unload or is ambiguous (i.e. more than one +installed package matches it), then Spack will warn you: .. code-block:: console $ spack load libelf - ==> Error: Multiple matches for spec libelf. Choose one: - libelf@0.8.13%gcc@4.4.7 arch=linux-debian7-x86_64 - libelf@0.8.13%intel@15.0.0 arch=linux-debian7-x86_64 + ==> Error: libelf matches multiple packages. + Matching packages: + libelf@0.8.13%gcc@4.4.7 arch=linux-debian7-x86_64 + libelf@0.8.13%intel@15.0.0 arch=linux-debian7-x86_64 + Use a more specific spec You can either type the ``spack load`` command again with a fully qualified argument, or you can add just enough extra constraints to @@ -171,8 +173,15 @@ To identify just the one built with the Intel compiler. ``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 +In some cases, it is desirable to use a Spack-generated module, rather +than relying on Spack's built-in user-environment modification +capabilities. To translate a spec into a module name, use ``spack +module tcl loads`` or ``spack module lmod loads`` depending on the +module system desired. + + +To load not just a module, but also all the modules it depends on, use +the ``--dependencies`` option. This is not required for most modules because Spack builds binaries with RPATH support. However, not all packages use RPATH to find their dependencies: this can be true in particular for Python extensions, which are currently *not* built with |