]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Make CUDA detection more robust
authorMatthias Maier <tamiko@43-1.org>
Wed, 16 Aug 2017 14:23:00 +0000 (16:23 +0200)
committerMatthias Maier <tamiko@43-1.org>
Wed, 16 Aug 2017 14:24:28 +0000 (09:24 -0500)
cmake/configure/configure_1_cuda.cmake
cmake/modules/FindCUDA.cmake

index ca8f42a163cca3fc061e8743559f878434ed8cd8..4b514a1f6d008827b428d053b9e4e1dd7f015011 100644 (file)
@@ -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)
 
   #
index 4a30f6f3fa4490941a3320c73dd1c7517b4def02..a093d6e0d898cd5cadf846199bcec974eb1f17b0 100644 (file)
@@ -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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.