]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Disable CUDA for incompatible C++ standards
authorMatthias Maier <tamiko@43-1.org>
Wed, 16 Aug 2017 14:13:55 +0000 (16:13 +0200)
committerMatthias Maier <tamiko@43-1.org>
Wed, 16 Aug 2017 14:24:28 +0000 (09:24 -0500)
cmake/configure/configure_1_cuda.cmake

index 1c825ce2bd7f30d6b02cfe6717f53c73438c7817..ca8f42a163cca3fc061e8743559f878434ed8cd8 100644 (file)
@@ -45,6 +45,29 @@ MACRO(FEATURE_CUDA_FIND_EXTERNAL var)
         )
     ENDIF()
 
+    #
+    # CUDA 8.0 requires C++11 support, CUDA 9.0 requires C++14 support.
+    # Make sure that deal.II is configured appropriately
+    #
+    MACRO(_cuda_ensure_feature_off _version _feature)
+      IF(${CUDA_VERSION_MAJOR} EQUAL ${_version})
+        IF(${_feature})
+          SET(${var} FALSE)
+          MESSAGE(STATUS "CUDA ${_version} requires ${_feature} to be set to off.")
+          SET(CUDA_ADDITIONAL_ERROR_STRING
+            ${CUDA_ADDITIONAL_ERROR_STRING}
+            "CUDA ${_version} is not compatible with the C++ standard\n"
+            "enabled by ${_feature}.\n"
+            "Please disable ${_feature}, e.g. by reconfiguring with\n"
+            "  cmake -D${_feature}=OFF ."
+            )
+        ENDIF()
+      ENDIF()
+    ENDMACRO()
+    _cuda_ensure_feature_off(8 DEAL_II_WITH_CXX14)
+    _cuda_ensure_feature_off(9 DEAL_II_WITH_CXX17)
+
+
     IF("${DEAL_II_CUDA_FLAGS_SAVED}" MATCHES "-arch[ ]*sm_([0-9]*)")
       SET(CUDA_COMPUTE_CAPABILITY "${CMAKE_MATCH_1}")
     ELSEIF("${DEAL_II_CUDA_FLAGS_SAVED}" MATCHES "-arch=sm_([0-9]*)")

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.