]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Detect common problem with Sacado_cmath.hpp and link to a solution.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 29 Jun 2011 22:18:11 +0000 (22:18 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 29 Jun 2011 22:18:11 +0000 (22:18 +0000)
git-svn-id: https://svn.dealii.org/trunk@23883 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/aclocal.m4
deal.II/configure

index a83764eec325a4ab5b23d0b1113038ac203b2444..0042b549694beafb16994d46e16c825f5c2b4007 100644 (file)
@@ -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 \
index 910c711d9e354438df2e7d30973f085c674dbfaa..e8265b647ff12b454031eaac4615ec062bc7cc6b 100755 (executable)
@@ -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 \

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.