This is an automated email from the ASF dual-hosted git repository.

lausen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new 8bdf068  cmake: guess location of nvcc if it can't be found (#17293)
8bdf068 is described below

commit 8bdf06832d032c2b4776150908363560144a6599
Author: Pedro Larroy <pedro.larroy.li...@gmail.com>
AuthorDate: Tue Feb 25 11:45:58 2020 -0800

    cmake: guess location of nvcc if it can't be found (#17293)
    
    * [Build] Add a reasonable default for CMAKE_CUDA_COMPILER in *nix
    
    * CR
    
    * CR
    
    * Update as per CR comments
    
    * include(CheckLanguage)
    
    Co-authored-by: Leonard Lausen <leon...@lausen.nl>
---
 CMakeLists.txt | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3cee091..4731663 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -87,6 +87,12 @@ message(STATUS "CMake version '${CMAKE_VERSION}' using 
generator '${CMAKE_GENERA
 project(mxnet C CXX)
 if(USE_CUDA)
   cmake_minimum_required(VERSION 3.13.2)  # CUDA 10 (Turing) detection 
available starting 3.13.2
+  include(CheckLanguage)
+  check_language(CUDA)
+  if (NOT CMAKE_CUDA_COMPILER_LOADED AND UNIX AND EXISTS 
"/usr/local/cuda/bin/nvcc")
+    set(CMAKE_CUDA_COMPILER "/usr/local/cuda/bin/nvcc")
+    message(WARNING "CMAKE_CUDA_COMPILER guessed: ${CMAKE_CUDA_COMPILER}")
+  endif()
   enable_language(CUDA)
   set(CMAKE_CUDA_STANDARD 11)
   include(CheckCXXCompilerFlag)
@@ -592,7 +598,6 @@ if(USE_CUDA)
 
   string(REPLACE ";" " " CUDA_ARCH_FLAGS_SPACES "${CUDA_ARCH_FLAGS}")
 
-
   find_package(CUDAToolkit REQUIRED cublas cufft cusolver curand
     OPTIONAL_COMPONENTS nvToolsExt nvrtc)
 

Reply via email to