diff --git a/var/spack/repos/builtin/packages/mfem/package.py b/var/spack/repos/builtin/packages/mfem/package.py index 52d459e4167..36ec6a8a98b 100644 --- a/var/spack/repos/builtin/packages/mfem/package.py +++ b/var/spack/repos/builtin/packages/mfem/package.py @@ -282,6 +282,7 @@ class Mfem(Package, CudaPackage, ROCmPackage): depends_on("mpi", when="+mpi") depends_on("hipsparse", when="@4.4.0:+rocm") + depends_on("hipblas", when="@4.4.0:+rocm") with when("+mpi"): depends_on("hypre") @@ -986,9 +987,10 @@ def find_optional_library(name, prefix): 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 + if "^hipblas" in spec: + hipblas = spec["hipblas"] + hip_headers += hipblas.headers + hip_libs += hipblas.libs if "%cce" in spec: # We assume the proper Cray CCE module (cce) is loaded: proc = str(spec.target.family)