Skip to content

Commit 6b132e5

Browse files
committed
Fix FindNCCL.cmake
Fix search paths for headers and libs Use NCCL_LIBRARY instead of NCCL_LIBRARIES - stylistic, matches Simon's code
1 parent 4ff8e07 commit 6b132e5

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

cmake/Dependencies.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,5 +184,5 @@ endif()
184184
if(NCCL_FOUND)
185185
add_definitions(-DUSE_NCCL)
186186
include_directories(SYSTEM ${NCCL_INCLUDE})
187-
list(APPEND Caffe_LINKER_LIBS ${NCCL_LIBRARIES})
187+
list(APPEND Caffe_LINKER_LIBS ${NCCL_LIBRARY})
188188
endif()

cmake/Modules/FindNCCL.cmake

+9-6
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,20 @@
66
# The following are set after configuration is done:
77
# NCCL_FOUND
88
# NCCL_INCLUDE_DIR
9-
# NCCL_LIBRARIES
9+
# NCCL_LIBRARY
1010

11-
find_path(NCCL_INCLUDE_DIR NAMES nccl.h PATHS ${NCCL_ROOT_DIR})
11+
find_path(NCCL_INCLUDE_DIR NAMES nccl.h
12+
PATHS ${NCCL_ROOT_DIR}/include
13+
)
1214

13-
find_library(NCCL_LIBRARIES NAMES nccl PATHS ${NCCL_ROOT_DIR})
15+
find_library(NCCL_LIBRARY NAMES nccl
16+
PATHS ${NCCL_ROOT_DIR}/lib ${NCCL_ROOT_DIR}/lib64)
1417

1518
include(FindPackageHandleStandardArgs)
16-
find_package_handle_standard_args(NCCL DEFAULT_MSG NCCL_INCLUDE_DIR NCCL_LIBRARIES)
19+
find_package_handle_standard_args(NCCL DEFAULT_MSG NCCL_INCLUDE_DIR NCCL_LIBRARY)
1720

1821
if(NCCL_FOUND)
19-
message(STATUS "Found NCCL (include: ${NCCL_INCLUDE_DIR}, library: ${NCCL_LIBRARIES})")
20-
mark_as_advanced(NCCL_INCLUDE_DIR NCCL_LIBRARIES)
22+
message(STATUS "Found NCCL (include: ${NCCL_INCLUDE_DIR}, library: ${NCCL_LIBRARY})")
23+
mark_as_advanced(NCCL_INCLUDE_DIR NCCL_LIBRARY)
2124
endif()
2225

0 commit comments

Comments
 (0)