-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix module loads #5599
Fix module loads #5599
Conversation
lib/spack/spack/build_environment.py
Outdated
@@ -511,6 +502,19 @@ def setup_package(pkg, dirty): | |||
validate(spack_env, tty.warn) | |||
spack_env.apply_modifications() | |||
|
|||
# All module loads that otherwise would belong in previous functions | |||
# have to occur after previous line. They are now here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO this should explicitly refer to the call to spack_env.apply_modifications
and it may be work adding to the explanation like:
spack_env includes modifications like unsetting LD_LIBRARY path, which required modules may update. Modules are therefore loaded after the call to spack_env.apply_modifications.
@scheibelp I've updated the comment as you asked |
@becker33 : I have tested this on our x86 cluster and it's working fine. BUT, with this change, our Jenkins build is failing for TAU profiler build with error like:
In above case, I am building tau with intel (or XL on bg-q) compiler but TAU does use GCC compiler to build some tools. Above error happens where those files get compiled with GCC. Its strange that above error is related to not finding standards headers from Unfortunately I am not able to reproduce this in interactive session on our cluster. Do you have any idea what might be going wrong after this PR? |
@pramodskumbhar could you post the full compiler entry? I was going to open a new issue for this but I think that detail would be useful in a better description for the issue. |
@scheibelp : I was debugging this and it seems like it was our Jenkins CI glitch. Now I am able to build everything fine. I will open an issue if I see this again. Sorry for noise! |
Fixes #5455
All methods within
setup_package
use an EnvironmentModifications object to control the environment. Those modifications are applied at the end ofsetup_package
. Module loads for the build environment need to be done after the rest of the environment modifications are applied, as otherwise Spack will unset variables set by those modules.This is a quick fix, but I don't see a more elegant solution to this problem.