Skip to content

Commit c7f020f

Browse files
ScottToddjammm
andauthored
[windows] Fix FindHIP.cmake search for hipconfig. (#583)
Fixes #526. Upstream PR: ROCm/hip#3789. * The `find_path` here is looking for the directory containing `hipconfig`. On Windows, `hipconfig` has the `.exe` suffix. * The `_EXECUTABLE` code has the option of `.bat` or `exe` suffixes for `hipcc` and `hipconfig` as both versions exist. CMake's `find_program` only finds the `.exe` versions, so that code should not append `.bat` onto the `.exe` (e.g. `hipconfig.exe.bat`). --------- Co-authored-by: Aaryaman Vasishta <[email protected]>
1 parent fe51756 commit c7f020f

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
From 027cb4a11e2b6c47606308b01e8180507496701d Mon Sep 17 00:00:00 2001
2+
From: Aaryaman Vasishta <[email protected]>
3+
Date: Tue, 6 May 2025 15:07:26 +0530
4+
Subject: [PATCH] Fix FindHIP.cmake search for hipconfig.
5+
6+
---
7+
cmake/FindHIP.cmake | 11 ++---------
8+
1 file changed, 2 insertions(+), 9 deletions(-)
9+
10+
diff --git a/cmake/FindHIP.cmake b/cmake/FindHIP.cmake
11+
index 422b7089..a93e839f 100644
12+
--- a/cmake/FindHIP.cmake
13+
+++ b/cmake/FindHIP.cmake
14+
@@ -99,7 +99,7 @@ if(NOT APPLE)
15+
# Search in user specified path first
16+
find_path(
17+
HIP_ROOT_DIR
18+
- NAMES bin/hipconfig
19+
+ NAMES bin/hipconfig${CMAKE_EXECUTABLE_SUFFIX}
20+
PATHS
21+
"$ENV{ROCM_PATH}"
22+
"$ENV{ROCM_PATH}/hip"
23+
@@ -134,6 +134,7 @@ if(NOT APPLE)
24+
# Now search in default paths
25+
find_program(HIP_HIPCC_EXECUTABLE hipcc)
26+
endif()
27+
+ mark_as_advanced(HIP_HIPCC_EXECUTABLE)
28+
29+
# Find HIPCONFIG executable
30+
find_program(
31+
@@ -150,15 +151,7 @@ if(NOT APPLE)
32+
# Now search in default paths
33+
find_program(HIP_HIPCONFIG_EXECUTABLE hipconfig)
34+
endif()
35+
- if(NOT UNIX)
36+
- get_filename_component(HIPCONFIG_EXECUTABLE_EXT ${HIP_HIPCONFIG_EXECUTABLE} EXT)
37+
- if(NOT HIPCONFIG_EXECUTABLE_EXT STREQUAL ".bat")
38+
- set(HIP_HIPCONFIG_EXECUTABLE "${HIP_HIPCONFIG_EXECUTABLE}.bat")
39+
- set(HIP_HIPCC_EXECUTABLE "${HIP_HIPCC_EXECUTABLE}.bat")
40+
- endif()
41+
- endif()
42+
mark_as_advanced(HIP_HIPCONFIG_EXECUTABLE)
43+
- mark_as_advanced(HIP_HIPCC_EXECUTABLE)
44+
45+
# Find HIPCC_CMAKE_LINKER_HELPER executable
46+
find_program(
47+
--
48+
2.47.1.windows.2
49+

0 commit comments

Comments
 (0)