archpkgs/python-pytorch-rocm/nccl_version.patch
Gabriel Ebner d5c96a7fd9 git subrepo clone https://github.com/rocm-arch/python-pytorch-rocm
subrepo:
  subdir:   "python-pytorch-rocm"
  merged:   "bc28dc1"
upstream:
  origin:   "https://github.com/rocm-arch/python-pytorch-rocm"
  branch:   "master"
  commit:   "bc28dc1"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"
2021-01-14 18:48:07 +01:00

26 lines
1.2 KiB
Diff

diff --git a/cmake/Modules/FindNCCL.cmake b/cmake/Modules/FindNCCL.cmake
index a16c9aca67..51eb54f14c 100644
--- a/cmake/Modules/FindNCCL.cmake
+++ b/cmake/Modules/FindNCCL.cmake
@@ -55,9 +55,10 @@ if(NCCL_FOUND) # obtaining NCCL version and some sanity checks
set (OLD_CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES})
list (APPEND CMAKE_REQUIRED_INCLUDES ${NCCL_INCLUDE_DIRS})
include(CheckCXXSymbolExists)
- check_cxx_symbol_exists(NCCL_VERSION_CODE nccl.h NCCL_VERSION_DEFINED)
+ set(NCCL_VERSION_CODE $ENV{NCCL_VER_CODE})
+ set(NCCL_VERSION_DEFINED $ENV{NCCL_VER_CODE})
- if (NCCL_VERSION_DEFINED)
+ if (DEFINED NCCL_VERSION_DEFINED)
set(file "${PROJECT_BINARY_DIR}/detect_nccl_version.cc")
file(WRITE ${file} "
#include <iostream>
@@ -72,6 +73,7 @@ if(NCCL_FOUND) # obtaining NCCL version and some sanity checks
}
")
try_run(NCCL_VERSION_MATCHED compile_result ${PROJECT_BINARY_DIR} ${file}
+ CMAKE_FLAGS -DINCLUDE_DIRECTORIES=/opt/cuda/include
RUN_OUTPUT_VARIABLE NCCL_VERSION_FROM_HEADER
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${NCCL_INCLUDE_DIRS}"
LINK_LIBRARIES ${NCCL_LIBRARIES})