You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by la...@apache.org on 2020/03/05 17:11:55 UTC

[incubator-mxnet] branch master updated: cmake: improve CMAKE_CUDA_COMPILER guessing on unix (#17773)

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 66e4c27  cmake: improve CMAKE_CUDA_COMPILER guessing on unix (#17773)
66e4c27 is described below

commit 66e4c27de6ffa610c185df1563600eadea190d7d
Author: Leonard Lausen <la...@amazon.com>
AuthorDate: Thu Mar 5 09:10:43 2020 -0800

    cmake: improve CMAKE_CUDA_COMPILER guessing on unix (#17773)
    
    Fixes a bug in #17293 causing an infinite loop on some systems.
---
 CMakeLists.txt | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a0b4e37..037a692 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -90,9 +90,10 @@ 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}")
+  if (NOT CMAKE_CUDA_COMPILER AND UNIX AND EXISTS "/usr/local/cuda/bin/nvcc")
+    set(ENV{CUDACXX} "/usr/local/cuda/bin/nvcc")
+    message(WARNING "CMAKE_CUDA_COMPILER guessed: " $ENV{CUDACXX} "\n"
+      "Please fix your cuda installation: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#mandatory-post")
   endif()
   enable_language(CUDA)
   set(CMAKE_CUDA_STANDARD 11)