]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Bugfix: Only try to configure cuda if C++11 support is available 2639/head
authorMatthias Maier <tamiko@43-1.org>
Wed, 25 May 2016 16:43:15 +0000 (11:43 -0500)
committerMatthias Maier <tamiko@43-1.org>
Wed, 25 May 2016 16:43:15 +0000 (11:43 -0500)
This

 - fixes an unfortunate fatal error that should never occur with
   autodetection

Fixes #2631

cmake/checks/check_01_cxx_features.cmake
cmake/configure/configure_1_cuda.cmake

index f43871d40c3e1eaf46e4298cf91d38c61b81b544..ac17aaad078a8e75df7d886ae8f221b0ff82bbe8 100644 (file)
@@ -367,12 +367,14 @@ OPTION(DEAL_II_WITH_CXX11
   ${DEAL_II_HAVE_CXX11}
   )
 LIST(APPEND DEAL_II_FEATURES CXX11)
+SET(FEATURE_CXX11_PROCESSED TRUE)
 
 OPTION(DEAL_II_WITH_CXX14
   "Compile deal.II using C++14 language standard."
   ${DEAL_II_HAVE_CXX14}
   )
 LIST(APPEND DEAL_II_FEATURES CXX14)
+SET(FEATURE_CXX14_PROCESSED TRUE)
 
 #
 # Bail out if user requested C++11 support (DEAL_II_WITH_CXX11) but support
index 4d16b2fbfe0e43f3411f02704bd58eb3e7e7f937..1e1fb97b01b26b18ad6280cbc3ff764854d93c24 100644 (file)
 # Configuration for cuda support:
 #
 
-MACRO(FEATURE_CUDA_FIND_EXTERNAL var)
+#
+# FindCUDA needs a compiler set up with C++11 support. Thus, only configure
+# if deal.II was configured with C++11 support.
+#
+SET(FEATURE_CUDA_DEPENDS CXX11)
 
+MACRO(FEATURE_CUDA_FIND_EXTERNAL var)
 
   FIND_PACKAGE(CUDA)
 
   IF(CUDA_FOUND)
 
-    IF(NOT DEAL_II_WITH_CXX11)
-      MESSAGE(FATAL_ERROR "\n"
-        "CUDA only supported with C++11. Reconfigure with DEAL_II_WITH_CXX11=ON.\n"
-        )
-    ENDIF()
-
     SET(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE FALSE)
 
-    # Activate C++11 since we require it above.
-
     SET(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -std=c++11)
 
     # FIXME: CUDA compiler NVCC doesn't support C++14.

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.