heffte: add v2.4.0 (#40741)

* update the heffte versions

* remove obsolete patch files

* update testing

* style

* restore version (unknown reason)

* restore old patch

* change the syntax

* [@spackbot] updating style on behalf of mkstoyanov

* missed one

* style
This commit is contained in:
Miroslav Stoyanov 2023-11-01 18:54:11 -04:00 committed by GitHub
parent f7630f265b
commit 33b355a085
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 50 deletions

View file

@ -10,7 +10,7 @@ class Heffte(CMakePackage, CudaPackage, ROCmPackage):
"""Highly Efficient FFT for Exascale"""
homepage = "https://github.com/icl-utk-edu/heffte/"
url = "https://github.com/icl-utk-edu/heffte/archive/refs/tags/v2.3.0.tar.gz"
url = "https://github.com/icl-utk-edu/heffte/archive/refs/tags/v2.4.0.tar.gz"
git = "https://github.com/icl-utk-edu/heffte/"
maintainers("mkstoyanov", "G-Ragghianti")
@ -19,6 +19,7 @@ class Heffte(CMakePackage, CudaPackage, ROCmPackage):
test_requires_compiler = True
version("develop", branch="master")
version("2.4.0", sha256="02310fb4f9688df02f7181667e61c3adb7e38baf79611d80919d47452ff7881d")
version("2.3.0", sha256="63db8c9a8822211d23e29f7adf5aa88bb462c91d7a18c296c3ef3a06be8d6171")
version("2.2.0", sha256="332346d5c1d1032288d09839134c79e4a9704e213a2d53051e96c3c414c74df0")
version("2.1.0", sha256="63b8ea45a220afc4fa0b14769c0dd291e614a2fe9d5a91c50d28f16ee29b3f1c")
@ -27,29 +28,13 @@ class Heffte(CMakePackage, CudaPackage, ROCmPackage):
sha256="b575fafe19a635265904ca302d48e778341b1567c055ea7f2939c8c6718f7212",
deprecated=True,
)
version(
"1.0",
sha256="00e66cdff664ba90eeb26b4824f2a7341ba791b1d7220ece8180aba7623d36d5",
deprecated=True,
)
version(
"0.2",
sha256="6e606aa9de91912925ec49f463de4369459e509e0e21a97ca72dfa07651056e5",
deprecated=True,
)
version(
"0.1",
sha256="bcdc940c4cb254b178446d16c969b85ea6b5c69fdf4b6332bb3c8fbce00bccdf",
deprecated=True,
)
patch("threads10.patch", when="@1.0")
patch("fortran200.patch", when="@2.0.0")
patch("cmake-magma-v230.patch", when="@2.3.0")
patch("fortran200.patch", when="@2.0.0")
depends_on("cmake@3.10:", type=("build", "run"))
depends_on("cmake@3.19:", when="@develop", type=("build", "run"))
depends_on("cmake@3.21:", when="@develop+rocm", type=("build", "run"))
depends_on("cmake@3.10:", when="@:2.3.0", type=("build", "run"))
depends_on("cmake@3.19:", when="@2.4.0:", type=("build", "run"))
depends_on("cmake@3.21:", when="@2.4.0:+rocm", type=("build", "run"))
variant("shared", default=True, description="Builds with shared libraries")
variant("fftw", default=False, description="Builds with support for FFTW backend")
@ -64,14 +49,9 @@ class Heffte(CMakePackage, CudaPackage, ROCmPackage):
depends_on("py-numba", when="+python+cuda", type=("build", "run"))
extends("python", when="+python", type=("build", "run"))
conflicts("~fftw", when="@:2.1.0~mkl~cuda") # requires at least one backend
conflicts("+fftw", when="+mkl@:1.0") # old API supports at most one CPU backend
conflicts("^openmpi~cuda", when="+cuda") # +cuda requires CUDA enabled OpenMPI
conflicts("~cuda~rocm", when="+magma") # magma requires CUDA or HIP
conflicts("+rocm", when="@:2.1.0") # heffte+rocm is in in development in spack
conflicts("+python", when="@:1.0") # python support was added post v1.0
conflicts("+fortran", when="@:1.0") # fortran support was added post v1.0
conflicts("+magma", when="@:1.0") # magma support was added post v1.0
depends_on("mpi", type=("build", "run"))
@ -80,8 +60,8 @@ class Heffte(CMakePackage, CudaPackage, ROCmPackage):
depends_on("cuda@8.0:", when="+cuda", type=("build", "run"))
depends_on("hip@3.8.0:", when="+rocm", type=("build", "run"))
depends_on("rocfft@3.8.0:", when="+rocm", type=("build", "run"))
depends_on("hip@5.2.3:", when="@develop+rocm", type=("build", "run"))
depends_on("rocfft@5.2.3:", when="@develop+rocm", type=("build", "run"))
depends_on("hip@5.2.3:", when="@2.4.0:+rocm", type=("build", "run"))
depends_on("rocfft@5.2.3:", when="@2.4.0:+rocm", type=("build", "run"))
depends_on("magma@2.5.3:", when="+cuda+magma", type=("build", "run"))
depends_on("magma+rocm@2.6.1:", when="+magma+rocm @2.1:", type=("build", "run"))
depends_on("rocblas@3.8:", when="+magma+rocm", type=("build", "run"))
@ -94,6 +74,7 @@ class Heffte(CMakePackage, CudaPackage, ROCmPackage):
def cmake_args(self):
args = [
"-DHeffte_SEQUENTIAL_TESTING=ON",
"-DHeffte_ENABLE_TESTING=ON",
self.define_from_variant("BUILD_SHARED_LIBS", "shared"),
self.define_from_variant("Heffte_ENABLE_CUDA", "cuda"),
self.define_from_variant("Heffte_ENABLE_ROCM", "rocm"),
@ -146,22 +127,26 @@ def test_make_test(self):
cmake_dir = self.test_suite.current_test_cache_dir.testing
options = [cmake_dir]
options.append(self.define("Heffte_DIR", self.spec.prefix.lib.cmake.Heffte))
if "+rocm" in self.spec:
# path name is 'hsa-runtime64' but python cannot have '-' in variable name
hsa_runtime = join_path(self.spec["hsa-rocr-dev"].prefix.lib.cmake, "hsa-runtime64")
options.extend(
[
f"-Dhip_DIR={self.spec['hip'].prefix.lib.cmake.hip}",
"-DAMDDeviceLibs_DIR="
+ f"{self.spec['llvm-amdgpu'].prefix.lib.cmake.AMDDeviceLibs}",
f"-Damd_comgr_DIR={self.spec['comgr'].prefix.lib.cmake.amd_comgr}",
"-Dhsa-runtime64_DIR="
+ f"{self.spec['hsa-rocr-dev'].prefix.lib.cmake.hsa-runtime64}",
"-DHSA_HEADER={self.spec['hsa-rocr-dev'].prefix.include}",
"-Drocfft_DIR={self.spec['rocfft'].prefix.lib.cmake.rocfft}",
self.define("hip_DIR", self.spec["hip"].prefix.lib.cmake.hip),
self.define(
"AMDDeviceLibs_DIR",
self.spec["llvm-amdgpu"].prefix.lib.cmake.AMDDeviceLibs,
),
self.define("amd_comgr_DIR", self.spec["comgr"].prefix.lib.cmake.amd_comgr),
self.define("hsa-runtime64_DIR", hsa_runtime),
self.define("HSA_HEADER", self.spec["hsa-rocr-dev"].prefix.include),
self.define("rocfft_DIR", self.spec["rocfft"].prefix.lib.cmake.rocfft),
]
)
# Provide the root directory of the MPI installation.
options.append(f"-DMPI_HOME={self.spec['mpi'].prefix}")
options.append(self.define("MPI_HOME", self.spec["mpi"].prefix))
cmake = which(self.spec["cmake"].prefix.bin.cmake)
cmake(*options)

View file

@ -1,13 +0,0 @@
diff --git a/cmake/HeffteConfig.cmake b/cmake/HeffteConfig.cmake
index bd67de9..ca06086 100644
--- a/cmake/HeffteConfig.cmake
+++ b/cmake/HeffteConfig.cmake
@@ -19,6 +19,8 @@ if (NOT TARGET MPI::MPI_CXX)
find_package(MPI REQUIRED)
endif()
+find_package(Threads)
+
if ("@BUILD_SHARED_LIBS@")
set(Heffte_SHARED_FOUND "ON")
else()