From 2e18fbbdeb29385ce50078eff3a4701a45a3f656 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Tue, 19 Dec 2023 08:14:19 -0700 Subject: legion: do not set HIP_PATH env variable (#41660) * legion: do not set HIP_PATH env variable * flecsi: workaround Legion CMake for +rocm --- var/spack/repos/builtin/packages/flecsi/package.py | 3 +++ var/spack/repos/builtin/packages/legion/package.py | 6 +----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/var/spack/repos/builtin/packages/flecsi/package.py b/var/spack/repos/builtin/packages/flecsi/package.py index e10dfd88cf..2fd13d56b1 100644 --- a/var/spack/repos/builtin/packages/flecsi/package.py +++ b/var/spack/repos/builtin/packages/flecsi/package.py @@ -186,6 +186,9 @@ class Flecsi(CMakePackage, CudaPackage, ROCmPackage): if "+rocm" in self.spec: options.append(self.define("CMAKE_CXX_COMPILER", self.spec["hip"].hipcc)) options.append(self.define("CMAKE_C_COMPILER", self.spec["hip"].hipcc)) + if "backend=legion" in self.spec: + # CMake pulled in via find_package(Legion) won't work without this + options.append(self.define("HIP_PATH", "{0}/hip".format(spec["hip"].prefix))) elif "+kokkos" in self.spec: options.append(self.define("CMAKE_CXX_COMPILER", self.spec["kokkos"].kokkos_cxx)) else: diff --git a/var/spack/repos/builtin/packages/legion/package.py b/var/spack/repos/builtin/packages/legion/package.py index 152aac297f..156eb24ef8 100644 --- a/var/spack/repos/builtin/packages/legion/package.py +++ b/var/spack/repos/builtin/packages/legion/package.py @@ -277,11 +277,6 @@ class Legion(CMakePackage, ROCmPackage): description="Maximum number of nodes supported by Legion.", ) - def setup_build_environment(self, build_env): - spec = self.spec - if "+rocm" in spec: - build_env.set("HIP_PATH", "{0}/hip".format(spec["hip"].prefix)) - def cmake_args(self): spec = self.spec cmake_cxx_flags = [] @@ -353,6 +348,7 @@ class Legion(CMakePackage, ROCmPackage): options.append(from_variant("Legion_HIP_TARGET", "hip_target")) options.append(from_variant("Legion_HIP_ARCH", "amdgpu_target")) options.append(from_variant("Legion_HIJACK_HIP", "hip_hijack")) + options.append(self.define("HIP_PATH", "{0}/hip".format(spec["hip"].prefix))) if "+fortran" in spec: # default is off. -- cgit v1.2.3-70-g09d2