Add RCCL Static Lib Creation with -fgpu-rdc
RCCL uses -fgpu-rdc to compile its source objects. When linking
the RCCL static library, the link and archive step must do through
hipcc and uses the flag --emit-static-lib. When compiling
UnitTests, the librccl.a must be consumed through -l and -L.
[ROCm/rccl commit: 958b213428]
This commit is contained in:
@@ -25,7 +25,17 @@ if(BUILD_TESTS)
|
||||
|
||||
add_executable(UnitTests ${TEST_SOURCES})
|
||||
target_include_directories(UnitTests PRIVATE /opt/rocm ${GTEST_INCLUDE_DIRS})
|
||||
target_link_libraries(UnitTests PRIVATE ${GTEST_BOTH_LIBRARIES} PRIVATE rccl)
|
||||
target_link_libraries(UnitTests PRIVATE ${GTEST_BOTH_LIBRARIES})
|
||||
|
||||
# UnitTests using static library of rccl requires passing rccl
|
||||
# through -l and -L instead of command line input.
|
||||
if(BUILD_STATIC)
|
||||
add_dependencies(UnitTests rccl)
|
||||
target_link_libraries(UnitTests PRIVATE dl rt numa -lrccl -L${CMAKE_BINARY_DIR})
|
||||
target_link_libraries(UnitTests PRIVATE amdhip64 amd_comgr hsa-runtime64::hsa-runtime64)
|
||||
else()
|
||||
target_link_libraries(UnitTests PRIVATE rccl)
|
||||
endif()
|
||||
else()
|
||||
message("Not building unit tests")
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user