]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Take over patch 21439 from mainline.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 1 Jul 2010 21:44:37 +0000 (21:44 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 1 Jul 2010 21:44:37 +0000 (21:44 +0000)
git-svn-id: https://svn.dealii.org/branches/releases/Branch-6-3@21440 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/aclocal.m4
deal.II/base/include/base/config.h.in
deal.II/configure
deal.II/configure.in
deal.II/deal.II/source/dofs/dof_renumbering.cc
deal.II/doc/news/changes.h

index 28c82c953e6bb7c44ab7c1057ba0e215f2051cd8..cd21ce8657988465dd471af388e8751f992ebd45 100644 (file)
@@ -4289,6 +4289,54 @@ void bug_function (number test)
 
 
 
+dnl -------------------------------------------------------------
+dnl Some older versions of GCC (3.x series) have trouble with a
+dnl certain part of the BOOST GRAPH library, yielding errors of
+dnl the kind "sorry, unimplemented: use of `enumeral_type' in
+dnl template type unification".
+dnl
+dnl Usage: DEAL_II_CHECK_BOOST_GRAPH_COMPILER_BUG
+dnl
+dnl -------------------------------------------------------------
+AC_DEFUN(DEAL_II_CHECK_BOOST_GRAPH_COMPILER_BUG, dnl
+[
+  if test "x$GXX" = "xyes" ; then
+    AC_MSG_CHECKING(for boost::graph compiler internal error)
+    AC_LANG(C++)
+    CXXFLAGS="$CXXFLAGSO -I./contrib/boost/include"
+    AC_TRY_COMPILE(
+      [
+#include <boost/graph/adjacency_list.hpp>
+#include <boost/graph/properties.hpp>
+
+namespace types
+{
+  using namespace boost;
+
+  typedef adjacency_list<vecS, vecS, undirectedS,
+                        property<vertex_color_t, default_color_type,
+                                 property<vertex_degree_t,int> > > Graph;
+}
+
+void create_graph (types::Graph)
+{}
+      ],
+      [
+      ],
+      [
+        AC_MSG_RESULT(no)
+      ],
+      [
+        AC_MSG_RESULT(yes)
+       AC_DEFINE(DEAL_II_BOOST_GRAPH_COMPILER_BUG, 1,
+                 [Defined if the compiler gets an internal error compiling
+                  some code that involves boost::graph])
+      ])
+  fi
+])
+
+
+
 dnl -------------------------------------------------------------
 dnl Check for boost option and find pre-installed boost
 dnl -------------------------------------------------------------
index cf1b1dfb49721c7c41f966241e70e48a5d8648d7..607681f3e68e499d0013149c65c230dbf9c7b9b5 100644 (file)
    involves boost::bind */
 #undef DEAL_II_BOOST_BIND_COMPILER_BUG
 
+/* Defined if the compiler gets an internal error compiling some code that
+   involves boost::graph */
+#undef DEAL_II_BOOST_GRAPH_COMPILER_BUG
+
 /* Define if the use of socket functionality leads to strange results with
    floating point computations on cygwin systems. */
 #undef DEAL_II_BROKEN_SOCKETS
index f743a7993c3c9bcc85871cf84f49d038560297a1..8f77cba52cae2daffd3d0bf4d23880a27abe249a 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 21337 .
+# From configure.in Revision: 21410 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.63 for deal.II 6.3.0.
 #
@@ -8218,6 +8218,88 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
 
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  fi
+
+
+  if test "x$GXX" = "xyes" ; then
+    { $as_echo "$as_me:$LINENO: checking for boost::graph compiler internal error" >&5
+$as_echo_n "checking for boost::graph compiler internal error... " >&6; }
+    ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+    CXXFLAGS="$CXXFLAGSO -I./contrib/boost/include"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <boost/graph/adjacency_list.hpp>
+#include <boost/graph/properties.hpp>
+
+namespace types
+{
+  using namespace boost;
+
+  typedef adjacency_list<vecS, vecS, undirectedS,
+                        property<vertex_color_t, default_color_type,
+                                 property<vertex_degree_t,int> > > Graph;
+}
+
+void create_graph (types::Graph)
+{}
+
+int
+main ()
+{
+
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+
+        { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+        { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define DEAL_II_BOOST_GRAPH_COMPILER_BUG 1
+_ACEOF
+
+
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
index 5becb1367c5750c9f04f85f96c51487485f7c6d9..07d100d9a2e9fbd9f178284850c657a7f964ab0c 100644 (file)
@@ -187,6 +187,7 @@ DEAL_II_CHECK_ARRAY_CONDITIONAL_DECAY_BUG
 DEAL_II_CHECK_ARRAY_ARG_BUG
 DEAL_II_CHECK_EXPLICIT_CONSTRUCTOR_BUG
 DEAL_II_CHECK_BOOST_BIND_COMPILER_BUG
+DEAL_II_CHECK_BOOST_GRAPH_COMPILER_BUG
 DEAL_II_CHECK_CONST_MEMBER_DEDUCTION_BUG
 DEAL_II_CHECK_TYPE_QUALIFIER_BUG
 DEAL_II_CHECK_WSYNTH_AND_STD_COMPLEX
index 81d3fbad6e659a8c4e3c025109cea61f8cf57a52..990948db7e046d40184fb017586565ca8d346856 100644 (file)
@@ -122,6 +122,7 @@ namespace DoFRenumbering
 
   namespace boost
   {
+#ifndef DEAL_II_BOOST_GRAPH_COMPILER_BUG
     namespace types
     {
       using namespace ::boost;
@@ -168,9 +169,9 @@ namespace DoFRenumbering
        graph_degree = get(::boost::vertex_degree, graph);
        for (::boost::tie(ui, ui_end) = vertices(graph); ui != ui_end; ++ui)
          graph_degree[*ui] = degree(*ui, graph);
-
-      }
+       }
     }
+#endif
 
 
     template <class DH>
@@ -198,6 +199,16 @@ namespace DoFRenumbering
                           const bool       reversed_numbering,
                           const bool       use_constraints)
     {
+#ifdef DEAL_II_BOOST_GRAPH_COMPILER_BUG
+      (void)new_dof_indices;
+      (void)dof_handler;
+      (void)reversed_numbering;
+      (void)use_constraints;
+      Assert (false,
+             ExcMessage ("Due to a bug in your compiler, this function triggers an internal "
+                         "compiler error and has been disabled. If you need to use the "
+                         "function, you need to upgrade to a newer version of the compiler."));
+#else
       types::Graph
        graph(dof_handler.n_dofs());
       types::property_map<types::Graph,types::vertex_degree_t>::type
@@ -226,6 +237,7 @@ namespace DoFRenumbering
       Assert (std::find (new_dof_indices.begin(), new_dof_indices.end(),
                         DH::invalid_dof_index) == new_dof_indices.end(),
              ExcInternalError());
+#endif
     }
 
 
@@ -255,6 +267,16 @@ namespace DoFRenumbering
                           const bool       reversed_numbering,
                           const bool       use_constraints)
     {
+#ifdef DEAL_II_BOOST_GRAPH_COMPILER_BUG
+      (void)new_dof_indices;
+      (void)dof_handler;
+      (void)reversed_numbering;
+      (void)use_constraints;
+      Assert (false,
+             ExcMessage ("Due to a bug in your compiler, this function triggers an internal "
+                         "compiler error and has been disabled. If you need to use the "
+                         "function, you need to upgrade to a newer version of the compiler."));
+#else
       types::Graph
        graph(dof_handler.n_dofs());
       types::property_map<types::Graph,types::vertex_degree_t>::type
@@ -279,6 +301,7 @@ namespace DoFRenumbering
       Assert (std::find (new_dof_indices.begin(), new_dof_indices.end(),
                         DH::invalid_dof_index) == new_dof_indices.end(),
              ExcInternalError());
+#endif
     }
 
 
index 81c4d4e8c21721bf2e3643d80907366f598dc984..deba04f8170a187a0bdb1dff82485214d18e2f3f 100644 (file)
@@ -38,6 +38,15 @@ inconvenience this causes.
 <h3>General</h3>
 
 <ol>
+  <li>
+  <p>Fixed: Some older 3.x versions of GCC crashed compiling the functions in
+  namespace DoFRenumbering::boost. There is now a configuration time test
+  that checks that the compiler accepts the constructs in question. If the
+  compiler does not, then these functions are disabled.
+  <br>
+  (WB 2010/07/01)
+  </p>
+
   <li>
   <p>Fixed: Linking with more than one of the deal.II 1d, 2d, or 3d libraries
   when using static libraries did not work. This is now fixed. However, due to

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.