From ff61324fc83a39f22efe356458cf71e060d89381 Mon Sep 17 00:00:00 2001 From: Leonard Lausen Date: Thu, 5 Mar 2020 03:12:48 +0000 Subject: [PATCH] Update CMakeLists --- CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a0b4e37ad3cf..037a692b70b7 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)