summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/gromacs
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2023-11-10 14:56:04 +0100
committerGitHub <noreply@github.com>2023-11-10 13:56:04 +0000
commitfbf02b561ae628ea14302d4b55a02e3ee2f4ec2c (patch)
treeac3b0571112da8e1578ce140b84b6417c458288e /var/spack/repos/builtin/packages/gromacs
parent4027a2139b053251dafc2de38d24eac4d69d42a0 (diff)
downloadspack-fbf02b561ae628ea14302d4b55a02e3ee2f4ec2c.tar.gz
spack-fbf02b561ae628ea14302d4b55a02e3ee2f4ec2c.tar.bz2
spack-fbf02b561ae628ea14302d4b55a02e3ee2f4ec2c.tar.xz
spack-fbf02b561ae628ea14302d4b55a02e3ee2f4ec2c.zip
gromacs et al: fix ^mkl pattern (#41002)
The ^mkl pattern was used to refer to three packages even though none of software using it was depending on "mkl". This pattern, which follows Hyrum's law, is now being removed in favor of a more explicit one. In this PR gromacs, abinit, lammps, and quantum-espresso are modified. Intel packages are also modified to provide "lapack" and "blas" together.
Diffstat (limited to 'var/spack/repos/builtin/packages/gromacs')
-rw-r--r--var/spack/repos/builtin/packages/gromacs/package.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/gromacs/package.py b/var/spack/repos/builtin/packages/gromacs/package.py
index 7a4147a6ee..66c594c71e 100644
--- a/var/spack/repos/builtin/packages/gromacs/package.py
+++ b/var/spack/repos/builtin/packages/gromacs/package.py
@@ -263,6 +263,11 @@ class Gromacs(CMakePackage, CudaPackage):
msg="Only attempt to find gcc libs for Intel compiler if Intel compiler is used.",
)
+ # If the Intel suite is used for Lapack, it must be used for fftw and vice-versa
+ for _intel_pkg in INTEL_MATH_LIBRARIES:
+ requires(f"^[virtuals=fftw-api] {_intel_pkg}", when=f"^[virtuals=lapack] {_intel_pkg}")
+ requires(f"^[virtuals=lapack] {_intel_pkg}", when=f"^[virtuals=fftw-api] {_intel_pkg}")
+
patch("gmxDetectCpu-cmake-3.14.patch", when="@2018:2019.3^cmake@3.14.0:")
patch("gmxDetectSimd-cmake-3.14.patch", when="@5.0:2017^cmake@3.14.0:")
# 2021.2 will always try to build tests (see https://gromacs.bioexcel.eu/t/compilation-failure-for-gromacs-2021-1-and-2021-2-with-cmake-3-20-2/2129)
@@ -594,7 +599,7 @@ class CMakeBuilder(spack.build_systems.cmake.CMakeBuilder):
"-DGMX_OPENMP_MAX_THREADS=%s" % self.spec.variants["openmp_max_threads"].value
)
- if "^mkl" in self.spec:
+ if self.spec["lapack"].name in INTEL_MATH_LIBRARIES:
# fftw-api@3 is provided by intel-mkl or intel-parllel-studio
# we use the mkl interface of gromacs
options.append("-DGMX_FFT_LIBRARY=mkl")