]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
CMake: Bugfix: Also change DEAL_II_USE_CXX11 to DEAL_II_WITH_CXX11 in cmake
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 23 Dec 2013 10:00:14 +0000 (10:00 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 23 Dec 2013 10:00:14 +0000 (10:00 +0000)
files and in the bundled folder

git-svn-id: https://svn.dealii.org/trunk@32098 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/bundled/CMakeLists.txt
deal.II/bundled/boost-1.49.0/include/boost/signals2/detail/foreign_ptr.hpp
deal.II/cmake/checks/check_01_cxx_features.cmake
deal.II/cmake/checks/check_03_compiler_bugs.cmake
deal.II/cmake/configure/configure_1_threads.cmake
deal.II/cmake/configure/configure_2_trilinos.cmake

index f1ab6bc8399b8d3a97c9b371c80360badc90152a..9e82ec672a8fad920785f5fb6e08a0a32383fcd4 100644 (file)
@@ -38,7 +38,7 @@ IF(FEATURE_BOOST_BUNDLED_CONFIGURED)
     ADD_SUBDIRECTORY(${BOOST_FOLDER}/libs/iostreams/src)
   ENDIF()
 
-  IF(DEAL_II_WITH_THREADS AND NOT DEAL_II_USE_CXX11)
+  IF(DEAL_II_WITH_THREADS AND NOT DEAL_II_WITH_CXX11)
     ADD_SUBDIRECTORY(${BOOST_FOLDER}/libs/thread/src)
   ENDIF()
 ENDIF()
index a6ad99cae4e114ec8e52255bf602c564e1d4b80d..1f60f10b94452ddb40da5c5881d6e96eecf41d0a 100644 (file)
@@ -39,7 +39,7 @@ namespace boost
 // should only be used by deal.II and dependent projects...
 //
 // - Maier, 2013
-#ifdef DEAL_II_USE_CXX11
+#ifdef DEAL_II_WITH_CXX11
     template<typename T> struct weak_ptr_traits<std::weak_ptr<T> >
     {
       typedef std::shared_ptr<T> shared_type;
@@ -54,7 +54,7 @@ namespace boost
       typedef boost::weak_ptr<T> weak_type;
     };
 // as above
-#ifdef DEAL_II_USE_CXX11
+#ifdef DEAL_II_WITH_CXX11
     template<typename T> struct shared_ptr_traits<std::shared_ptr<T> >
     {
       typedef std::weak_ptr<T> weak_type;
index c5024e098a568dae4339fe73eab502a901fc4396..fa1540fae49690e04f201b3208af77f858588f91 100644 (file)
@@ -143,6 +143,75 @@ IF(NOT DEFINED DEAL_II_WITH_CXX11 OR DEAL_II_WITH_CXX11)
     "
     DEAL_II_HAVE_CXX11_TYPE_TRAITS)
 
+  #
+  # 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 this 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)
+
+
+  #
+  # 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)
+
+  #
+  # 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)
+
+
   IF( DEAL_II_HAVE_CXX11_ARRAY AND
       DEAL_II_HAVE_CXX11_CONDITION_VARIABLE AND
       DEAL_II_HAVE_CXX11_FUNCTIONAL AND
@@ -151,8 +220,11 @@ IF(NOT DEFINED DEAL_II_WITH_CXX11 OR DEAL_II_WITH_CXX11)
       DEAL_II_HAVE_CXX11_THREAD AND
       DEAL_II_HAVE_CXX11_MUTEX AND
       DEAL_II_HAVE_CXX11_TUPLE AND
-      DEAL_II_HAVE_CXX11_TYPE_TRAITS )
-    SET(DEAL_II_HAVE_CXX11 TRUE)
+      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()
 
   RESET_CMAKE_REQUIRED()
@@ -174,8 +246,8 @@ OPTION(DEAL_II_WITH_CXX11
 
 IF(DEAL_II_WITH_CXX11 AND NOT DEAL_II_HAVE_CXX11)
   MESSAGE(FATAL_ERROR "\n"
-    "C++11 support was requested (DEAL_II_WITH_CXX11=TRUE) but is not
-    supported by the current compiler.\n"
+    "C++11 support was requested (DEAL_II_WITH_CXX11=TRUE) but is not "
+    "supported by the current compiler.\n"
     "Please disable C++11 support, i.e. configure with\n"
     "    -DDEAL_II_WITH_CXX11=FALSE,\n"
     "or use a different compiler, instead. (If the compiler flag for C++11 "
index ea8d16f293207e1012d1beb18b2ff333e4be173f..364bad027e4793b31b893db49b8f191cc4d9c46d 100644 (file)
@@ -289,67 +289,6 @@ IF(DEAL_II_HAVE_BUNDLED_DIRECTORY)
 ENDIF()
 
 
-#
-# icc-13 triggers an internal compiler error when compiling
-# std::numeric_limits<...>::min() with -std=c++0x [1].
-# Just disable C++11 support completely in this case.
-#
-# Reported by Ted Kord.
-#
-# - Matthias Maier, 2013
-#
-# [1] http://software.intel.com/en-us/forums/topic/328902
-#
-CHECK_CXX_COMPILER_BUG(
-  "
-  #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_ICC_NUMERICLIMITS_BUG)
-
-#
-# 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_COMPILER_BUG(
-  "
-  #include <vector>
-  template<typename T> void foo()
-  {
-    std::vector<double> data(100);
-  }
-  int main()
-  {
-    foo<int>();
-  }
-  "
-  DEAL_II_ICC_LIBSTDCPP47CXX11_BUG)
-
-
-IF( DEAL_II_ICC_NUMERICLIMITS_BUG OR
-    DEAL_II_ICC_LIBSTDCPP47CXX11_BUG )
-  MESSAGE(STATUS
-    "Intel C++11 bug found, disabling C++11 support"
-    )
-  STRIP_FLAG(DEAL_II_CXX_FLAGS "${DEAL_II_CXX11_FLAG}")
-  SET(DEAL_II_CAN_USE_CXX1X FALSE)
-  SET(DEAL_II_USE_CXX11 FALSE)
-ENDIF()
-
-
 #
 # in intel (at least 13.1 and 14), vectorization causes
 # wrong code. See https://code.google.com/p/dealii/issues/detail?id=156
@@ -377,32 +316,3 @@ IF( CMAKE_SYSTEM_NAME MATCHES "CYGWIN"
     OR CMAKE_SYSTEM_NAME MATCHES "Windows" )
   SET(DEAL_II_CONSTEXPR_BUG TRUE)
 ENDIF()
-
-#
-# 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 this functions. Disable C++11 support in this
-# case.
-#
-# Thanks to Denis Davydov for the testcase.
-#
-# Matthias Maier, 2013
-#
-CHECK_CXX_COMPILER_BUG(
-  "
-  #include <ctype.h>
-  int main ()
-  {
-    char c = toupper('a');
-  }
-  "
-  DEAL_II_MAC_OSX_C99_BUG)
-
-IF(DEAL_II_MAC_OSX_C99_BUG)
-  MESSAGE(STATUS
-    "Mac OS-X C99 bug found, disabling C++11 support"
-    )
-  STRIP_FLAG(DEAL_II_CXX_FLAGS "${DEAL_II_CXX11_FLAG}")
-  SET(DEAL_II_CAN_USE_CXX1X FALSE)
-  SET(DEAL_II_USE_CXX11 FALSE)
-ENDIF()
index 182f7d3bc8a4c6ab4fbaa433e0a691d0be82bf60..edd2b4cd20a33afc3c0753b9576801d291207026 100644 (file)
@@ -165,7 +165,7 @@ MACRO(FEATURE_THREADS_CONFIGURE_EXTERNAL)
   # Workaround for an issue with C++11 mode, non gcc-compilers and missing
   # template<typename T> std::ist_trivially_copyable<T>
   #
-  IF( DEAL_II_USE_CXX11 AND
+  IF( DEAL_II_WITH_CXX11 AND
       NOT DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE AND
       NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU" )
     LIST(APPEND DEAL_II_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1")
@@ -200,7 +200,7 @@ MACRO(FEATURE_THREADS_CONFIGURE_BUNDLED)
   # Workaround for an issue with C++11 mode, non gcc-compilers and missing
   # template<typename T> std::ist_trivially_copyable<T>
   #
-  IF( DEAL_II_USE_CXX11 AND
+  IF( DEAL_II_WITH_CXX11 AND
       NOT DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE AND
       NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU" )
     LIST(APPEND DEAL_II_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1")
index d76b3cbf208d6d11983af00e9ac0f37ea3790b42..e04bbfac4149d743dda3b0c7822de52e26e45782 100644 (file)
@@ -160,7 +160,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_USE_CXX11 AND NOT TRILINOS_SUPPORTS_CPP11)
+    IF(DEAL_II_WITH_CXX11 AND NOT TRILINOS_SUPPORTS_CPP11)
 
       IF(TRILINOS_HAS_C99_TR1_WORKAROUND)
         LIST(APPEND DEAL_II_DEFINITIONS "HAS_C99_TR1_CMATH")

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.