From 35950c4dde098c2a3621f38b1a8312a737f495d6 Mon Sep 17 00:00:00 2001 From: Giuseppe Congiu Date: Wed, 28 Jun 2023 10:23:15 +0200 Subject: [PATCH] rocm: user HIP_PATH for hipcc compiler in tests Makefile The rocm tests assume hipcc is located under the same root directory as the rest of rocm toolkit software. Spack installs rocm dependencies in separate directories however, which breaks this assumption. This patch introduces a HIP_PATH variable that, if unset, is set automatically to PAPI_ROCM_ROOT. Spack can use this variable to let the tests Makefile in the PAPI rocm component know where the hipcc compiler is located. --- src/components/rocm/tests/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/rocm/tests/Makefile b/src/components/rocm/tests/Makefile index f659cfe2c..08d369d3e 100644 --- a/src/components/rocm/tests/Makefile +++ b/src/components/rocm/tests/Makefile @@ -1,9 +1,10 @@ NAME = rocm include ../../Makefile_comp_tests.target PAPI_ROCM_ROOT ?= /opt/rocm +HIP_PATH ?= $(PAPI_ROCM_ROOT)/hip -CC = $(PAPI_ROCM_ROOT)/hip/bin/hipcc -CXX = $(PAPI_ROCM_ROOT)/hip/bin/hipcc +CC = $(HIP_PATH)/bin/hipcc +CXX = $(HIP_PATH)/bin/hipcc CPPFLAGS+= -I$(PAPI_ROCM_ROOT)/include \ -I$(PAPI_ROCM_ROOT)/include/hip \ -I$(PAPI_ROCM_ROOT)/include/hsa \