-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bugfix] Include NCCL as a submodule (dmlc#2934)
* Add NCCL as a submodule * Allow using third_party/nccl or system nccl * Add nccl_external as a dependency * Fix conditional Co-authored-by: Quan (Andy) Gan <[email protected]>
- Loading branch information
1 parent
06b9ec2
commit 66eb240
Showing
4 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
include(ExternalProject) | ||
|
||
# set path to submodule | ||
set(NCCL_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/nccl") | ||
|
||
# NCCL doesn't have CMAKE, so build externally | ||
ExternalProject_Add(nccl_external | ||
SOURCE_DIR ${PROJECT_SOURCE_DIR}/third_party/nccl | ||
BUILD_IN_SOURCE 1 | ||
CONFIGURE_COMMAND "" | ||
BUILD_COMMAND | ||
env | ||
make | ||
"src.build" | ||
"-j" | ||
"BUILDDIR=${NCCL_BUILD_DIR}" | ||
BUILD_BYPRODUCTS "${NCCL_BUILD_DIR}/lib/libnccl_static.a" | ||
INSTALL_COMMAND "" | ||
) | ||
|
||
# set output variables | ||
set(NCCL_FOUND TRUE) | ||
set(NCCL_LIBRARY "${NCCL_BUILD_DIR}/lib/libnccl_static.a") | ||
set(NCCL_INCLUDE_DIR "${NCCL_BUILD_DIR}/include") |