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 has been 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()
The text was updated successfully, but these errors were encountered:
hipamd branch: rocm-5.2.x
working directory: /workspace/
hipamd build command:
That building command executed outside the building_stage dir is leading to this issuse happen.↓↓
After hipcc building is completed, test hipcc function.
hipcc test file: main.c
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
The text was updated successfully, but these errors were encountered: