summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Becker <becker33@llnl.gov>2022-11-04 14:50:05 -0700
committerGitHub <noreply@github.com>2022-11-04 14:50:05 -0700
commita88c74dc1795e7aa38c5ac04b7af16d1c7c586f5 (patch)
tree2abf7c55da4db0e4fe33507f9c2c80a69952c6c6
parentfb5ff901c0f5458895e20471fd4dab345e7c1bf2 (diff)
downloadspack-a88c74dc1795e7aa38c5ac04b7af16d1c7c586f5.tar.gz
spack-a88c74dc1795e7aa38c5ac04b7af16d1c7c586f5.tar.bz2
spack-a88c74dc1795e7aa38c5ac04b7af16d1c7c586f5.tar.xz
spack-a88c74dc1795e7aa38c5ac04b7af16d1c7c586f5.zip
delegate to cray modules for target args on cray (#17857)
-rw-r--r--lib/spack/spack/build_environment.py6
-rw-r--r--lib/spack/spack/spec.py4
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py
index c69dd566e6..9247d9f150 100644
--- a/lib/spack/spack/build_environment.py
+++ b/lib/spack/spack/build_environment.py
@@ -332,7 +332,11 @@ def set_compiler_environment_variables(pkg, env):
env.set("SPACK_DTAGS_TO_ADD", compiler.enable_new_dtags)
# Set the target parameters that the compiler will add
- isa_arg = spec.architecture.target.optimization_flags(compiler)
+ # Don't set on cray platform because the targeting module handles this
+ if spec.satisfies("platform=cray"):
+ isa_arg = ""
+ else:
+ isa_arg = spec.architecture.target.optimization_flags(compiler)
env.set("SPACK_TARGET_ARGS", isa_arg)
# Trap spack-tracked compiler flags as appropriate.
diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py
index dd1ce821d9..a419fdf057 100644
--- a/lib/spack/spack/spec.py
+++ b/lib/spack/spack/spec.py
@@ -2755,7 +2755,9 @@ class Spec(object):
# Check if we can produce an optimized binary (will throw if
# there are declared inconsistencies)
- self.architecture.target.optimization_flags(self.compiler)
+ # No need on platform=cray because of the targeting modules
+ if not self.satisfies("platform=cray"):
+ self.architecture.target.optimization_flags(self.compiler)
def _patches_assigned(self):
"""Whether patches have been assigned to this spec by the concretizer."""