From 4c0d0b43e335e803fffb802dc6f31b4810589725 Mon Sep 17 00:00:00 2001 From: bangerth Date: Fri, 18 Jan 2013 21:39:41 +0000 Subject: [PATCH] Work around a bug in icc13. git-svn-id: https://svn.dealii.org/trunk@28138 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/aclocal.m4 | 33 ++++++++++++++++++-- deal.II/configure | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+), 2 deletions(-) diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index 92254d9f81..a5e553a871 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -9,7 +9,7 @@ dnl In doc/Makefile some information on the kind of documentation dnl is stored. dnl dnl -dnl Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors +dnl Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors dnl dnl $Id$ @@ -1300,6 +1300,36 @@ AC_DEFUN(DEAL_II_CHECK_CXX1X_COMPONENTS, dnl [ AC_MSG_RESULT(no); all_cxx1x_classes_available=no ] ) + + dnl icc-13 triggers an internal compiler error when compiling + dnl std::numeric_limits<...>::min() with -std=c++0x [1]. + dnl Just disable C++11 support completely in this case. + dnl + dnl Reported by Ted Kord. + dnl + dnl [1] http://software.intel.com/en-us/forums/topic/328902 + AC_MSG_CHECKING(for icc13 bug with C++11) + AC_TRY_COMPILE( + [ + #include + + struct Integer + { + static const int min_int_value; + static const int max_int_value; + }; + const int Integer::min_int_value = std::numeric_limits::min(); + const int Integer::max_int_value = std::numeric_limits::max(); + ], + [], + [ + AC_MSG_RESULT(no) + ], + [ + AC_MSG_RESULT(yes); all_cxx1x_classes_available=no + ] + ) + CXXFLAGS="${OLD_CXXFLAGS}" dnl If the above classes and operations are all defined then we can @@ -7486,4 +7516,3 @@ AC_DEFUN(DEAL_II_CONFIGURE_P4EST, dnl AC_MSG_RESULT(no) fi ]) - diff --git a/deal.II/configure b/deal.II/configure index df5a12c572..d82df09718 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -4477,6 +4477,44 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; all_cxx1x_classes_available=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for icc13 bug with C++11" >&5 +$as_echo_n "checking for icc13 bug with C++11... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + + struct Integer + { + static const int min_int_value; + static const int max_int_value; + }; + const int Integer::min_int_value = std::numeric_limits::min(); + const int Integer::max_int_value = std::numeric_limits::max(); + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; all_cxx1x_classes_available=no + + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext @@ -5250,6 +5288,44 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; all_cxx1x_classes_available=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for icc13 bug with C++11" >&5 +$as_echo_n "checking for icc13 bug with C++11... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + + struct Integer + { + static const int min_int_value; + static const int max_int_value; + }; + const int Integer::min_int_value = std::numeric_limits::min(); + const int Integer::max_int_value = std::numeric_limits::max(); + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; all_cxx1x_classes_available=no + + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -- 2.39.5