summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorGreg Becker <becker33@llnl.gov>2021-05-28 14:12:05 -0700
committerGitHub <noreply@github.com>2021-05-28 14:12:05 -0700
commit7490d63c38f5cd8dd927ee0adda4e28578bbd60d (patch)
tree509a332ec9a124ce0b7ae975aea5ea517b6f7673 /etc
parent9b99f85abf208612fe8ff7d108b6a68d970706d8 (diff)
downloadspack-7490d63c38f5cd8dd927ee0adda4e28578bbd60d.tar.gz
spack-7490d63c38f5cd8dd927ee0adda4e28578bbd60d.tar.bz2
spack-7490d63c38f5cd8dd927ee0adda4e28578bbd60d.tar.xz
spack-7490d63c38f5cd8dd927ee0adda4e28578bbd60d.zip
Separable module configuration -- without the bugs this time (#23703)
Currently, module configurations are inconsistent because modulefiles are generated with the configs for the active environment, but are shared among all environments (and spack outside any environment). This PR fixes that by allowing Spack environments (or other spack config scopes) to define additional sets of modules to generate. Each set of modules can enable either lmod or tcl modules, and contains all of the previously available module configuration. The user defines the name of each module set -- the set configured in Spack by default is named "default", and is the one returned by module manipulation commands in the absence of user intervention. As part of this change, the module roots configuration moved from the config section to inside each module configuration. Additionally, it adds a feature that the modulefiles for an environment can be configured to be relative to an environment view rather than the underlying prefix. This will not be enabled by default, as it should only be enabled within an environment and for non-default views constructed with separate projections per-spec.
Diffstat (limited to 'etc')
-rw-r--r--etc/spack/defaults/config.yaml7
-rw-r--r--etc/spack/defaults/linux/modules.yaml11
-rw-r--r--etc/spack/defaults/modules.yaml23
3 files changed, 24 insertions, 17 deletions
diff --git a/etc/spack/defaults/config.yaml b/etc/spack/defaults/config.yaml
index 61c23f42df..2400686e60 100644
--- a/etc/spack/defaults/config.yaml
+++ b/etc/spack/defaults/config.yaml
@@ -33,13 +33,6 @@ config:
template_dirs:
- $spack/share/spack/templates
-
- # Locations where different types of modules should be installed.
- module_roots:
- tcl: $spack/share/spack/modules
- lmod: $spack/share/spack/lmod
-
-
# Temporary locations Spack can try to use for builds.
#
# Recommended options are given below.
diff --git a/etc/spack/defaults/linux/modules.yaml b/etc/spack/defaults/linux/modules.yaml
index a86a4794f1..353a6ea9ab 100644
--- a/etc/spack/defaults/linux/modules.yaml
+++ b/etc/spack/defaults/linux/modules.yaml
@@ -14,8 +14,9 @@
# ~/.spack/modules.yaml
# -------------------------------------------------------------------------
modules:
- prefix_inspections:
- lib:
- - LD_LIBRARY_PATH
- lib64:
- - LD_LIBRARY_PATH
+ default:
+ prefix_inspections:
+ lib:
+ - LD_LIBRARY_PATH
+ lib64:
+ - LD_LIBRARY_PATH
diff --git a/etc/spack/defaults/modules.yaml b/etc/spack/defaults/modules.yaml
index d6d245930c..27b7c45f66 100644
--- a/etc/spack/defaults/modules.yaml
+++ b/etc/spack/defaults/modules.yaml
@@ -14,8 +14,7 @@
# ~/.spack/modules.yaml
# -------------------------------------------------------------------------
modules:
- enable:
- - tcl
+ # Paths to check when creating modules for all module sets
prefix_inspections:
bin:
- PATH
@@ -34,6 +33,20 @@ modules:
'':
- CMAKE_PREFIX_PATH
- lmod:
- hierarchy:
- - mpi
+ # These are configurations for the module set named "default"
+ default:
+ # These values are defaulted in the code. They are not defaulted here so
+ # that we can enable backwards compatibility with the old syntax more
+ # easily (old value is in the config yaml, config:module_roots)
+ # Where to install modules
+ # roots:
+ # tcl: $spack/share/spack/modules
+ # lmod: $spack/share/spack/lmod
+ # What type of modules to use
+ enable:
+ - tcl
+
+ # Default configurations if lmod is enabled
+ lmod:
+ hierarchy:
+ - mpi