]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Require C++11.
authorDavid Wells <wellsd2@rpi.edu>
Thu, 23 Mar 2017 21:01:43 +0000 (17:01 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Fri, 31 Mar 2017 19:53:48 +0000 (15:53 -0400)
bundled/CMakeLists.txt
cmake/checks/check_01_cxx_features.cmake
cmake/checks/check_03_compiler_bugs.cmake
cmake/configure/configure_1_cuda.cmake
cmake/configure/configure_1_threads.cmake
cmake/configure/configure_2_trilinos.cmake
cmake/configure/configure_boost.cmake
cmake/setup_cached_variables.cmake
doc/news/changes/incompatibilities/20170323DavidWells [new file with mode: 0644]
include/deal.II/base/config.h.in

index eb56adc4c7334b40046ecea8c5b5838b0c9faac1..acc7f66f2628cb9b7c49db2336f71b26c4550acb 100644 (file)
@@ -34,10 +34,6 @@ IF(FEATURE_BOOST_BUNDLED_CONFIGURED)
   ELSE()
     MESSAGE(STATUS "BOOST::Iostreams will not be available because zlib or its header files could not be found")
   ENDIF()
-
-  IF(DEAL_II_WITH_THREADS AND NOT DEAL_II_WITH_CXX11)
-    ADD_SUBDIRECTORY(${BOOST_FOLDER}/libs/thread/src)
-  ENDIF()
 ENDIF()
 
 
index ac17aaad078a8e75df7d886ae8f221b0ff82bbe8..8091f653a1e16a284a0bacb2d72d7befc591324f 100644 (file)
@@ -18,7 +18,6 @@
 #
 # This file sets up
 #
-#   DEAL_II_WITH_CXX11
 #   DEAL_II_WITH_CXX14
 #
 #   DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE
 #
 SET_IF_EMPTY(DEAL_II_CXX_VERSION_FLAG "${DEAL_II_CXX11_FLAG}")
 
-IF(DEAL_II_WITH_CXX14 AND DEFINED DEAL_II_WITH_CXX11 AND NOT DEAL_II_WITH_CXX11)
-  MESSAGE(FATAL_ERROR
-    "Compiling deal.II with C++14 support (i.e., DEAL_II_WITH_CXX14=ON) requires"
-    " that C++11 support not be explicitly disabled (i.e., DEAL_II_WITH_CXX11 may"
-    " not be set to a logically false value)."
-    )
-ENDIF()
-
-IF(DEFINED DEAL_II_WITH_CXX11 AND NOT DEAL_II_WITH_CXX11)
-  SET(DEAL_II_WITH_CXX14 OFF CACHE STRING "" FORCE)
-ENDIF()
-
-
 #
 # Check the user supplied DEAL_II_CXX_VERSION_FLAG
 #
@@ -67,11 +53,26 @@ IF(NOT "${DEAL_II_CXX_VERSION_FLAG}" STREQUAL "")
       )
   ENDIF()
 
+  #
+  # A quick check that may, hopefully, give a more useful error message
+  #
+  IF("${DEAL_II_CXX_VERSION_FLAG}" STREQUAL "-std=c++98" OR
+     "${DEAL_II_CXX_VERSION_FLAG}" STREQUAL "-std=c++03")
+    MESSAGE(FATAL_ERROR
+      "\ndeal.II no longer supports compilation under the C++98 or C++03 "
+      "standards: please either specify a value for DEAL_II_CXX_VERSION_FLAG "
+      "corresponding to C++11 or leave the field blank (so that CMake may "
+      "automatically determine a valid version flag).\n"
+      )
+  ENDIF()
+
   SET(_user_provided_cxx_version_flag TRUE)
+ELSE()
+  SET(_user_provided_cxx_version_flag FALSE)
 ENDIF()
 
 #
-# A macro to check for various C++11 and C++14 flags
+# A macro to check for various C++ version flags
 #
 
 MACRO(_check_cxx_flag _suffix)
