From 689bdd6f36242a2c2dc715dd89322f2f10ad015e Mon Sep 17 00:00:00 2001 From: eugeneswalker <38933153+eugeneswalker@users.noreply.github.com> Date: Tue, 31 Jan 2023 12:51:02 -0600 Subject: 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 --- .../repos/builtin/packages/strumpack/package.py | 4 ++++ .../strumpack/strumpack-7.0.1-mpich-hipcc.patch | 26 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 var/spack/repos/builtin/packages/strumpack/strumpack-7.0.1-mpich-hipcc.patch (limited to 'var') diff --git a/var/spack/repos/builtin/packages/strumpack/package.py b/var/spack/repos/builtin/packages/strumpack/package.py index 39b9c62700..216b16dc55 100644 --- a/var/spack/repos/builtin/packages/strumpack/package.py +++ b/var/spack/repos/builtin/packages/strumpack/package.py @@ -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 @@ class Strumpack(CMakePackage, CudaPackage, ROCmPackage): 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 = [] diff --git a/var/spack/repos/builtin/packages/strumpack/strumpack-7.0.1-mpich-hipcc.patch b/var/spack/repos/builtin/packages/strumpack/strumpack-7.0.1-mpich-hipcc.patch new file mode 100644 index 0000000000..96826646a4 --- /dev/null +++ b/var/spack/repos/builtin/packages/strumpack/strumpack-7.0.1-mpich-hipcc.patch @@ -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) -- cgit v1.2.3-60-g2f50