From 0c0a8d5c102094046c05bae72b52e89cfc38c64f Mon Sep 17 00:00:00 2001 From: bangerth Date: Thu, 1 Jul 2010 21:44:37 +0000 Subject: [PATCH] Take over patch 21439 from mainline. git-svn-id: https://svn.dealii.org/branches/releases/Branch-6-3@21440 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/aclocal.m4 | 48 +++++++++++ deal.II/base/include/base/config.h.in | 4 + deal.II/configure | 84 ++++++++++++++++++- deal.II/configure.in | 1 + .../deal.II/source/dofs/dof_renumbering.cc | 27 +++++- deal.II/doc/news/changes.h | 9 ++ 6 files changed, 170 insertions(+), 3 deletions(-) diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index 28c82c953e..cd21ce8657 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -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 +#include + +namespace types +{ + using namespace boost; + + typedef adjacency_list > > 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 ------------------------------------------------------------- diff --git a/deal.II/base/include/base/config.h.in b/deal.II/base/include/base/config.h.in index cf1b1dfb49..607681f3e6 100644 --- a/deal.II/base/include/base/config.h.in +++ b/deal.II/base/include/base/config.h.in @@ -69,6 +69,10 @@ 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 diff --git a/deal.II/configure b/deal.II/configure index f743a7993c..8f77cba52c 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -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 +#include + +namespace types +{ + using namespace boost; + + typedef adjacency_list > > 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 diff --git a/deal.II/configure.in b/deal.II/configure.in index 5becb1367c..07d100d9a2 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -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 diff --git a/deal.II/deal.II/source/dofs/dof_renumbering.cc b/deal.II/deal.II/source/dofs/dof_renumbering.cc index 81d3fbad6e..990948db7e 100644 --- a/deal.II/deal.II/source/dofs/dof_renumbering.cc +++ b/deal.II/deal.II/source/dofs/dof_renumbering.cc @@ -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 @@ -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::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::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 } diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 81c4d4e8c2..deba04f817 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -38,6 +38,15 @@ inconvenience this causes.

General

    +
  1. +

    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. +
    + (WB 2010/07/01) +

    +
  2. 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 -- 2.39.5