@@ -102,7 +103,6 @@ IF(NOT DEFINED DEAL_II_WITH_CXX14 OR DEAL_II_WITH_CXX14)
 
   IF(NOT "${DEAL_II_CXX_VERSION_FLAG}" STREQUAL "")
     # Set CMAKE_REQUIRED_FLAGS for the unit tests
-    MESSAGE(STATUS "Using C++ version flag \"${DEAL_II_CXX_VERSION_FLAG}\"")
     PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}")
 
     #
@@ -153,222 +153,145 @@ IF(NOT DEFINED DEAL_II_WITH_CXX14 OR DEAL_II_WITH_CXX14)
   ENDIF()
 ENDIF()
 
-
 #
-# Check for proper C++11 support and set up DEAL_II_HAVE_CXX11:
+# Check for proper C++11 support.
 #
-IF(NOT DEFINED DEAL_II_WITH_CXX11 OR DEAL_II_WITH_CXX11)
-
-  IF("${DEAL_II_CXX_VERSION_FLAG}" STREQUAL "")
-    _check_version("11" "0x")
-  ENDIF()
-
-  IF(NOT "${DEAL_II_CXX_VERSION_FLAG}" STREQUAL "")
-    # Set CMAKE_REQUIRED_FLAGS for the unit tests
-    MESSAGE(STATUS "Using C++ version flag \"${DEAL_II_CXX_VERSION_FLAG}\"")
-    PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}")
-
-    CHECK_CXX_SOURCE_COMPILES(
-      "
-      #include <array>
-      std::array<int,3> p;
-      int main(){  p[0]; return 0; }
-      "
-      DEAL_II_HAVE_CXX11_ARRAY)
-
-    CHECK_CXX_SOURCE_COMPILES(
-      "
-      #include <condition_variable>
-      std::condition_variable c;
-      int main(){ c.notify_all(); return 0; }
-      "
-      DEAL_II_HAVE_CXX11_CONDITION_VARIABLE)
-
-    CHECK_CXX_SOURCE_COMPILES(
-      "
-      #include <functional>
-      void f(int, double){}
-      std::function<void (int)> g = std::bind (f, std::placeholders::_1,1.1);
-      int main(){ return 0; }
-      "
-      DEAL_II_HAVE_CXX11_FUNCTIONAL)
-
-    # Make sure we don't run into GCC bug 35569
-    CHECK_CXX_SOURCE_COMPILES(
-      "
-      #include <functional>
-      void f(int){}
-      using namespace std;
-      using namespace std::placeholders;
-      int main(){ bind(multiplies<int>(),4,_1)(5); return 0; }
-      "
-      DEAL_II_HAVE_CXX11_FUNCTIONAL_GCCBUG35569_OK)
 
-    # clang libc++ bug, see https://llvm.org/bugs/show_bug.cgi?id=20084
-    CHECK_CXX_SOURCE_COMPILES(
-      "
-      #include <functional>
-      struct A { void foo() const {} };
-      int main() { A a; std::bind(&A::foo,a)(); return 0; }
-      "
-      DEAL_II_HAVE_CXX11_FUNCTIONAL_LLVMBUG20084_OK)
-
-    CHECK_CXX_SOURCE_COMPILES(
-      "
-      #include <memory>
-      std::shared_ptr<int> p(new int(3));
-      int main(){ return 0; }
-      "
-      DEAL_II_HAVE_CXX11_SHARED_PTR)
-
-    PUSH_CMAKE_REQUIRED("-pthread")
-    CHECK_CXX_SOURCE_COMPILES(
-      "
-      #include <thread>
-      void f(int){}
-      int main(){ std::thread t(f,1); t.join(); return 0; }
-      "
-      DEAL_II_HAVE_CXX11_THREAD)
-    RESET_CMAKE_REQUIRED()
-    PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}")
+#
+# Set up a default C++11 flag in case both C++14 detection failed and the user
+# did not specify a flag:
+#
+IF("${DEAL_II_CXX_VERSION_FLAG}" STREQUAL "")
+  _check_version("11" "0x")
+ENDIF()
 
-    CHECK_CXX_SOURCE_COMPILES(
-      "
-      #include <mutex>
-      std::mutex m;
-      int main(){ m.lock(); return 0; }
-      "
-      DEAL_II_HAVE_CXX11_MUTEX)
+PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}")
+CHECK_CXX_SOURCE_COMPILES(
+  "
+  // common C++11 include files
+  #include <array>
+  #include <condition_variable>
+  #include <type_traits>
 
-    CHECK_CXX_SOURCE_COMPILES(
-      "
-      #include <tuple>],
-      std::tuple<int,double,char> p(1,1.1,'a');
-      int main(){ return 0; }
-      "
-      DEAL_II_HAVE_CXX11_TUPLE)
+  // type traits functionality
+  constexpr auto m0 = std::is_trivial<double>::value;
+  constexpr auto m1 = std::is_standard_layout<double>::value;
+  constexpr auto m2 = std::is_pod<double>::value;
 
-    CHECK_CXX_SOURCE_COMPILES(
-      "
-      #include <type_traits>
-      const bool m0 = std::is_trivial<double>::value;
-      const bool m1 = std::is_standard_layout<double>::value;
-      const bool m2 = std::is_pod<double>::value;
-      int main(){ return 0; }
-      "
-      DEAL_II_HAVE_CXX11_TYPE_TRAITS)
+  // thread_local storage specification
+  thread_local std::array<int,3> p;
+  std::condition_variable c;
 
-    #
-    # On Mac OS-X 10.9 with recent gcc compilers in C++11 mode linking to
-    # some standard C library functions, notably toupper and tolower, fail
-    # due to unresolved references to these functions.
-    #
-    # Thanks to Denis Davydov for the testcase.
-    #
-    # Matthias Maier, 2013
-    #
-    CHECK_CXX_SOURCE_COMPILES(
-      "
-      #include <ctype.h>
-      int main ()
-      {
-        char c = toupper('a');
-      }
-      "
-      DEAL_II_HAVE_CXX11_MACOSXC99BUG_OK)
+  // check the version language macro
+  #if !(__cplusplus >= 201103L)
+  #  error \"insufficient support for C++11\"
+  #endif
 
+  int main()
+  {
+    p[0];
+    c.notify_all();
+  }
+  "
+  DEAL_II_HAVE_CXX11_FEATURES)
 
-    #
-    # icc-13 triggers an internal compiler error when compiling
-    # std::numeric_limits<...>::min() with -std=c++0x [1].
-    #
-    # Reported by Ted Kord.
-    #
-    # - Matthias Maier, 2013
-    #
-    # [1] http://software.intel.com/en-us/forums/topic/328902
-    #
-    CHECK_CXX_SOURCE_COMPILES(
-      "
-      #include <limits>
-      struct Integer
-      {
-        static const int min_int_value;
-        static const int max_int_value;
-      };
-      const int Integer::min_int_value = std::numeric_limits<int>::min();
-      const int Integer::max_int_value = std::numeric_limits<int>::max();
-      int main() { return 0; }
-      "
-      DEAL_II_HAVE_CXX11_ICCNUMERICLIMITSBUG_OK)
-
+# clang libc++ bug, see https://llvm.org/bugs/show_bug.cgi?id=20084
+CHECK_CXX_SOURCE_COMPILES(
+  "
+  #include <functional>
+  struct A { void foo() const {} };
+  int main() { A a; std::bind(&A::foo,a)(); return 0; }
+  "
+  DEAL_II_HAVE_CXX11_FUNCTIONAL_LLVMBUG20084_OK)
 
