Skip to content

Commit 5b27b96

Browse files
authored
Link Threads::Threads (ROCm#119)
`pthread.h` is included in `src/common.h` but lib is not properly linked, resulting in the build failing with unresolved symbols when trying to link.
1 parent c96deb1 commit 5b27b96

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

‎CMakeLists.txt‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,6 @@ endif()
124124
set(THREADS_PREFER_PTHREAD_FLAG ON)
125125
find_package(Threads REQUIRED)
126126

127-
##Adding pthread flag for linking
128-
#set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
129-
130127
## Check for HIP
131128
find_package(hip REQUIRED)
132129
message(STATUS "HIP compiler: ${HIP_COMPILER}")

‎src/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ add_custom_target(git_version_check
126126
add_custom_target(hipify DEPENDS ${HIP_COMMON_SOURCES})
127127
add_library(rccl_common OBJECT ${HIP_COMMON_SOURCES})
128128
add_dependencies(rccl_common hipify git_version_check)
129-
target_link_libraries(rccl_common roc::rccl hip::device)
129+
target_link_libraries(rccl_common roc::rccl hip::device Threads::Threads)
130130
if(USE_MPI)
131131
target_link_libraries(rccl_common MPI::MPI_CXX)
132132
endif()

0 commit comments

Comments
 (0)