Skip to content

Commit 198563a

Browse files
agunasheclaude
andauthored
rocclr: Prioritize local rocr-runtime headers over system paths (#5936)
Fixes build errors where CMake finds outdated HSA headers in system paths instead of the local rocr-runtime Changes applied to windows builds using ROCclrHSA.cmake: - Reorder find_path/find_package to search local rocr-runtime first - Add NO_DEFAULT_PATH to prevent system path searches - Covers Windows (AMD_COMPUTE_WIN) ## Motivation when building hip, the headers and libs should be obtained locally first then at the system level. User can have multiple rocms installed at system level. During hip build, user expects the local rocr/hsa to be picked first ## Technical Details changing the search order of rocr headers and libs, so the expected Libs/headers are picked for the hip build ## JIRA ID NA ## Test Plan Rock build passes and local hip build passes ## Test Result Rock build passes and local hip build passes ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests. --------- Co-authored-by: Claude Sonnet 4 <noreply@anthropic.com>
1 parent 61f05b2 commit 198563a

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

projects/clr/rocclr/cmake/ROCclrHSA.cmake

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,21 @@
44

55
if (AMD_COMPUTE_WIN)
66
find_path(AMD_HSA_INCLUDE_DIR hsa.h
7-
HINTS
7+
PATHS
8+
${ROCCLR_SRC_DIR}/../../rocr-runtime/runtime/hsa-runtime/inc
89
${ROCCLR_SRC_DIR}/../../rocr-runtime/runtime/hsa-runtime
10+
${CMAKE_CURRENT_BINARY_DIR}/../../rocr/inc
11+
${CMAKE_CURRENT_BINARY_DIR}/../../rocr
12+
${CMAKE_CURRENT_BINARY_DIR}/../..
13+
${CMAKE_CURRENT_BINARY_DIR}/..
14+
${CMAKE_CURRENT_BINARY_DIR}
915
${ROCM_PATH}
1016
${ROCM_INSTALL_PATH}
11-
${CMAKE_CURRENT_BINARY_DIR}
12-
PATHS
13-
${CMAKE_CURRENT_BINARY_DIR}/..
14-
${CMAKE_CURRENT_BINARY_DIR}/../..
15-
${CMAKE_CURRENT_BINARY_DIR}/../../rocr
1617
PATH_SUFFIXES
1718
include
1819
include/hsa
19-
inc)
20+
inc
21+
NO_DEFAULT_PATH)
2022
message("Roc CLR: " ${ROCCLR_SRC_DIR} "; HSA headers:" ${AMD_HSA_INCLUDE_DIR})
2123
target_include_directories(rocclr PUBLIC ${AMD_HSA_INCLUDE_DIR})
2224
target_include_directories(rocclr PUBLIC ${AMD_HSA_INCLUDE_DIR}/..)

0 commit comments

Comments
 (0)