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:
		| @@ -98,6 +98,9 @@ class Strumpack(CMakePackage, CudaPackage, ROCmPackage): | |||||||
|     patch("intel-19-compile.patch", when="@3.1.1") |     patch("intel-19-compile.patch", when="@3.1.1") | ||||||
|     patch("shared-rocm.patch", when="@5.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): |     def cmake_args(self): | ||||||
|         spec = self.spec |         spec = self.spec | ||||||
| 
 | 
 | ||||||
| @@ -146,6 +149,7 @@ def cmake_args(self): | |||||||
|                 args.append("-DCUDA_NVCC_FLAGS={0}".format(" ".join(self.cuda_flags(cuda_archs)))) |                 args.append("-DCUDA_NVCC_FLAGS={0}".format(" ".join(self.cuda_flags(cuda_archs)))) | ||||||
| 
 | 
 | ||||||
|         if "+rocm" in spec: |         if "+rocm" in spec: | ||||||
|  |             args.append("-DCMAKE_CXX_COMPILER={0}".format(spec["hip"].hipcc)) | ||||||
|             args.append("-DHIP_ROOT_DIR={0}".format(spec["hip"].prefix)) |             args.append("-DHIP_ROOT_DIR={0}".format(spec["hip"].prefix)) | ||||||
|             rocm_archs = spec.variants["amdgpu_target"].value |             rocm_archs = spec.variants["amdgpu_target"].value | ||||||
|             hipcc_flags = [] |             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) | ||||||
		Reference in New Issue
	
	Block a user
	 eugeneswalker
					eugeneswalker