From d7869da36bd290c68ca8007fec0663ddb52a1c66 Mon Sep 17 00:00:00 2001 From: Tuomas Koskela Date: Mon, 13 Nov 2023 11:13:53 +0000 Subject: conquest: add build system changes and library paths (#40718) --- .../repos/builtin/packages/conquest/package.py | 34 ++++++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/var/spack/repos/builtin/packages/conquest/package.py b/var/spack/repos/builtin/packages/conquest/package.py index 29e9fa5777..4478881b91 100644 --- a/var/spack/repos/builtin/packages/conquest/package.py +++ b/var/spack/repos/builtin/packages/conquest/package.py @@ -49,6 +49,15 @@ class Conquest(MakefilePackage): build_directory = "src" + # The SYSTEM variable is required above version 1.2. + # Versions 1.2 and older should ignore it. + @property + def build_targets(self): + if self.version > Version("1.2"): + return ["SYSTEM = example", "Conquest"] + else: + return ["Conquest"] + def edit(self, spec, prefix): fflags = "-O3 -fallow-argument-mismatch" ldflags = "" @@ -63,12 +72,23 @@ class Conquest(MakefilePackage): lapack_ld = self.spec["lapack"].libs.ld_flags blas_ld = self.spec["blas"].libs.ld_flags - - defs_file = FileFilter("./src/system.make") - - defs_file.filter("COMPFLAGS=.*", f"COMPFLAGS= {fflags}") - defs_file.filter("LINKFLAGS=.*", f"LINKFLAGS= {ldflags}") - defs_file.filter("# BLAS=.*", f"BLAS= {lapack_ld} -llapack {blas_ld} -lblas") + fftw_ld = self.spec["fftw"].libs.ld_flags + libxc_ld = self.spec["libxc"].libs.ld_flags + + # Starting from 1.3 there's automated logic in the Makefile that picks + # from a list of possible files for system/compiler-specific definitions. + # This is useful for manual builds, but since the spack will do its own + # automation of compiler-specific flags, we will override it. + if self.version > Version("1.2"): + defs_file = FileFilter("./src/system/system.example.make") + else: + defs_file = FileFilter("./src/system.make") + + defs_file.filter(".*COMPFLAGS=.*", f"COMPFLAGS= {fflags}") + defs_file.filter(".*LINKFLAGS=.*", f"LINKFLAGS= {ldflags}") + defs_file.filter(".*BLAS=.*", f"BLAS= {lapack_ld} {blas_ld}") + defs_file.filter(".*FFT_LIB=.*", f"FFT_LIB={fftw_ld}") + defs_file.filter(".*XC_LIB=.*", f"XC_LIB={libxc_ld} -lxcf90 -lxc") if "+openmp" in self.spec: defs_file.filter("OMP_DUMMY = DUMMY", "OMP_DUMMY = ") @@ -81,3 +101,5 @@ class Conquest(MakefilePackage): def install(self, spec, prefix): mkdirp(prefix.bin) install("./bin/Conquest", prefix.bin) + if self.version > Version("1.2"): + install_tree("./benchmarks/", join_path(prefix, "benchmarks")) -- cgit v1.2.3-70-g09d2