You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 26, 2024. It is now read-only.
hipcc compile command:hipcc main.c
error output during compile test file: /usr/bin/ld: /workspace/install/Debug/rocm/lib/libamdhip64.so: undefined reference to __hip_pch' /usr/bin/ld: /workspace/install/Debug/rocm/lib/libamdhip64.so: undefined reference to __hip_pch_size
I found that the hip_pch.o would not be generated in correct CMAKE_BINARY_DIR when building hipcc executable.
The follow patch can fix this problem. Pull Request Here
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f81296d3..1fbd355c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -181,7 +181,11 @@ if(__HIP_ENABLE_PCH)
set(HIP_LLVM_ROOT "${LLVM_DIR}/../../..")
endif()
- execute_process(COMMAND sh -c "${HIP_COMMON_BIN_DIR}/hip_embed_pch.sh ${HIP_COMMON_INCLUDE_DIR} ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/include ${HIP_LLVM_ROOT}" COMMAND_ECHO STDERR RESULT_VARIABLE EMBED_PCH_RC)
+ execute_process(COMMAND sh -c "${HIP_COMMON_BIN_DIR}/hip_embed_pch.sh ${HIP_COMMON_INCLUDE_DIR} ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/include ${HIP_LLVM_ROOT}"
+ COMMAND_ECHO STDERR
+ RESULT_VARIABLE EMBED_PCH_RC
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
+
if (EMBED_PCH_RC AND NOT EMBED_PCH_RC EQUAL 0)
message(FATAL_ERROR "Failed to embed PCH")
endif()