未验证 提交 404566e4 编写于 作者: C Chen Weihang 提交者: GitHub

move nccl.h find code to avoid cmake error (#25589)

上级 e3736d73
...@@ -7,14 +7,14 @@ if(WIN32) ...@@ -7,14 +7,14 @@ if(WIN32)
return() return()
endif() endif()
set(NCCL_ROOT "/usr" CACHE PATH "NCCL ROOT") if(WITH_NCCL)
find_path(NCCL_INCLUDE_DIR nccl.h set(NCCL_ROOT "/usr" CACHE PATH "NCCL ROOT")
find_path(NCCL_INCLUDE_DIR nccl.h
PATHS ${NCCL_ROOT} ${NCCL_ROOT}/include ${NCCL_ROOT}/local/include PATHS ${NCCL_ROOT} ${NCCL_ROOT}/include ${NCCL_ROOT}/local/include
$ENV{NCCL_ROOT} $ENV{NCCL_ROOT}/include $ENV{NCCL_ROOT}/local/include $ENV{NCCL_ROOT} $ENV{NCCL_ROOT}/include $ENV{NCCL_ROOT}/local/include
NO_DEFAULT_PATH NO_DEFAULT_PATH
) )
if(WITH_NCCL)
file(READ ${NCCL_INCLUDE_DIR}/nccl.h NCCL_VERSION_FILE_CONTENTS) file(READ ${NCCL_INCLUDE_DIR}/nccl.h NCCL_VERSION_FILE_CONTENTS)
string(REGEX MATCH "define NCCL_VERSION_CODE +([0-9]+)" string(REGEX MATCH "define NCCL_VERSION_CODE +([0-9]+)"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册