summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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."""