cp2k: add v2023.1 (#35346)

This commit is contained in:
Rémi Lacroix 2023-02-16 10:33:48 +01:00 committed by GitHub
parent 90261029d8
commit a00b92a69f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,7 @@ class Cp2k(MakefilePackage, CudaPackage):
maintainers("dev-zero")
version("2023.1", sha256="dff343b4a80c3a79363b805429bdb3320d3e1db48e0ff7d20a3dfd1c946a51ce")
version("2022.2", sha256="1a473dea512fe264bb45419f83de432d441f90404f829d89cbc3a03f723b8354")
version("2022.1", sha256="2c34f1a7972973c62d471cd35856f444f11ab22f2ff930f6ead20f3454fd228b")
version("9.1", sha256="fedb4c684a98ad857cd49b69a3ae51a73f85a9c36e9cb63e3b02320c74454ce6")
@ -151,10 +152,12 @@ class Cp2k(MakefilePackage, CudaPackage):
depends_on("libxc@4.0.3:4", when="@6.0:6.9", type="build")
depends_on("libxc@4.0.3:4", when="@7.0:8.1")
depends_on("libxc@5.1.3:5.1", when="@8.2:8")
depends_on("libxc@5.1.7:5.1", when="@9:")
depends_on("libxc@5.1.7:5.1", when="@9:2022")
depends_on("libxc@6:6.1", when="@2023:")
with when("+mpi"):
depends_on("mpi@2:")
depends_on("mpi@3:", when="@2023.1:")
depends_on("scalapack")
with when("+cosma"):
@ -321,10 +324,13 @@ def edit(self, spec, prefix):
"-I{0}".format(fftw_header_dir),
]
if "^mpi@3:" in spec:
cppflags.append("-D__MPI_VERSION=3")
elif "^mpi@2:" in spec:
cppflags.append("-D__MPI_VERSION=2")
# CP2K requires MPI 3 starting at version 2023.1
# and __MPI_VERSION is not supported anymore.
if "@:2022.2" in spec:
if "^mpi@3:" in spec:
cppflags.append("-D__MPI_VERSION=3")
elif "^mpi@2:" in spec:
cppflags.append("-D__MPI_VERSION=2")
cflags = optimization_flags[self.spec.compiler.name][:]
cxxflags = optimization_flags[self.spec.compiler.name][:]