Repository navigation
Set a compiler's MODULEPATH before its meta-module loads modules - #2145
Merged
Merged
Conversation
setup-meta-modules wrote a compiler's environment prepend of MODULEPATH after the module loads, so a compiler module found only in that directory could not be loaded. Write it with the module hierarchy, before the loads. Add the directory of the EPIC-installed oneAPI compiler module to the Orion and Hercules oneAPI compiler entries.
climbfuji
requested changes
Oct 5, 2026
climbfuji
approved these changes
Oct 5, 2026
AlexanderRichert-NOAA
approved these changes
Oct 6, 2026
Collaborator
|
I'll update this from develop after #2143 merges and run the tests before merging. |
Collaborator
|
@pera-noaa Apologies, after merging #2143 there are merge conflicts. Can you resolve those, please? |
Contributor
Author
|
Merged develop; unit tests pass (59/59 on Hercules). |
climbfuji
enabled auto-merge (squash)
October 8, 2026 02:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
spack stack setup-meta-moduleswrites a compiler'sextra_attributes: environment: prepend_path: MODULEPATHinto the@ENVVARS@block of the compiler meta-module, which the templates emit after@MODULELOADS@. So when the compiler's module is found only in that directory, the meta-module'sload()runs before the directory is onMODULEPATHand fails from a clean shell. This PR writes a compiler'sMODULEPATHchanges into@MODULEPATHS@, which comes before the loads, after the hierarchy paths. All other environment changes stay in@ENVVARS@.It also adds
/apps/contrib/spack-stack/modulefiles, where the EPIC-installedintel-oneapi-compilers/2025.3.1module lives, to the oneAPI compiler entry on Orion and Hercules. Today onlysetup.shadds it, at build time, so users of the installed envs cannot loadstack-intel-oneapi-compilers/2025.3.1without amodule usefirst.One behaviour change: the site's
MODULEPATHentry now goes on before the compiler's own modules load, not after. Any directories those modules add toMODULEPATHtherefore come ahead of it, where before the site's directory came first.Dependencies
None.
Issues addressed
Working towards #2144 (items 1 and 2: the generator side; the already-installed modulefiles still need editing or regenerating).
Applications affected
None directly; affects the meta-modules every application loads.
Systems affected
Sites whose compiler entry prepends
MODULEPATH: hera, noaa-aws, noaa-azure, wheat and jean, and now orion and hercules. Nothing changes for other sites.Testing
test_setup_meta_modulesnow gives the gcc external an environmentMODULEPATHprepend and checks thatstack-gcc/11.5.0has it beforemodule load gcc/11.5.0.spack unit-test --extension=stackon Hercules (Rocky 9.1, Python 3.11.7). On develop (f8e3e72) with only the new test: fails at the new check (MODULEPATH at offset 1133, load at 751). With this PR: 59 passed.ue-oneapi-2025.3.1stack-intel-oneapi-compilers/2025.3.1fails ("unknown: intel-oneapi-compilers/2025.3.1"). A copy withprepend_path("MODULEPATH", "/apps/contrib/spack-stack/modulefiles")before itsload(), which this PR generates, loads, andifxis onPATH.setup-meta-moduleson Orion or Hercules.Aside, not changed here: the earlier
assert(cond, "msg")calls intest_setup_meta_modules.pyare always true (pytest warns "assertion is always true"), so those checks cannot fail.Checklist
🤖 Generated with Claude Code