-    #
-    # icc-14.0.0 has an astonishing bug [1] where it hits an internal compiler
-    # error when run in C++11 mode with libstdc++-4.7 (from gcc).
-    #
-    # We just disable C++11 mode in this case
-    #
-    # [1] http://software.intel.com/en-us/forums/topic/472385
-    #
-    # - Matthias Maier, 2013
-    #
-    CHECK_CXX_SOURCE_COMPILES(
-      "
-      #include <vector>
-      template<typename T> void foo()
-      {
-        std::vector<double> data(100);
-      }
-      int main()
-      {
-        foo<int>();
-      }
-      "
-      DEAL_II_HAVE_CXX11_ICCLIBSTDCPP47CXX11BUG_OK)
+#
+# On Mac OS-X 10.9 with recent gcc compilers in C++11 mode linking to
+# some standard C library functions, notably toupper and tolower, fail
+# due to unresolved references to these functions.
+#
+# Thanks to Denis Davydov for the testcase.
+#
+# Matthias Maier, 2013
+#
+CHECK_CXX_SOURCE_COMPILES(
+  "
+  #include <ctype.h>
+  int main ()
+  {
+    char c = toupper('a');
+  }
+  "
+  DEAL_II_HAVE_CXX11_MACOSXC99BUG_OK)
 
-    RESET_CMAKE_REQUIRED()
-  ENDIF()
 
-  IF( DEAL_II_HAVE_CXX11_ARRAY AND
-      DEAL_II_HAVE_CXX11_CONDITION_VARIABLE AND
-      DEAL_II_HAVE_CXX11_FUNCTIONAL AND
-      DEAL_II_HAVE_CXX11_FUNCTIONAL_GCCBUG35569_OK AND
-      DEAL_II_HAVE_CXX11_FUNCTIONAL_LLVMBUG20084_OK AND
-      DEAL_II_HAVE_CXX11_SHARED_PTR AND
-      DEAL_II_HAVE_CXX11_THREAD AND
-      DEAL_II_HAVE_CXX11_MUTEX AND
-      DEAL_II_HAVE_CXX11_TUPLE AND
-      DEAL_II_HAVE_CXX11_TYPE_TRAITS AND
-      DEAL_II_HAVE_CXX11_MACOSXC99BUG_OK AND
-      DEAL_II_HAVE_CXX11_ICCNUMERICLIMITSBUG_OK AND
-      DEAL_II_HAVE_CXX11_ICCLIBSTDCPP47CXX11BUG_OK )
-      SET(DEAL_II_HAVE_CXX11 TRUE)
-  ENDIF()
-ENDIF()
+#
+# icc-13 triggers an internal compiler error when compiling
+# std::numeric_limits<...>::min() with -std=c++0x [1].
+#
+# Reported by Ted Kord.
+#
+# - Matthias Maier, 2013
+#
+# [1] http://software.intel.com/en-us/forums/topic/328902
+#
+CHECK_CXX_SOURCE_COMPILES(
+  "
+  #include <limits>
+  struct Integer
+  {
+    static const int min_int_value;
+    static const int max_int_value;
+  };
+  const int Integer::min_int_value = std::numeric_limits<int>::min();
+  const int Integer::max_int_value = std::numeric_limits<int>::max();
+  int main() { return 0; }
+  "
+  DEAL_II_HAVE_CXX11_ICCNUMERICLIMITSBUG_OK)
 
 
 #
-# Finally disable cxx14 if cxx11 detection failed for whatever reason. This
-# can happen if any of our compile checks above fails, for example threading
-# support.
-# 
-IF (DEAL_II_HAVE_CXX14 AND NOT DEAL_II_HAVE_CXX11)
-  MESSAGE(STATUS "Disabling CXX14 support because CXX11 detection failed.")
-  SET(DEAL_II_HAVE_CXX14 FALSE)
+# icc-14.0.0 has an astonishing bug [1] where it hits an internal compiler
+# error when run in C++11 mode with libstdc++-4.7 (from gcc).
+#
+# [1] http://software.intel.com/en-us/forums/topic/472385
+#
+# - Matthias Maier, 2013
+#
+CHECK_CXX_SOURCE_COMPILES(
+  "
+  #include <vector>
+  template<typename T> void foo()
+  {
+    std::vector<double> data(100);
+  }
+  int main()
+  {
+    foo<int>();
+  }
+  "
+  DEAL_II_HAVE_CXX11_ICCLIBSTDCPP47CXX11BUG_OK)
+RESET_CMAKE_REQUIRED()
+
+IF( DEAL_II_HAVE_CXX11_FEATURES AND
+    DEAL_II_HAVE_CXX11_FUNCTIONAL_LLVMBUG20084_OK AND
+    DEAL_II_HAVE_CXX11_MACOSXC99BUG_OK AND
+    DEAL_II_HAVE_CXX11_ICCNUMERICLIMITSBUG_OK AND
+    DEAL_II_HAVE_CXX11_ICCLIBSTDCPP47CXX11BUG_OK )
+  # we require C++11 so this is fine
+ELSE()
+  MESSAGE(FATAL_ERROR "\n"
+    "The current combination of compiler and C++ version flag is missing some "
+    "features of the C++11 version of the language necessary for compiling "
+    "deal.II. Please ensure that the CMake variable DEAL_II_CXX_VERSION_FLAG is "
+    "set to the correct flag to enable C++11 support; if it is already set and "
+    "you still see this message then you will need to upgrade your compiler.\n")
 ENDIF()
 
