From 02320b18f32e9119e83ba620bf19a2bd8265564d Mon Sep 17 00:00:00 2001 From: Satish Balay Date: Sun, 15 Sep 2024 13:30:55 -0500 Subject: [PATCH] petsc, mfem: update rocm dependency (#46324) * petsc: configure requires rocm-core/rocm_version.h to detect ROCM_VERSION_MAJOR.ROCM_VERSION_MINOR.ROCM_VERSION_PATCH * mfem: add dependency on rocprim (as needed via petsc dependency) In file included from linalg/petsc.cpp:19: In file included from linalg/linalg.hpp:65: In file included from linalg/petsc.hpp:48: In file included from /scratch/svcpetsc/spack.x/opt/spack/linux-ubuntu22.04-x86_64/gcc-11.4.0/petsc-3.22.0-7dsxwizo24ycnqvwnsscupuh4i7yusrh/include/petscsystypes.h:530: In file included from /scratch/svcpetsc/spack.x/opt/spack/linux-ubuntu22.04-x86_64/gcc-11.4.0/rocthrust-6.1.2-ux5nmi4utw27oaqmz3sfjmhb6hyt5zed/include/thrust/complex.h:30: /scratch/svcpetsc/spack.x/opt/spack/linux-ubuntu22.04-x86_64/gcc-11.4.0/rocthrust-6.1.2-ux5nmi4utw27oaqmz3sfjmhb6hyt5zed/include/thrust/detail/type_traits.h:29:10: fatal error: 'rocprim/detail/match_result_type.hpp' file not found 29 | #include | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- var/spack/repos/builtin/packages/mfem/package.py | 3 +++ var/spack/repos/builtin/packages/petsc/package.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/mfem/package.py b/var/spack/repos/builtin/packages/mfem/package.py index 8efa3fbb3f9..df419c1423c 100644 --- a/var/spack/repos/builtin/packages/mfem/package.py +++ b/var/spack/repos/builtin/packages/mfem/package.py @@ -973,6 +973,9 @@ def find_optional_library(name, prefix): if "^rocthrust" in spec and not spec["hip"].external: # petsc+rocm needs the rocthrust header path hip_headers += spec["rocthrust"].headers + if "^rocprim" in spec and not spec["hip"].external: + # rocthrust [via petsc+rocm] has a dependency on rocprim + hip_headers += spec["rocprim"].headers if "^hipblas" in spec and not spec["hip"].external: # superlu-dist+rocm needs the hipblas header path hip_headers += spec["hipblas"].headers diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py index af2d225246c..ae06e55a128 100644 --- a/var/spack/repos/builtin/packages/petsc/package.py +++ b/var/spack/repos/builtin/packages/petsc/package.py @@ -253,6 +253,7 @@ def check_fortran_compiler(self): depends_on("hip", when="+rocm") with when("+rocm"): + depends_on("rocm-core") depends_on("hipblas") depends_on("hipsparse") depends_on("hipsolver") @@ -602,7 +603,7 @@ def configure_options(self): hip_arch = spec.variants["amdgpu_target"].value options.append("--with-hip-arch={0}".format(hip_arch[0])) hip_pkgs = ["hipsparse", "hipblas", "hipsolver", "rocsparse", "rocsolver", "rocblas"] - hip_ipkgs = hip_pkgs + ["rocthrust", "rocprim"] + hip_ipkgs = hip_pkgs + ["rocthrust", "rocprim", "rocm-core"] hip_lpkgs = hip_pkgs if spec.satisfies("^rocrand@5.1:"): hip_ipkgs.extend(["rocrand"])