Skip to content

Commit 10155d7

Browse files
authored
Add --hip-link to target_id check (#275)
* Add --hip-link to target_id check The new driver in clang does not automatically link against the HIP libraries, so we need to add a --hip-link option here to enforce linking. Otherwise we'll get an error on the link stem of check_cxx_compiler_flag() when calling with "-xhip" and "--offload-arch" Note: The link step isn't really needed for this use case, as invalid targets will fail the compilation step. But check_cxx_compiler_flag() performs both compiling and linking by default * Update test.yml
1 parent 03bf7eb commit 10155d7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
with:
1212
access_token: ${{ github.token }}
1313
lint:
14-
runs-on: ubuntu-20.04
14+
runs-on: ubuntu-24.04
1515
steps:
1616
- uses: actions/checkout@v1
1717
- name: Set up Python 3.10
@@ -32,8 +32,8 @@ jobs:
3232
max-parallel: 4
3333
matrix:
3434
platform:
35-
- ubuntu-20.04
36-
- windows-2019
35+
- ubuntu-24.04
36+
- windows-2022
3737
cmake-version:
3838
- 3.31.0
3939
- 3.22.1

share/rocmcmakebuildtools/cmake/ROCMCheckTargetIds.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ function(rocm_check_target_ids VARIABLE)
2121
foreach(_target_id ${PARSE_TARGETS})
2222
_rocm_sanitize_target_id("${_target_id}" _result_var)
2323
set(_result_var "COMPILER_HAS_TARGET_ID_${_result_var}")
24+
set(CMAKE_REQUIRED_LINK_OPTIONS "--hip-link")
2425
check_cxx_compiler_flag("-xhip --offload-arch=${_target_id}" "${_result_var}")
2526
if(${_result_var})
2627
list(APPEND _supported_target_ids "${_target_id}")

0 commit comments

Comments
 (0)