+
 #
-# Set up a configuration options for C++11 and C++14 support:
+# Set up a configuration option for C++14 support:
 #
 
-OPTION(DEAL_II_WITH_CXX11
-  "Compile deal.II using C++11 language standard."
-  ${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}
@@ -377,8 +300,8 @@ 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
-# is not available due to above tests (DEAL_II_HAVE_CXX11):
+# Bail out if user requested support for a certain C++ version (e.g.,
+# DEAL_II_WITH_CXX14) but support is not available due to above tests
 #
 
 MACRO(_bailout _version)
@@ -396,18 +319,30 @@ MACRO(_bailout _version)
   ENDIF()
 ENDMACRO()
 
-_bailout("11")
 _bailout("14")
 
-IF (DEAL_II_WITH_CXX14)
-  ADD_FLAGS(DEAL_II_CXX_FLAGS "${DEAL_II_CXX_VERSION_FLAG}")
-  MESSAGE(STATUS "DEAL_II_WITH_CXX11 successfully set up")
-  MESSAGE(STATUS "DEAL_II_WITH_CXX14 successfully set up")
-ELSEIF(DEAL_II_WITH_CXX11)
+#
+# Some compilers (notably GCC6 and up) default to C++14 (more exactly, GNU++14,
+# which contains some extensions) but most compilers default to C++98. Hence,
+# try to avoid adding an extra flag by doing one last test:
+#
+RESET_CMAKE_REQUIRED()
+CHECK_CXX_SOURCE_COMPILES(
+  "
+  #include <memory>
+  int main()
+  {
+    std::unique_ptr<int> p0;
+    auto p1 = std::move(p0);
+  }
+  "
+  DEAL_II_COMPILER_DEFAULTS_TO_CXX11_OR_NEWER)
+
+IF(_user_provided_cxx_version_flag OR
+    NOT DEAL_II_COMPILER_DEFAULTS_TO_CXX11_OR_NEWER OR
+    (DEAL_II_COMPILER_DEFAULTS_TO_CXX11_OR_NEWER AND NOT DEAL_II_WITH_CXX14))
   ADD_FLAGS(DEAL_II_CXX_FLAGS "${DEAL_II_CXX_VERSION_FLAG}")
-  MESSAGE(STATUS "DEAL_II_WITH_CXX11 successfully set up")
-ELSE()
-  MESSAGE(STATUS "DEAL_II_WITH_CXX14 and DEAL_II_WITH_CXX11 are both disabled")
+  MESSAGE(STATUS "Using C++ version flag \"${DEAL_II_CXX_VERSION_FLAG}\"")
 ENDIF()
 
 
@@ -417,23 +352,13 @@ ENDIF()
 #                                                                      #
 ########################################################################
 
-#
-# Some compilers (such as Intel 15.3 and GCC 4.9.2) support the flags
-# "-std=c++11" and "-std=c++14" but do not support
-# 'std::is_trivially_copyable', so check for support in C++11 or newer.
-#
-IF(DEAL_II_WITH_CXX11)
-  PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}")
-  CHECK_CXX_SOURCE_COMPILES(
-    "
+PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}")
+CHECK_CXX_SOURCE_COMPILES(
+  "
   #include <type_traits>
   int main(){ std::is_trivially_copyable<int> bob; }
   "
-    DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE)
-  RESET_CMAKE_REQUIRED()
-ELSE()
-  SET(DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE FALSE)
-ENDIF()
+  DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE)
 
 CHECK_CXX_SOURCE_COMPILES(
   "
@@ -477,55 +402,48 @@ CHECK_CXX_SOURCE_COMPILES(
 # - Timo Heister, 2015
 #
 
-# This test requires C++11
-IF(DEAL_II_WITH_CXX11)
-  PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}")
-  IF(DEAL_II_ALLOW_PLATFORM_INTROSPECTION)
-    CHECK_CXX_SOURCE_RUNS(
-      "
-      #include <cfenv>
-      #include <limits>
-      #include <sstream>
+IF(DEAL_II_ALLOW_PLATFORM_INTROSPECTION)
+  CHECK_CXX_SOURCE_RUNS(
+    "
+    #include <cfenv>
+    #include <limits>
+    #include <sstream>
 
-      int main()
-      {
-        feenableexcept(FE_DIVBYZERO|FE_INVALID);
-        std::ostringstream description;
-        const double lower_bound = -std::numeric_limits<double>::max();
+    int main()
+    {
+      feenableexcept(FE_DIVBYZERO|FE_INVALID);
+      std::ostringstream description;
+      const double lower_bound = -std::numeric_limits<double>::max();
 
-        description << lower_bound;
+      description << lower_bound;
 
-        return 0;
-      }
-      "
-       DEAL_II_HAVE_FP_EXCEPTIONS)
-  ELSE()
-    #
-    # If we are not allowed to do platform introspection, just test whether
-    # we can compile above code.
-    #
-    CHECK_CXX_SOURCE_COMPILES(
-      "
-      #include <cfenv>
-      #include <limits>
-      #include <sstream>
+      return 0;
+    }
+    "
+    DEAL_II_HAVE_FP_EXCEPTIONS)
+ELSE()
+  #
+  # If we are not allowed to do platform introspection, just test whether
+  # we can compile above code.
+  #
+  CHECK_CXX_SOURCE_COMPILES(
+    "
+    #include <cfenv>
+    #include <limits>
+    #include <sstream>
 
-      int main()
-      {
-        feenableexcept(FE_DIVBYZERO|FE_INVALID);
-        std::ostringstream description;
-        const double lower_bound = -std::numeric_limits<double>::max();
+    int main()
+    {
+      feenableexcept(FE_DIVBYZERO|FE_INVALID);
+      std::ostringstream description;
+      const double lower_bound = -std::numeric_limits<double>::max();
 
-        description << lower_bound;
+      description << lower_bound;
 
-        return 0;
-      }
-      "
-       DEAL_II_HAVE_FP_EXCEPTIONS)
-  ENDIF()
-  RESET_CMAKE_REQUIRED()
-ELSE()
-  SET(DEAL_II_HAVE_FP_EXCEPTIONS FALSE)
+      return 0;
+    }
+    "
+    DEAL_II_HAVE_FP_EXCEPTIONS)
 ENDIF()
 
 #
@@ -551,4 +469,4 @@ CHECK_CXX_SOURCE_COMPILES(
   }
   "
   DEAL_II_HAVE_COMPLEX_OPERATOR_OVERLOADS)
