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()
// 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;
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;
"
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
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()
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 "
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
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()
# 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")
# 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")
# 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")