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:
|
enable:
|
||||||
- tcl
|
- tcl
|
||||||
|
|
||||||
|
tcl:
|
||||||
|
all:
|
||||||
|
autoload: none
|
||||||
|
|
||||||
# Default configurations if lmod is enabled
|
# Default configurations if lmod is enabled
|
||||||
lmod:
|
lmod:
|
||||||
|
all:
|
||||||
|
autoload: direct
|
||||||
hierarchy:
|
hierarchy:
|
||||||
- mpi
|
- mpi
|
||||||
|
|
|
@ -615,44 +615,39 @@ modifications to either ``CPATH`` or ``LIBRARY_PATH``.
|
||||||
Autoload dependencies
|
Autoload dependencies
|
||||||
"""""""""""""""""""""
|
"""""""""""""""""""""
|
||||||
|
|
||||||
In some cases it can be useful to have module files that automatically load
|
Often it is required for a module to have its (transient) dependencies loaded as well.
|
||||||
their dependencies. This may be the case for Python extensions, if not
|
One example where this is useful is when one package needs to use executables provided
|
||||||
activated using ``spack activate``:
|
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
|
.. code-block:: yaml
|
||||||
|
|
||||||
modules:
|
modules:
|
||||||
default:
|
default:
|
||||||
tcl:
|
tcl:
|
||||||
^python:
|
all:
|
||||||
autoload: 'direct'
|
autoload: none
|
||||||
|
^python:
|
||||||
|
autoload: direct
|
||||||
|
|
||||||
The configuration file above will produce module files that will
|
The configuration file above will produce module files that will
|
||||||
load their direct dependencies if the package installed depends on ``python``.
|
load their direct dependencies if the package installed depends on ``python``.
|
||||||
The allowed values for the ``autoload`` statement are either ``none``,
|
The allowed values for the ``autoload`` statement are either ``none``,
|
||||||
``direct`` or ``all``. The default is ``none``.
|
``direct`` or ``all``.
|
||||||
|
|
||||||
.. 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'
|
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
TCL prerequisites
|
TCL prerequisites
|
||||||
In the ``tcl`` section of the configuration file it is possible to use
|
In the ``tcl`` section of the configuration file it is possible to use
|
||||||
the ``prerequisites`` directive that accepts the same values as
|
the ``prerequisites`` directive that accepts the same values as
|
||||||
``autoload``. It will produce module files that have a ``prereq``
|
``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
|
Maintaining Module Files
|
||||||
|
|
|
@ -191,7 +191,7 @@ def merge_config_rules(configuration, spec):
|
||||||
# Transform keywords for dependencies or prerequisites into a list of spec
|
# Transform keywords for dependencies or prerequisites into a list of spec
|
||||||
|
|
||||||
# Which modulefiles we want to autoload
|
# 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)
|
spec_configuration['autoload'] = dependencies(spec, autoload_strategy)
|
||||||
|
|
||||||
# Which instead we want to mark as prerequisites
|
# Which instead we want to mark as prerequisites
|
||||||
|
|
|
@ -8,6 +8,7 @@ lmod:
|
||||||
- mpi
|
- mpi
|
||||||
|
|
||||||
all:
|
all:
|
||||||
|
autoload: none
|
||||||
filter:
|
filter:
|
||||||
environment_blacklist:
|
environment_blacklist:
|
||||||
- CMAKE_PREFIX_PATH
|
- CMAKE_PREFIX_PATH
|
||||||
|
|
|
@ -8,4 +8,4 @@ lmod:
|
||||||
verbose: true
|
verbose: true
|
||||||
|
|
||||||
all:
|
all:
|
||||||
autoload: 'all'
|
autoload: all
|
||||||
|
|
|
@ -7,4 +7,4 @@ lmod:
|
||||||
- mpi
|
- mpi
|
||||||
|
|
||||||
all:
|
all:
|
||||||
autoload: 'direct'
|
autoload: direct
|
||||||
|
|
|
@ -9,4 +9,4 @@ lmod:
|
||||||
- callpath
|
- callpath
|
||||||
|
|
||||||
all:
|
all:
|
||||||
autoload: 'direct'
|
autoload: direct
|
||||||
|
|
|
@ -17,4 +17,4 @@ lmod:
|
||||||
verbose: false
|
verbose: false
|
||||||
|
|
||||||
all:
|
all:
|
||||||
autoload: 'all'
|
autoload: all
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
enable:
|
enable:
|
||||||
- lmod
|
- lmod
|
||||||
lmod:
|
lmod:
|
||||||
|
all:
|
||||||
|
autoload: none
|
||||||
core_compilers: []
|
core_compilers: []
|
||||||
hierarchy:
|
hierarchy:
|
||||||
- mpi
|
- mpi
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
enable:
|
enable:
|
||||||
- lmod
|
- lmod
|
||||||
lmod:
|
lmod:
|
||||||
|
all:
|
||||||
|
autoload: none
|
||||||
hierarchy:
|
hierarchy:
|
||||||
- mpi
|
- mpi
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
enable:
|
enable:
|
||||||
- lmod
|
- lmod
|
||||||
lmod:
|
lmod:
|
||||||
|
all:
|
||||||
|
autoload: none
|
||||||
core_compilers:
|
core_compilers:
|
||||||
- 'clang@3.3'
|
- 'clang@3.3'
|
||||||
|
|
|
@ -2,5 +2,7 @@ enable:
|
||||||
- lmod
|
- lmod
|
||||||
arch_folder: false
|
arch_folder: false
|
||||||
lmod:
|
lmod:
|
||||||
|
all:
|
||||||
|
autoload: none
|
||||||
core_compilers:
|
core_compilers:
|
||||||
- 'clang@3.3'
|
- 'clang@3.3'
|
|
@ -1,6 +1,8 @@
|
||||||
enable:
|
enable:
|
||||||
- lmod
|
- lmod
|
||||||
lmod:
|
lmod:
|
||||||
|
all:
|
||||||
|
autoload: none
|
||||||
hash_length: 0
|
hash_length: 0
|
||||||
|
|
||||||
core_compilers:
|
core_compilers:
|
||||||
|
|
|
@ -8,4 +8,4 @@ lmod:
|
||||||
- openblas
|
- openblas
|
||||||
|
|
||||||
all:
|
all:
|
||||||
autoload: 'direct'
|
autoload: direct
|
||||||
|
|
|
@ -8,3 +8,4 @@ lmod:
|
||||||
|
|
||||||
all:
|
all:
|
||||||
template: 'override_from_modules.txt'
|
template: 'override_from_modules.txt'
|
||||||
|
autoload: none
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
enable:
|
enable:
|
||||||
- lmod
|
- lmod
|
||||||
lmod:
|
lmod:
|
||||||
|
all:
|
||||||
|
autoload: none
|
||||||
projections:
|
projections:
|
||||||
all: '{name}/v{version}'
|
all: '{name}/v{version}'
|
||||||
mpileaks: '{name}-mpiprojection'
|
mpileaks: '{name}-mpiprojection'
|
||||||
|
|
|
@ -2,5 +2,7 @@ enable:
|
||||||
- lmod
|
- lmod
|
||||||
use_view: default
|
use_view: default
|
||||||
lmod:
|
lmod:
|
||||||
|
all:
|
||||||
|
autoload: none
|
||||||
core_compilers:
|
core_compilers:
|
||||||
- 'clang@3.3'
|
- 'clang@3.3'
|
||||||
|
|
|
@ -2,6 +2,7 @@ enable:
|
||||||
- tcl
|
- tcl
|
||||||
tcl:
|
tcl:
|
||||||
all:
|
all:
|
||||||
|
autoload: none
|
||||||
filter:
|
filter:
|
||||||
environment_blacklist:
|
environment_blacklist:
|
||||||
- CMAKE_PREFIX_PATH
|
- CMAKE_PREFIX_PATH
|
||||||
|
|
|
@ -3,4 +3,4 @@ enable:
|
||||||
tcl:
|
tcl:
|
||||||
verbose: true
|
verbose: true
|
||||||
all:
|
all:
|
||||||
autoload: 'all'
|
autoload: all
|
||||||
|
|
|
@ -2,4 +2,4 @@ enable:
|
||||||
- tcl
|
- tcl
|
||||||
tcl:
|
tcl:
|
||||||
all:
|
all:
|
||||||
autoload: 'direct'
|
autoload: direct
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
enable:
|
enable:
|
||||||
- tcl
|
- tcl
|
||||||
tcl:
|
tcl:
|
||||||
|
all:
|
||||||
|
autoload: none
|
||||||
^mpich2:
|
^mpich2:
|
||||||
autoload: 'direct'
|
autoload: direct
|
||||||
|
|
||||||
^python:
|
^python:
|
||||||
autoload: 'direct'
|
autoload: direct
|
||||||
|
|
|
@ -7,4 +7,4 @@ tcl:
|
||||||
- callpath
|
- callpath
|
||||||
- mpi
|
- mpi
|
||||||
all:
|
all:
|
||||||
autoload: 'direct'
|
autoload: direct
|
||||||
|
|
|
@ -3,4 +3,4 @@ enable:
|
||||||
tcl:
|
tcl:
|
||||||
blacklist_implicits: true
|
blacklist_implicits: true
|
||||||
all:
|
all:
|
||||||
autoload: 'direct'
|
autoload: direct
|
||||||
|
|
|
@ -4,6 +4,7 @@ tcl:
|
||||||
projections:
|
projections:
|
||||||
all: '{name}/{version}-{compiler.name}'
|
all: '{name}/{version}-{compiler.name}'
|
||||||
all:
|
all:
|
||||||
|
autoload: none
|
||||||
conflict:
|
conflict:
|
||||||
- '{name}'
|
- '{name}'
|
||||||
- 'intel/14.0.1'
|
- 'intel/14.0.1'
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
enable:
|
enable:
|
||||||
- tcl
|
- tcl
|
||||||
tcl:
|
tcl:
|
||||||
|
all:
|
||||||
|
autoload: none
|
||||||
# {variants} is not allowed in the naming scheme, see #2884
|
# {variants} is not allowed in the naming scheme, see #2884
|
||||||
projections:
|
projections:
|
||||||
all: '{name}/{version}-{compiler.name}-{variants}'
|
all: '{name}/{version}-{compiler.name}-{variants}'
|
||||||
|
|
|
@ -2,6 +2,7 @@ enable:
|
||||||
- tcl
|
- tcl
|
||||||
tcl:
|
tcl:
|
||||||
all:
|
all:
|
||||||
|
autoload: none
|
||||||
filter:
|
filter:
|
||||||
environment_blacklist:
|
environment_blacklist:
|
||||||
- CMAKE_PREFIX_PATH
|
- CMAKE_PREFIX_PATH
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
enable:
|
enable:
|
||||||
- tcl
|
- tcl
|
||||||
tcl:
|
tcl:
|
||||||
|
all:
|
||||||
|
autoload: none
|
||||||
naming_scheme: '{name}/{version}-{compiler.name}'
|
naming_scheme: '{name}/{version}-{compiler.name}'
|
||||||
|
|
|
@ -2,5 +2,7 @@ enable:
|
||||||
- tcl
|
- tcl
|
||||||
arch_folder: false
|
arch_folder: false
|
||||||
tcl:
|
tcl:
|
||||||
|
all:
|
||||||
|
autoload: none
|
||||||
projections:
|
projections:
|
||||||
all: ''
|
all: ''
|
|
@ -2,6 +2,7 @@ enable:
|
||||||
- tcl
|
- tcl
|
||||||
tcl:
|
tcl:
|
||||||
all:
|
all:
|
||||||
|
autoload: none
|
||||||
suffixes:
|
suffixes:
|
||||||
'^mpich': mpich
|
'^mpich': mpich
|
||||||
mpileaks:
|
mpileaks:
|
||||||
|
|
|
@ -2,4 +2,5 @@ enable:
|
||||||
- tcl
|
- tcl
|
||||||
tcl:
|
tcl:
|
||||||
all:
|
all:
|
||||||
|
autoload: none
|
||||||
template: 'override_from_modules.txt'
|
template: 'override_from_modules.txt'
|
||||||
|
|
|
@ -2,4 +2,5 @@ enable:
|
||||||
- tcl
|
- tcl
|
||||||
tcl:
|
tcl:
|
||||||
all:
|
all:
|
||||||
prerequisites: 'all'
|
autoload: none
|
||||||
|
prerequisites: all
|
||||||
|
|
|
@ -2,4 +2,5 @@ enable:
|
||||||
- tcl
|
- tcl
|
||||||
tcl:
|
tcl:
|
||||||
all:
|
all:
|
||||||
prerequisites: 'direct'
|
autoload: none
|
||||||
|
prerequisites: direct
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
enable:
|
enable:
|
||||||
- tcl
|
- tcl
|
||||||
tcl:
|
tcl:
|
||||||
|
all:
|
||||||
|
autoload: none
|
||||||
projections:
|
projections:
|
||||||
all: '{name}/{version}-{compiler.name}'
|
all: '{name}/{version}-{compiler.name}'
|
||||||
mpileaks: '{name}-mpiprojection'
|
mpileaks: '{name}-mpiprojection'
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
enable:
|
enable:
|
||||||
- tcl
|
- tcl
|
||||||
tcl:
|
tcl:
|
||||||
|
all:
|
||||||
|
autoload: none
|
||||||
mpileaks:
|
mpileaks:
|
||||||
suffixes:
|
suffixes:
|
||||||
'+opt': baz
|
'+opt': baz
|
||||||
|
|
|
@ -4,5 +4,6 @@ tcl:
|
||||||
projections:
|
projections:
|
||||||
all: '{name}/{version}-{compiler.name}'
|
all: '{name}/{version}-{compiler.name}'
|
||||||
all:
|
all:
|
||||||
|
autoload: none
|
||||||
conflict:
|
conflict:
|
||||||
- '{name}/{compiler.name}'
|
- '{name}/{compiler.name}'
|
||||||
|
|
Loading…
Reference in a new issue