-
+RESET_CMAKE_REQUIRED()
index 38cc5972d127b394d56c3b08cad32d8e54df372d..74d2fad69014dc58f49260283ee8f12e1df12e36 100644 (file)
@@ -61,17 +61,6 @@ IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND
 ENDIF()
 
 
-#
-# Newer gcc versions generate a large number of warnings inside boost if we
-# are compiling without cxx11 but with -pedantic and there is no way to
-# silence them.
-#
-IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND
-   NOT DEAL_II_WITH_CXX11)
-  STRIP_FLAG(DEAL_II_CXX_FLAGS "-pedantic")
-ENDIF()
-
-
 #
 # In some cases, we would like to name partial specializations
 # as friends. However, the standard forbids us to do so. But
@@ -306,57 +295,27 @@ ENDIF()
 #
 # - Wolfgang Bangerth, 2014
 #
-IF(DEAL_II_WITH_CXX11)
-  PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}")
-  CHECK_CXX_COMPILER_BUG(
-    "
-    #include <functional>
-
-    void f(int, int) {}
-
-    template <typename F>
-    void g(const F &func)
-    {
-      func(1);
-    }
-
-    int main ()
-    {
-      g (std::bind(&f, std::placeholders::_1, 1));
-    }
-    "
-    DEAL_II_BIND_NO_CONST_OP_PARENTHESES
-    )
-  RESET_CMAKE_REQUIRED()
-ELSE()
-  CHECK_CXX_COMPILER_BUG(
-    "
-    #include <functional>
-    #include \"${BOOST_FOLDER}/include/boost/bind.hpp\"
+PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_FLAGS}")
+CHECK_CXX_COMPILER_BUG(
+  "
+  #include <functional>
 
-    void f(int, int) {}
+  void f(int, int) {}
 
-    template <typename F>
-    void g(const F &func)
-    {
-      func(1);
-    }
+  template <typename F>
+  void g(const F &func)
+  {
+    func(1);
+  }
 
-    int main ()
-    {
-      using boost::bind;
-      using boost::reference_wrapper;
-  
-      // now also import the _1, _2 placeholders from the global namespace
-      // into the current one as suggested above
-      using ::_1;
-
-      g (boost::bind(&f, boost::_1, 1));
-    }
-    "
-    DEAL_II_BIND_NO_CONST_OP_PARENTHESES
-    )
-ENDIF()
+  int main ()
+  {
+    g (std::bind(&f, std::placeholders::_1, 1));
+  }
+  "
+  DEAL_II_BIND_NO_CONST_OP_PARENTHESES
+  )
+RESET_CMAKE_REQUIRED()
 
 
 #
