Link Threads::Threads (#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.

[ROCm/rccl-tests commit: 5b27b961b2]
This commit is contained in:
Marius Brehler
2025-04-29 23:18:51 +02:00
committed by GitHub
vanhempi 6d2ec88eec
commit b0b615091e
2 muutettua tiedostoa jossa 1 lisäystä ja 4 poistoa
@@ -124,9 +124,6 @@ endif()
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
##Adding pthread flag for linking
#set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
## Check for HIP
find_package(hip REQUIRED)
message(STATUS "HIP compiler: ${HIP_COMPILER}")
@@ -126,7 +126,7 @@ add_custom_target(git_version_check
add_custom_target(hipify DEPENDS ${HIP_COMMON_SOURCES})
add_library(rccl_common OBJECT ${HIP_COMMON_SOURCES})
add_dependencies(rccl_common hipify git_version_check)
target_link_libraries(rccl_common roc::rccl hip::device)
target_link_libraries(rccl_common roc::rccl hip::device Threads::Threads)
if(USE_MPI)
target_link_libraries(rccl_common MPI::MPI_CXX)
endif()