From: bangerth Date: Wed, 29 Jun 2011 22:18:11 +0000 (+0000) Subject: Detect common problem with Sacado_cmath.hpp and link to a solution. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74f1f133151d63bb964c81637459df81ac88aaac;p=dealii-svn.git Detect common problem with Sacado_cmath.hpp and link to a solution. git-svn-id: https://svn.dealii.org/trunk@23883 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index a83764eec3..0042b54969 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -6543,6 +6543,27 @@ AC_DEFUN(DEAL_II_CHECK_TRILINOS_HEADER_FILES, dnl echo "#undef HAVE_INTTYPES_H" >> confdefs.h echo "#endif" >> confdefs.h + dnl Sacado_cmath.hpp does things that aren't compatible + dnl with the -std=c++0x flag of GCC, see deal.II FAQ. + dnl Test whether that is indeed the case + if test -f $DEAL_II_TRILINOS_INCDIR/Sacado_cmath.hpp ; then + CXX_FLAGS_SAVED="$CXXFLAGS" + CXXFLAGS="$CXXFLAGSG -I$DEAL_II_TRILINOS_INCDIR" + AC_MSG_CHECKING([whether Sacado_cmath.hpp is C++11 compatible]) + AC_TRY_COMPILE([Sacado_cmath.hpp], + [;], + [ + AC_MSG_RESULT([yes]) + ], + [ + AC_MSG_RESULT([no]) + AC_MSG_ERROR([*** Your Trilinos installation is not compatible with the C++ standard selected for this compiler. See the deal.II FAQ page for a solution. ***]) + ]) + else + AC_MSG_ERROR([File $DEAL_II_TRILINOS_INCDIR/Sacado_cmath.hpp not found.]) + fi + + dnl Now just check that all headers we need are in fact there AC_CHECK_HEADERS([Amesos.h \ Epetra_CrsGraph.h \ Epetra_CrsMatrix.h \ diff --git a/deal.II/configure b/deal.II/configure index 910c711d9e..e8265b647f 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -10901,7 +10901,40 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext echo "#undef HAVE_INTTYPES_H" >> confdefs.h echo "#endif" >> confdefs.h - for ac_header in Amesos.h \ + if test -f $DEAL_II_TRILINOS_INCDIR/Sacado_cmath.hpp ; then + CXX_FLAGS_SAVED="$CXXFLAGS" + CXXFLAGS="$CXXFLAGSG -I$DEAL_II_TRILINOS_INCDIR" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Sacado_cmath.hpp is C++11 compatible" >&5 +$as_echo_n "checking whether Sacado_cmath.hpp is C++11 compatible... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +Sacado_cmath.hpp +int +main () +{ +; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "*** Your Trilinos installation is not compatible with the C++ standard selected for this compiler. See the deal.II FAQ page for a solution. ***" "$LINENO" 5 + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + else + as_fn_error $? "File $DEAL_II_TRILINOS_INCDIR/Sacado_cmath.hpp not found." "$LINENO" 5 + fi + + for ac_header in Amesos.h \ Epetra_CrsGraph.h \ Epetra_CrsMatrix.h \ Epetra_Import.h \