index 58886c8e45f1fe35c4cead0114cc86bae2d316da..7814f4f92fc12ee0d76ac6657709e5897886b9dd 100644 (file)
 #
 SET(DEAL_II_WITH_CUDA FALSE CACHE BOOL "")
 
-#
-# 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)
 
   #
index afd8adb70a99ba39a1a10e99e4c467cee37c8adb..f1f73d700dd5970080d40c961d0da3e814a6198d 100644 (file)
@@ -154,8 +154,7 @@ MACRO(FEATURE_THREADS_CONFIGURE_EXTERNAL)
   # Workaround for an issue with C++11 mode, non gcc-compilers and missing
   # template<typename T> std::is_trivially_copyable<T>
   #
-  IF( DEAL_II_WITH_CXX11 AND
-      NOT DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE AND
+  IF( NOT DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE AND
       NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU" )
     LIST(APPEND THREADS_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1")
     LIST(APPEND THREADS_USER_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1")
@@ -193,8 +192,7 @@ MACRO(FEATURE_THREADS_CONFIGURE_BUNDLED)
   # Workaround for an issue with C++11 mode, non gcc-compilers and missing
   # template<typename T> std::is_trivially_copyable<T>
   #
-  IF( DEAL_II_WITH_CXX11 AND
-      NOT DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE AND
+  IF( NOT DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE AND
       NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU" )
     LIST(APPEND THREADS_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1")
     LIST(APPEND THREADS_USER_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1")
index 45d50c28391da1840b2ff23c895d38a33de6ef92..67dcedee07b931fae4435b6afd369594a535285e 100644 (file)
@@ -162,7 +162,7 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var)
     # with the -std=c++0x flag of GCC, see deal.II FAQ.
     # Test whether that is indeed the case
     #
-    IF(DEAL_II_WITH_CXX11 AND NOT TRILINOS_SUPPORTS_CPP11)
+    IF(NOT TRILINOS_SUPPORTS_CPP11)
 
       IF(TRILINOS_HAS_C99_TR1_WORKAROUND)
         LIST(APPEND TRILINOS_DEFINITIONS "HAS_C99_TR1_CMATH")
@@ -182,26 +182,6 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var)
       ENDIF()
     ENDIF()
 
-    #
-    # Newer Trilinos versions (12.0.1 or newer) require a matching C++11
-    # support. I.e., if Trilinos is configured with C++11 support, deal.II
-    # also has to be configured with C++11 support:
-    #
-    IF(TRILINOS_WITH_MANDATORY_CXX11 AND NOT DEAL_II_WITH_CXX11)
-      MESSAGE(STATUS "Could not find a sufficient Trilinos installation: "
-        "Trilinos was compiled with C++11 support, but C++11 support is "
-        "disabled (DEAL_II_WITH_CXX11=off)."
-        )
-      SET(TRILINOS_ADDITIONAL_ERROR_STRING
-        ${TRILINOS_ADDITIONAL_ERROR_STRING}
-        "The Trilinos installation (found at \"${TRILINOS_DIR}\")\n"
-        "requires C++11 support, but C++11 support is disabled:\n"
-        "  DEAL_II_WITH_CXX11 = ${DEAL_II_WITH_CXX11}\n"
-        )
-      SET(${var} FALSE)
-
-    ENDIF()
-
     CHECK_MPI_INTERFACE(TRILINOS ${var})
   ENDIF()
 ENDMACRO()
index 7c8adafb0dd376ed91e8de9c56dcc6117013fb28..1430f92f300c9a918059e5a3c7a9a1f110d5cd68 100644 (file)
@@ -38,8 +38,7 @@ MACRO(FEATURE_BOOST_CONFIGURE_COMMON)
   # [1] https://svn.boost.org/trac/boost/ticket/12755
   #
   IF( CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND
-      CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8" AND
-      DEAL_II_WITH_CXX11)
+      CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8")
     LIST(APPEND BOOST_DEFINITIONS "BOOST_NO_CXX11_HDR_UNORDERED_MAP")
     LIST(APPEND BOOST_USER_DEFINITIONS "BOOST_NO_CXX11_HDR_UNORDERED_MAP")
   ENDIF()
index ecbfba46354ef38c4a5f83898697a9459dafc295..bb1922f01f9772c6802e3693280ccc7ac5029aa7 100644 (file)
@@ -392,14 +392,6 @@ without the need to install it, if this is what you tried to do.)
     )
 ENDIF()
 
-#
-# Compatibility renaming:
-#
-
-IF(DEFINED DEAL_II_HAVE_CXX11_FLAG AND NOT DEAL_II_HAVE_CXX11_FLAG)
-  SET(DEAL_II_WITH_CXX11 FALSE CACHE BOOL "" FORCE)
-ENDIF()
-
 #
 # Miscellaneous renaming:
 #
diff --git a/doc/news/changes/incompatibilities/20170323DavidWells b/doc/news/changes/incompatibilities/20170323DavidWells
new file mode 100644 (file)
index 0000000..78a862d
--- /dev/null
@@ -0,0 +1,3 @@
+Changed: deal.II now requires a compiler supporting (very nearly) the entire C++11 standard. The minimal version of GCC supported is now 4.8.
+<br>
+(David Wells, 2017/03/23)
index c548f1e24f9782074f64e189dc821e3918eca0f9..0012fe7b941406ea26974fe13b111c352ef6c75b 100644 (file)
@@ -38,7 +38,6 @@
 #cmakedefine DEAL_II_WITH_ARPACK
 #cmakedefine DEAL_II_WITH_BZIP2
 #cmakedefine DEAL_II_WITH_CUDA
-#cmakedefine DEAL_II_WITH_CXX11
 #cmakedefine DEAL_II_WITH_CXX14
 #cmakedefine DEAL_II_WITH_GSL
 #cmakedefine DEAL_II_WITH_HDF5
@@ -56,6 +55,8 @@
 #cmakedefine DEAL_II_WITH_UMFPACK
 #cmakedefine DEAL_II_WITH_ZLIB
 
+// defined for backwards compatibility
+#define DEAL_II_WITH_CXX11
 
 /***********************************************************************
  * Compiler bugs:

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.