From 11f78df04d750bcfe618f4f0d77cf00d7d62ffb9 Mon Sep 17 00:00:00 2001 From: Gilbert Lee Date: Thu, 16 May 2019 21:39:39 +0000 Subject: [PATCH] Reducing scope of linker flags to rccl target to avoid warnings --- CMakeLists.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bc0b59fb5d..fec673021b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,11 +68,6 @@ list(APPEND CMAKE_PREFIX_PATH find_package(hip REQUIRED) -link_libraries(-amdgpu-target=gfx803 - -amdgpu-target=gfx900 - -amdgpu-target=gfx906 - -hc-function-calls) - option(BUILD_SHARED_LIBS "Build as a shared library" ON) configure_file(src/nccl.h.in ${PROJECT_BINARY_DIR}/rccl.h) @@ -138,6 +133,12 @@ if(TRACE) add_definitions(-DENABLE_TRACE) endif() +target_link_libraries(rccl + PRIVATE -amdgpu-target=gfx803 + PRIVATE -amdgpu-target=gfx900 + PRIVATE -amdgpu-target=gfx906 + PRIVATE -hc-function-calls) + if(TARGET hip::device) target_link_libraries(rccl PRIVATE hip::device) target_link_libraries(rccl INTERFACE hip::host)