pytorch/cmake/External/rccl.cmake
Akash Patel 644d787cd8 find rccl properly (#42072)
Summary:
Fixes #{issue number}

Pull Request resolved: https://github.com/pytorch/pytorch/pull/42072

Reviewed By: malfet

Differential Revision: D22969778

Pulled By: ezyang

fbshipit-source-id: 509178775d4d99460bcb147bcfced29f04cabdc4
2020-08-05 21:46:38 -07:00

19 lines
621 B
CMake

if(NOT __NCCL_INCLUDED)
set(__NCCL_INCLUDED TRUE)
if(USE_SYSTEM_NCCL)
# NCCL_ROOT, NCCL_LIB_DIR, NCCL_INCLUDE_DIR will be accounted in the following line.
find_package(rccl REQUIRED)
if(rccl_FOUND)
message(STATUS "RCCL Found!")
add_library(__caffe2_nccl INTERFACE)
target_link_libraries(__caffe2_nccl INTERFACE ${PYTORCH_RCCL_LIBRARIES})
target_include_directories(__caffe2_nccl INTERFACE ${RCCL_INCLUDE_DIRS})
else()
message(STATUS "RCCL NOT Found!")
endif()
else()
message(STATUS "USE_SYSTEM_NCCL=OFF is not supported yet when using RCCL")
endif()
endif()