From a88c74dc1795e7aa38c5ac04b7af16d1c7c586f5 Mon Sep 17 00:00:00 2001 From: Greg Becker Date: Fri, 4 Nov 2022 14:50:05 -0700 Subject: delegate to cray modules for target args on cray (#17857) --- lib/spack/spack/build_environment.py | 6 +++++- lib/spack/spack/spec.py | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'lib') 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.""" -- cgit v1.2.3-60-g2f50