From: Matthias Maier Date: Wed, 16 Aug 2017 14:23:00 +0000 (+0200) Subject: CMake: Make CUDA detection more robust X-Git-Tag: v9.0.0-rc1~1225^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ad55fc81d0f6fcc06896eb5ca70af680ae90c19;p=dealii.git CMake: Make CUDA detection more robust --- diff --git a/cmake/configure/configure_1_cuda.cmake b/cmake/configure/configure_1_cuda.cmake index ca8f42a163..4b514a1f6d 100644 --- a/cmake/configure/configure_1_cuda.cmake +++ b/cmake/configure/configure_1_cuda.cmake @@ -24,6 +24,11 @@ SET(DEAL_II_WITH_CUDA FALSE CACHE BOOL "") MACRO(FEATURE_CUDA_FIND_EXTERNAL var) + # + # TODO: Ultimately, this find_package call is not needed any more. We + # still use it because it is very convenient to (a) check that CUDA is + # installed, (b) get compiler path and include directories / libraries. + # FIND_PACKAGE(CUDA) IF(CUDA_FOUND) @@ -96,6 +101,11 @@ ENDMACRO() MACRO(FEATURE_CUDA_CONFIGURE_EXTERNAL) + # + # Ensure that we enable CMake-internal CUDA support with the right + # compiler: + # + SET(CMAKE_CUDA_COMPILER "${CUDA_NVCC_EXECUTABLE}") ENABLE_LANGUAGE(CUDA) # diff --git a/cmake/modules/FindCUDA.cmake b/cmake/modules/FindCUDA.cmake index 4a30f6f3fa..a093d6e0d8 100644 --- a/cmake/modules/FindCUDA.cmake +++ b/cmake/modules/FindCUDA.cmake @@ -19,8 +19,9 @@ # This module exports: # # CUDA_FOUND -# CUDA_LIBRARIES # CUDA_INCLUDE_DIRS +# CUDA_LIBRARIES +# CUDA_NVCC_EXECUTABLE # CUDA_VERSION # CUDA_VERSION_MAJOR # CUDA_VERSION_MINOR