From: Matthias Maier Date: Wed, 25 May 2016 16:43:15 +0000 (-0500) Subject: CMake: Bugfix: Only try to configure cuda if C++11 support is available X-Git-Tag: v8.5.0-rc1~1010^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2639%2Fhead;p=dealii.git CMake: Bugfix: Only try to configure cuda if C++11 support is available This - fixes an unfortunate fatal error that should never occur with autodetection Fixes #2631 --- diff --git a/cmake/checks/check_01_cxx_features.cmake b/cmake/checks/check_01_cxx_features.cmake index f43871d40c..ac17aaad07 100644 --- a/cmake/checks/check_01_cxx_features.cmake +++ b/cmake/checks/check_01_cxx_features.cmake @@ -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 diff --git a/cmake/configure/configure_1_cuda.cmake b/cmake/configure/configure_1_cuda.cmake index 4d16b2fbfe..1e1fb97b01 100644 --- a/cmake/configure/configure_1_cuda.cmake +++ b/cmake/configure/configure_1_cuda.cmake @@ -17,23 +17,20 @@ # 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.