Switch lmod default all:autoload from none to direct (#28357)
* Switch lmod module all autoload default from none to direct * Fix the docs
This commit is contained in:
parent
612430859e
commit
e72f87ec64
35 changed files with 76 additions and 40 deletions
|
@ -46,7 +46,13 @@ modules:
|
|||
enable:
|
||||
- tcl
|
||||
|
||||
tcl:
|
||||
all:
|
||||
autoload: none
|
||||
|
||||
# Default configurations if lmod is enabled
|
||||
lmod:
|
||||
all:
|
||||
autoload: direct
|
||||
hierarchy:
|
||||
- mpi
|
||||
|
|
|
@ -615,44 +615,39 @@ modifications to either ``CPATH`` or ``LIBRARY_PATH``.
|
|||
Autoload dependencies
|
||||
"""""""""""""""""""""
|
||||
|
||||
In some cases it can be useful to have module files that automatically load
|
||||
their dependencies. This may be the case for Python extensions, if not
|
||||
activated using ``spack activate``:
|
||||
Often it is required for a module to have its (transient) dependencies loaded as well.
|
||||
One example where this is useful is when one package needs to use executables provided
|
||||
by its dependency; when the dependency is autoloaded, the executable will be in the
|
||||
PATH. Similarly for scripting languages such as Python, packages and their dependencies
|
||||
have to be loaded together.
|
||||
|
||||
Autoloading is enabled by default for LMod, as it has great builtin support for through
|
||||
the ``depends_on`` function. For Environment Modules it is disabled by default.
|
||||
|
||||
Autoloading can also be enabled conditionally:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
modules:
|
||||
default:
|
||||
tcl:
|
||||
^python:
|
||||
autoload: 'direct'
|
||||
modules:
|
||||
default:
|
||||
tcl:
|
||||
all:
|
||||
autoload: none
|
||||
^python:
|
||||
autoload: direct
|
||||
|
||||
The configuration file above will produce module files that will
|
||||
load their direct dependencies if the package installed depends on ``python``.
|
||||
The allowed values for the ``autoload`` statement are either ``none``,
|
||||
``direct`` or ``all``. The default is ``none``.
|
||||
|
||||
.. tip::
|
||||
Building external software
|
||||
Setting ``autoload`` to ``direct`` for all packages can be useful
|
||||
when building software outside of a Spack installation that depends on
|
||||
artifacts in that installation. E.g. (adjust ``lmod`` vs ``tcl``
|
||||
as appropriate):
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
modules:
|
||||
default:
|
||||
lmod:
|
||||
all:
|
||||
autoload: 'direct'
|
||||
``direct`` or ``all``.
|
||||
|
||||
.. note::
|
||||
TCL prerequisites
|
||||
In the ``tcl`` section of the configuration file it is possible to use
|
||||
the ``prerequisites`` directive that accepts the same values as
|
||||
``autoload``. It will produce module files that have a ``prereq``
|
||||
statement instead of automatically loading other modules.
|
||||
statement, which can be used to autoload dependencies in some versions
|
||||
of Environment Modules.
|
||||
|
||||
------------------------
|
||||
Maintaining Module Files
|
||||
|
|
|
@ -191,7 +191,7 @@ def merge_config_rules(configuration, spec):
|
|||
# Transform keywords for dependencies or prerequisites into a list of spec
|
||||
|
||||
# Which modulefiles we want to autoload
|
||||
autoload_strategy = spec_configuration.get('autoload', 'none')
|
||||
autoload_strategy = spec_configuration.get('autoload', 'direct')
|
||||
spec_configuration['autoload'] = dependencies(spec, autoload_strategy)
|
||||
|
||||
# Which instead we want to mark as prerequisites
|
||||
|
|
|
@ -8,6 +8,7 @@ lmod:
|
|||
- mpi
|
||||
|
||||
all:
|
||||
autoload: none
|
||||
filter:
|
||||
environment_blacklist:
|
||||
- CMAKE_PREFIX_PATH
|
||||
|
|
|
@ -8,4 +8,4 @@ lmod:
|
|||
verbose: true
|
||||
|
||||
all:
|
||||
autoload: 'all'
|
||||
autoload: all
|
||||
|
|
|
@ -7,4 +7,4 @@ lmod:
|
|||
- mpi
|
||||
|
||||
all:
|
||||
autoload: 'direct'
|
||||
autoload: direct
|
||||
|
|
|
@ -9,4 +9,4 @@ lmod:
|
|||
- callpath
|
||||
|
||||
all:
|
||||
autoload: 'direct'
|
||||
autoload: direct
|
||||
|
|
|
@ -17,4 +17,4 @@ lmod:
|
|||
verbose: false
|
||||
|
||||
all:
|
||||
autoload: 'all'
|
||||
autoload: all
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
enable:
|
||||
- lmod
|
||||
lmod:
|
||||
all:
|
||||
autoload: none
|
||||
core_compilers: []
|
||||
hierarchy:
|
||||
- mpi
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
enable:
|
||||
- lmod
|
||||
lmod:
|
||||
all:
|
||||
autoload: none
|
||||
hierarchy:
|
||||
- mpi
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
enable:
|
||||
- lmod
|
||||
lmod:
|
||||
all:
|
||||
autoload: none
|
||||
core_compilers:
|
||||
- 'clang@3.3'
|
||||
|
|
|
@ -2,5 +2,7 @@ enable:
|
|||
- lmod
|
||||
arch_folder: false
|
||||
lmod:
|
||||
all:
|
||||
autoload: none
|
||||
core_compilers:
|
||||
- 'clang@3.3'
|
|
@ -1,6 +1,8 @@
|
|||
enable:
|
||||
- lmod
|
||||
lmod:
|
||||
all:
|
||||
autoload: none
|
||||
hash_length: 0
|
||||
|
||||
core_compilers:
|
||||
|
|
|
@ -8,4 +8,4 @@ lmod:
|
|||
- openblas
|
||||
|
||||
all:
|
||||
autoload: 'direct'
|
||||
autoload: direct
|
||||
|
|
|
@ -8,3 +8,4 @@ lmod:
|
|||
|
||||
all:
|
||||
template: 'override_from_modules.txt'
|
||||
autoload: none
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
enable:
|
||||
- lmod
|
||||
lmod:
|
||||
all:
|
||||
autoload: none
|
||||
projections:
|
||||
all: '{name}/v{version}'
|
||||
mpileaks: '{name}-mpiprojection'
|
||||
|
|
|
@ -2,5 +2,7 @@ enable:
|
|||
- lmod
|
||||
use_view: default
|
||||
lmod:
|
||||
all:
|
||||
autoload: none
|
||||
core_compilers:
|
||||
- 'clang@3.3'
|
||||
|
|
|
@ -2,6 +2,7 @@ enable:
|
|||
- tcl
|
||||
tcl:
|
||||
all:
|
||||
autoload: none
|
||||
filter:
|
||||
environment_blacklist:
|
||||
- CMAKE_PREFIX_PATH
|
||||
|
|
|
@ -3,4 +3,4 @@ enable:
|
|||
tcl:
|
||||
verbose: true
|
||||
all:
|
||||
autoload: 'all'
|
||||
autoload: all
|
||||
|
|
|
@ -2,4 +2,4 @@ enable:
|
|||
- tcl
|
||||
tcl:
|
||||
all:
|
||||
autoload: 'direct'
|
||||
autoload: direct
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
enable:
|
||||
- tcl
|
||||
tcl:
|
||||
all:
|
||||
autoload: none
|
||||
^mpich2:
|
||||
autoload: 'direct'
|
||||
|
||||
autoload: direct
|
||||
^python:
|
||||
autoload: 'direct'
|
||||
autoload: direct
|
||||
|
|
|
@ -7,4 +7,4 @@ tcl:
|
|||
- callpath
|
||||
- mpi
|
||||
all:
|
||||
autoload: 'direct'
|
||||
autoload: direct
|
||||
|
|
|
@ -3,4 +3,4 @@ enable:
|
|||
tcl:
|
||||
blacklist_implicits: true
|
||||
all:
|
||||
autoload: 'direct'
|
||||
autoload: direct
|
||||
|
|
|
@ -4,6 +4,7 @@ tcl:
|
|||
projections:
|
||||
all: '{name}/{version}-{compiler.name}'
|
||||
all:
|
||||
autoload: none
|
||||
conflict:
|
||||
- '{name}'
|
||||
- 'intel/14.0.1'
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
enable:
|
||||
- tcl
|
||||
tcl:
|
||||
all:
|
||||
autoload: none
|
||||
# {variants} is not allowed in the naming scheme, see #2884
|
||||
projections:
|
||||
all: '{name}/{version}-{compiler.name}-{variants}'
|
||||
|
|
|
@ -2,6 +2,7 @@ enable:
|
|||
- tcl
|
||||
tcl:
|
||||
all:
|
||||
autoload: none
|
||||
filter:
|
||||
environment_blacklist:
|
||||
- CMAKE_PREFIX_PATH
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
enable:
|
||||
- tcl
|
||||
tcl:
|
||||
all:
|
||||
autoload: none
|
||||
naming_scheme: '{name}/{version}-{compiler.name}'
|
||||
|
|
|
@ -2,5 +2,7 @@ enable:
|
|||
- tcl
|
||||
arch_folder: false
|
||||
tcl:
|
||||
all:
|
||||
autoload: none
|
||||
projections:
|
||||
all: ''
|
|
@ -2,6 +2,7 @@ enable:
|
|||
- tcl
|
||||
tcl:
|
||||
all:
|
||||
autoload: none
|
||||
suffixes:
|
||||
'^mpich': mpich
|
||||
mpileaks:
|
||||
|
|
|
@ -2,4 +2,5 @@ enable:
|
|||
- tcl
|
||||
tcl:
|
||||
all:
|
||||
autoload: none
|
||||
template: 'override_from_modules.txt'
|
||||
|
|
|
@ -2,4 +2,5 @@ enable:
|
|||
- tcl
|
||||
tcl:
|
||||
all:
|
||||
prerequisites: 'all'
|
||||
autoload: none
|
||||
prerequisites: all
|
||||
|
|
|
@ -2,4 +2,5 @@ enable:
|
|||
- tcl
|
||||
tcl:
|
||||
all:
|
||||
prerequisites: 'direct'
|
||||
autoload: none
|
||||
prerequisites: direct
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
enable:
|
||||
- tcl
|
||||
tcl:
|
||||
all:
|
||||
autoload: none
|
||||
projections:
|
||||
all: '{name}/{version}-{compiler.name}'
|
||||
mpileaks: '{name}-mpiprojection'
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
enable:
|
||||
- tcl
|
||||
tcl:
|
||||
all:
|
||||
autoload: none
|
||||
mpileaks:
|
||||
suffixes:
|
||||
'+opt': baz
|
||||
|
|
|
@ -4,5 +4,6 @@ tcl:
|
|||
projections:
|
||||
all: '{name}/{version}-{compiler.name}'
|
||||
all:
|
||||
autoload: none
|
||||
conflict:
|
||||
- '{name}/{compiler.name}'
|
||||
|
|
Loading…
Reference in a new issue