strumpack +rocm: set CMAKE_CXX_COMPILER to hipcc (#35153)
* strumpack +rocm: set CMAKE_CXX_COMPILER to hipcc * strumpack@7.0.1+rocm^mpich: patch in upstream commit
This commit is contained in:
parent
a426db06e7
commit
689bdd6f36
@ -98,6 +98,9 @@ class Strumpack(CMakePackage, CudaPackage, ROCmPackage):
|
||||
patch("intel-19-compile.patch", when="@3.1.1")
|
||||
patch("shared-rocm.patch", when="@5.1.1")
|
||||
|
||||
# https://github.com/pghysels/STRUMPACK/commit/e4b110b2d823c51a90575b77ec1531c699097a9f
|
||||
patch("strumpack-7.0.1-mpich-hipcc.patch", when="@7.0.1 +rocm ^mpich")
|
||||
|
||||
def cmake_args(self):
|
||||
spec = self.spec
|
||||
|
||||
@ -146,6 +149,7 @@ def cmake_args(self):
|
||||
args.append("-DCUDA_NVCC_FLAGS={0}".format(" ".join(self.cuda_flags(cuda_archs))))
|
||||
|
||||
if "+rocm" in spec:
|
||||
args.append("-DCMAKE_CXX_COMPILER={0}".format(spec["hip"].hipcc))
|
||||
args.append("-DHIP_ROOT_DIR={0}".format(spec["hip"].prefix))
|
||||
rocm_archs = spec.variants["amdgpu_target"].value
|
||||
hipcc_flags = []
|
||||
|
@ -0,0 +1,26 @@
|
||||
diff -ruN spack-src/CMakeLists.txt spack-src-patched/CMakeLists.txt
|
||||
--- spack-src/CMakeLists.txt 2022-10-12 11:48:07.000000000 -0700
|
||||
+++ spack-src-patched/CMakeLists.txt 2023-01-30 13:35:11.271496106 -0800
|
||||
@@ -586,7 +586,8 @@
|
||||
|
||||
if(STRUMPACK_USE_MPI)
|
||||
target_link_libraries(strumpack PUBLIC
|
||||
- MPI::MPI_CXX MPI::MPI_C MPI::MPI_Fortran)
|
||||
+ MPI::MPI_CXX MPI::MPI_C ${MPI_Fortran_LIBRARIES})
|
||||
+ ## adding the MPI::MPI_Fortran target risks adding unwanted compile flags
|
||||
endif()
|
||||
|
||||
if(OpenMP_FOUND)
|
||||
@@ -654,11 +655,7 @@
|
||||
ButterflyPACK::sbutterflypack
|
||||
ButterflyPACK::dbutterflypack
|
||||
ButterflyPACK::cbutterflypack
|
||||
- ButterflyPACK::zbutterflypack
|
||||
- MPI::MPI_Fortran ${MPI_Fortran_LIBRARIES})
|
||||
- ## for some reason just adding the MPI::MPI_Fortran target only
|
||||
- ## links with the f08 module, not with the regular fortran MPI
|
||||
- ## library
|
||||
+ ButterflyPACK::zbutterflypack)
|
||||
endif()
|
||||
|
||||
if(slate_FOUND)
|
Loading…
Reference in New Issue
Block a user