cmake: respect USE_SYSTEM_LIBS when USE_NCCL is set (#104511)

Even though `USE_SYSTEM_LIBS` is set to true, we still need to set `USE_SYSTEM_NCCL` for the system NCCL to be used.

This fixes that by adding a conditional `set` similar to what is done for `USE_TBB`: e9ebda29d8/CMakeLists.txt (L426-L428)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/104511
Approved by: https://github.com/ezyang
This commit is contained in:
Connor Baker 2023-07-04 19:08:47 +00:00 committed by PyTorch MergeBot
parent 52094a3454
commit e8174faa02

View File

@ -428,6 +428,9 @@ if(USE_SYSTEM_LIBS)
set(USE_SYSTEM_ONNX ON)
set(USE_SYSTEM_XNNPACK ON)
set(USE_SYSTEM_PYBIND11 ON)
if(USE_NCCL)
set(USE_SYSTEM_NCCL ON)
endif()
if(USE_TBB)
set(USE_SYSTEM_TBB ON)
endif()