diff options
author | Greg Becker <becker33@llnl.gov> | 2021-05-14 15:03:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-14 15:03:28 -0700 |
commit | cefbe48c89209dc3df654795644973b1885cdea4 (patch) | |
tree | b65b3625a56faaaaeb4005b24ea49dd711a1c431 /etc/spack/defaults/modules.yaml | |
parent | fc392d2f56beae448dd5d8888dbb2b8cde6d9e64 (diff) | |
download | spack-cefbe48c89209dc3df654795644973b1885cdea4.tar.gz spack-cefbe48c89209dc3df654795644973b1885cdea4.tar.bz2 spack-cefbe48c89209dc3df654795644973b1885cdea4.tar.xz spack-cefbe48c89209dc3df654795644973b1885cdea4.zip |
Separable module configurations (#22588)
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.
TODO:
- [x] code changes to support multiple module sets
- [x] code changes to support modules relative to a view
- [x] Tests for multiple module configurations
- [x] Tests for modules relative to a view
- [x] Backwards compatibility for module roots from config section
- [x] Backwards compatibility for default module set without the name specified
- [x] Tests for backwards compatibility
Diffstat (limited to 'etc/spack/defaults/modules.yaml')
-rw-r--r-- | etc/spack/defaults/modules.yaml | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/etc/spack/defaults/modules.yaml b/etc/spack/defaults/modules.yaml index d6d245930c..4539dbc9c2 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,17 @@ modules: '': - CMAKE_PREFIX_PATH - lmod: - hierarchy: - - mpi + # These are configurations for the module set named "default" + default: + # 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 |