diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2024-05-07 09:20:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-07 09:20:34 +0200 |
commit | 0a353abc42e5bd67ce0401a58b327c2d84d9eab9 (patch) | |
tree | 742c2cc6aa9a72355afa4912aeeda77a1c74b9a9 | |
parent | e178c58847eec3fd2d6cdd7f646a5a2cd7a5e8c4 (diff) | |
download | spack-0a353abc42e5bd67ce0401a58b327c2d84d9eab9.tar.gz spack-0a353abc42e5bd67ce0401a58b327c2d84d9eab9.tar.bz2 spack-0a353abc42e5bd67ce0401a58b327c2d84d9eab9.tar.xz spack-0a353abc42e5bd67ce0401a58b327c2d84d9eab9.zip |
Fix issues in packages with the new release of archspec (#44037)
6 files changed, 8 insertions, 17 deletions
diff --git a/var/spack/repos/builtin/packages/arbor/package.py b/var/spack/repos/builtin/packages/arbor/package.py index ca3651e4b3..ac189d56aa 100644 --- a/var/spack/repos/builtin/packages/arbor/package.py +++ b/var/spack/repos/builtin/packages/arbor/package.py @@ -120,9 +120,7 @@ class Arbor(CMakePackage, CudaPackage): # query spack for the architecture-specific compiler flags set by its wrapper args.append("-DARB_ARCH=none") - opt_flags = self.spec.target.optimization_flags( - self.spec.compiler.name, self.spec.compiler.version - ) + opt_flags = self.spec.architecture.target.optimization_flags(self.spec.compiler) args.append("-DARB_CXX_FLAGS_TARGET=" + opt_flags) return args diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py index f10ff1623a..b3bb491d7f 100644 --- a/var/spack/repos/builtin/packages/gcc/package.py +++ b/var/spack/repos/builtin/packages/gcc/package.py @@ -683,10 +683,10 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage, CompilerPackage): """Get the right (but pessimistic) architecture specific flags supported by both host gcc and to-be-built gcc. For example: gcc@7 %gcc@12 target=znver3 should pick -march=znver1, since that's what gcc@7 supports.""" - archs = [spec.target] + spec.target.ancestors - for arch in archs: + microarchitectures = [spec.target] + spec.target.ancestors + for uarch in microarchitectures: try: - return arch.optimization_flags("gcc", spec.version) + return uarch.optimization_flags("gcc", str(spec.version)) except UnsupportedMicroarchitecture: pass # no arch specific flags in common, unlikely to happen. diff --git a/var/spack/repos/builtin/packages/hpcc/package.py b/var/spack/repos/builtin/packages/hpcc/package.py index 08c620c00d..56674ae0c5 100644 --- a/var/spack/repos/builtin/packages/hpcc/package.py +++ b/var/spack/repos/builtin/packages/hpcc/package.py @@ -159,7 +159,7 @@ class Hpcc(MakefilePackage): if spec.satisfies("%intel"): # with intel-parallel-studio+mpi the '-march' arguments # are not passed to icc - arch_opt = spec.target.optimization_flags(spec.compiler.name, spec.compiler.version) + arch_opt = spec.architecture.target.optimization_flags(spec.compiler) self.config["@CCFLAGS@"] = "-O3 -restrict -ansi-alias -ip {0}".format(arch_opt) self.config["@CCNOOPT@"] = "-restrict" self._write_make_arch(spec, prefix) diff --git a/var/spack/repos/builtin/packages/lammps/package.py b/var/spack/repos/builtin/packages/lammps/package.py index aac96002d2..7d007d559f 100644 --- a/var/spack/repos/builtin/packages/lammps/package.py +++ b/var/spack/repos/builtin/packages/lammps/package.py @@ -5,8 +5,6 @@ import datetime as dt import os -import archspec - from spack.package import * @@ -822,9 +820,7 @@ class Lammps(CMakePackage, CudaPackage, ROCmPackage, PythonExtension): args.append(self.define("CMAKE_CXX_FLAGS_RELWITHDEBINFO", cxx_flags)) # Overwrite generic cpu tune option - cmake_tune_flags = archspec.cpu.TARGETS[spec.target.name].optimization_flags( - spec.compiler.name, spec.compiler.version - ) + cmake_tune_flags = spec.architecture.target.optimization_flags(spec.compiler) args.append(self.define("CMAKE_TUNE_FLAGS", cmake_tune_flags)) args.append(self.define_from_variant("LAMMPS_SIZES", "lammps_sizes")) diff --git a/var/spack/repos/builtin/packages/namd/package.py b/var/spack/repos/builtin/packages/namd/package.py index ae47ddd46b..4bb91a8772 100644 --- a/var/spack/repos/builtin/packages/namd/package.py +++ b/var/spack/repos/builtin/packages/namd/package.py @@ -134,7 +134,7 @@ class Namd(MakefilePackage, CudaPackage): # this options are take from the default provided # configuration files # https://github.com/UIUC-PPL/charm/pull/2778 - archopt = spec.target.optimization_flags(spec.compiler.name, spec.compiler.version) + archopt = spec.architecture.target.optimization_flags(spec.compiler) if self.spec.satisfies("^charmpp@:6.10.1"): optims_opts = { diff --git a/var/spack/repos/builtin/packages/py-tensorflow/package.py b/var/spack/repos/builtin/packages/py-tensorflow/package.py index 56d12ff231..6668507186 100644 --- a/var/spack/repos/builtin/packages/py-tensorflow/package.py +++ b/var/spack/repos/builtin/packages/py-tensorflow/package.py @@ -605,10 +605,7 @@ class PyTensorflow(Package, CudaPackage, ROCmPackage, PythonExtension): # Please specify optimization flags to use during compilation when # bazel option '--config=opt' is specified - env.set( - "CC_OPT_FLAGS", - spec.target.optimization_flags(spec.compiler.name, spec.compiler.version), - ) + env.set("CC_OPT_FLAGS", spec.architecture.target.optimization_flags(spec.compiler)) # Would you like to interactively configure ./WORKSPACE for # Android builds? |