From 94ce7f504096400c6969f811525bd9aeac6667a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tiziano=20M=C3=BCller?= Date: Tue, 8 Mar 2022 19:32:15 +0100 Subject: [PATCH] cray-libsci/cp2k: add constraints to get consistently linked executables (#29396) * cray-libsci: only be a provider for scalapack with +mpi If a package explicitly links the scalapack provider we might otherwise end up with different variants of libsci being linked: the explicitly linked one and the one added by the Cray compiler wrappers. * cp2k: require cray-libsci+openmp with +openmp for consistency otherwise we might get 2 different libsci linked: one explicitly, the other one via the Cray compiler wrappers, leading at least to segfaults during cleanup * cp2k: depend on cray-fftw+openmp with +openmp --- var/spack/repos/builtin/packages/cp2k/package.py | 5 +++++ var/spack/repos/builtin/packages/cray-libsci/package.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/cp2k/package.py b/var/spack/repos/builtin/packages/cp2k/package.py index ddae41db19c..f148db7f488 100644 --- a/var/spack/repos/builtin/packages/cp2k/package.py +++ b/var/spack/repos/builtin/packages/cp2k/package.py @@ -83,7 +83,12 @@ class Cp2k(MakefilePackage, CudaPackage): with when('+openmp'): depends_on('fftw+openmp', when='^fftw') depends_on('amdfftw+openmp', when='^amdfftw') + depends_on('cray-fftw+openmp', when='^cray-fftw') depends_on('openblas threads=openmp', when='^openblas') + # The Cray compiler wrappers will automatically add libsci_mp with + # -fopenmp. Since CP2K unconditionally links blas/lapack/scalapack + # we have to be consistent. + depends_on('cray-libsci+openmp', when='^cray-libsci') with when('smm=libxsmm'): depends_on('libxsmm@1.17:~header-only', when='@9.1:') diff --git a/var/spack/repos/builtin/packages/cray-libsci/package.py b/var/spack/repos/builtin/packages/cray-libsci/package.py index 9a85996199e..f9ac97f0e88 100644 --- a/var/spack/repos/builtin/packages/cray-libsci/package.py +++ b/var/spack/repos/builtin/packages/cray-libsci/package.py @@ -30,7 +30,7 @@ class CrayLibsci(Package): provides("blas") provides("lapack") - provides("scalapack") + provides("scalapack", when="+mpi") canonical_names = { 'gcc': 'GNU',