From e82bc437537141f03b8ca7978e82e1a0dc1e67b9 Mon Sep 17 00:00:00 2001 From: wolf Date: Thu, 12 Oct 2000 07:51:15 +0000 Subject: [PATCH] DEAL_II_CHECK_ASSERT_THROW git-svn-id: https://svn.dealii.org/trunk@3418 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/aclocal.m4 | 32 ++++++++++++++++ deal.II/configure | 90 ++++++++++++++++++++++---------------------- deal.II/configure.in | 11 ++++++ 3 files changed, 89 insertions(+), 44 deletions(-) diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index 15f374e7c0..b2f01df5f6 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -269,3 +269,35 @@ AC_DEFUN(DEAL_II_CHECK_ISNAN_FLAG, dnl fi fi ) + + + +dnl On some systems (well, DEC Alphas are the only ones we know of), +dnl gcc2.95 throws the hands in the air if it sees one of the AssertThrow +dnl calls, and dies with an internal compiler error. If this is the case, +dnl we disable AssertThrow and simply replace it with an `abort' if the +dnl condition is not satisfied. +dnl +dnl Usage: DEAL_II_CHECK_ASSERT_THROW("description of options set", +dnl "compiler options set", +dnl action if compiler crashes) +dnl +AC_DEFUN(DEAL_II_CHECK_ASSERT_THROW, dnl + AC_MSG_CHECKING(whether AssertThrow works with $1 flags) + AC_REQUIRE([AC_LANG_CPLUSPLUS]) + CXXFLAGS=$2 + AC_TRY_COMPILE( + [ +#include "base/include/base/exceptions.h" + ], + [ + AssertThrow (false, ExcInternalError()); + ], + [ + AC_MSG_RESULT("yes") + ], + [ + AC_MSG_RESULT("no") + $3 + ]) +) \ No newline at end of file diff --git a/deal.II/configure b/deal.II/configure index ec5701e638..6c3c4f2076 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -1,6 +1,6 @@ #! /bin/sh -# From configure.in Revision: 1.38 +# From configure.in Revision: 1.39 @@ -1367,6 +1367,8 @@ rm -f conftest* + + # Check whether --enable-multithreading or --disable-multithreading was given. if test "${enable_multithreading+set}" = set; then enableval="$enable_multithreading" @@ -1381,7 +1383,7 @@ fi if test $enablemultithreading = yes ; then echo $ac_n "checking for platform specific thread flags""... $ac_c" 1>&6 -echo "configure:1385: checking for platform specific thread flags" >&5 +echo "configure:1387: checking for platform specific thread flags" >&5 for i in threads mt pthread pthreads mthreads Kthread kthread invalid_last_entry; do CXXFLAGS="$CXXFLAGSG -$i" @@ -1417,10 +1419,10 @@ echo "configure:1385: checking for platform specific thread flags" >&5 echo $ac_n "checking for platform specific multi-threading defines""... $ac_c" 1>&6 -echo "configure:1421: checking for platform specific multi-threading defines" >&5 +echo "configure:1423: checking for platform specific multi-threading defines" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1440: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t"""not necessary"" 1>&6 @@ -1476,7 +1478,7 @@ fi if test $withmultithreading != no ; then echo $ac_n "checking for ACE""... $ac_c" 1>&6 -echo "configure:1480: checking for ACE" >&5 +echo "configure:1482: checking for ACE" >&5 if test -d $withmultithreading ; then echo "$ac_t""found" 1>&6 else @@ -1496,7 +1498,7 @@ if test "${with_blas+set}" = set; then withval="$with_blas" if test $withval != no ; then echo $ac_n "checking for BLAS""... $ac_c" 1>&6 -echo "configure:1500: checking for BLAS" >&5 +echo "configure:1502: checking for BLAS" >&5 if test -r $withval ; then echo "$ac_t""found" 1>&6 else @@ -1512,7 +1514,7 @@ EOF else echo $ac_n "checking for main in -lblas""... $ac_c" 1>&6 -echo "configure:1516: checking for main in -lblas" >&5 +echo "configure:1518: checking for main in -lblas" >&5 ac_lib_var=`echo blas'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1520,14 +1522,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lblas $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1559,7 +1561,7 @@ if test "${with_lapack+set}" = set; then withval="$with_lapack" if test $withval != no ; then echo $ac_n "checking for LAPACK""... $ac_c" 1>&6 -echo "configure:1563: checking for LAPACK" >&5 +echo "configure:1565: checking for LAPACK" >&5 if test -r $withval ; then echo "$ac_t""found" 1>&6 else @@ -1575,7 +1577,7 @@ EOF else echo $ac_n "checking for dgels_ in -llapack""... $ac_c" 1>&6 -echo "configure:1579: checking for dgels_ in -llapack" >&5 +echo "configure:1581: checking for dgels_ in -llapack" >&5 ac_lib_var=`echo lapack'_'dgels_ | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1583,7 +1585,7 @@ else ac_save_LIBS="$LIBS" LIBS="-llapack $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1664,7 +1666,7 @@ else fi echo $ac_n "checking for kdoc""... $ac_c" 1>&6 -echo "configure:1668: checking for kdoc" >&5 +echo "configure:1670: checking for kdoc" >&5 if test "$kdocdir" != ${DEAL2_DIR}/contrib/kdoc/bin ; then if test -r $kdocdir/kdoc ; then echo "$ac_t""found" 1>&6 @@ -1700,7 +1702,7 @@ if test "$docxx" = to-be-determined ; then # Extract the first word of ""doc++"", so it can be a program name with args. set dummy "doc++"; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1704: checking for $ac_word" >&5 +echo "configure:1706: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_docxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1734,7 +1736,7 @@ fi else echo $ac_n "checking for doc++""... $ac_c" 1>&6 -echo "configure:1738: checking for doc++" >&5 +echo "configure:1740: checking for doc++" >&5 if test -x "$docxx" ; then echo "$ac_t""yes" 1>&6 else @@ -1749,7 +1751,7 @@ fi echo $ac_n "checking whether getrusage is properly declared""... $ac_c" 1>&6 -echo "configure:1753: checking whether getrusage is properly declared" >&5 +echo "configure:1755: checking whether getrusage is properly declared" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' @@ -1759,7 +1761,7 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < @@ -1771,7 +1773,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1775: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t"""yes"" 1>&6 @@ -1789,12 +1791,12 @@ fi rm -f conftest* echo $ac_n "checking whether isnan is declared with debug flags""... $ac_c" 1>&6 -echo "configure:1793: checking whether isnan is declared with debug flags" >&5 +echo "configure:1795: checking whether isnan is declared with debug flags" >&5 CXXFLAGS=$CXXFLAGSG deal_II_isnan_flag="" cat > conftest.$ac_ext < @@ -1806,7 +1808,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1810: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1812: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t"""yes"" 1>&6 @@ -1822,7 +1824,7 @@ rm -f conftest* if test "x$deal_II_isnan_flag" = "x" ; then cat > conftest.$ac_ext < @@ -1834,7 +1836,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1838: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1840: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t"""yes"" 1>&6 @@ -1854,7 +1856,7 @@ rm -f conftest* for testflag in -D_ISOC99_SOURCE -D__EXTENSIONS__ ; do CXXFLAGS="$CXXFLAGSG $testflag" cat > conftest.$ac_ext < @@ -1866,7 +1868,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1870: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* deal_II_isnan_flag="-DHAVE_ISNAN $testflag" @@ -1879,7 +1881,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < @@ -1891,7 +1893,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1895: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1897: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* deal_II_isnan_flag="-DHAVE_UNDERSCORE_ISNAN $testflag" @@ -1913,12 +1915,12 @@ rm -f conftest* fi echo $ac_n "checking whether isnan is declared with optimized flags""... $ac_c" 1>&6 -echo "configure:1917: checking whether isnan is declared with optimized flags" >&5 +echo "configure:1919: checking whether isnan is declared with optimized flags" >&5 CXXFLAGS=$CXXFLAGSO deal_II_isnan_flag="" cat > conftest.$ac_ext < @@ -1930,7 +1932,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1934: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1936: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t"""yes"" 1>&6 @@ -1946,7 +1948,7 @@ rm -f conftest* if test "x$deal_II_isnan_flag" = "x" ; then cat > conftest.$ac_ext < @@ -1958,7 +1960,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1962: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1964: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t"""yes"" 1>&6 @@ -1978,7 +1980,7 @@ rm -f conftest* for testflag in -D_ISOC99_SOURCE -D__EXTENSIONS__ ; do CXXFLAGS="$CXXFLAGSO $testflag" cat > conftest.$ac_ext < @@ -1990,7 +1992,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1996: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* deal_II_isnan_flag="-DHAVE_ISNAN $testflag" @@ -2003,7 +2005,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < @@ -2015,7 +2017,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:2019: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2021: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* deal_II_isnan_flag="-DHAVE_UNDERSCORE_ISNAN $testflag" @@ -2055,16 +2057,16 @@ esac CXXFLAGS="$CXXFLAGSG" echo $ac_n "checking for consistency of CXXFLAGSG flags""... $ac_c" 1>&6 -echo "configure:2059: checking for consistency of CXXFLAGSG flags" >&5 +echo "configure:2061: checking for consistency of CXXFLAGSG flags" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2070: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 @@ -2082,16 +2084,16 @@ rm -f conftest* CXXFLAGS="$CXXFLAGSO" echo $ac_n "checking for consistency of CXXFLAGSO flags""... $ac_c" 1>&6 -echo "configure:2086: checking for consistency of CXXFLAGSO flags" >&5 +echo "configure:2088: checking for consistency of CXXFLAGSO flags" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2097: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 diff --git a/deal.II/configure.in b/deal.II/configure.in index ed04ffb926..13b8d59994 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -223,6 +223,17 @@ AC_SUBST(CXXFLAGSO) +dnl On some systems (well, DEC Alphas are the only ones we know of), +dnl gcc2.95 throws the hands in the air if it sees one of the AssertThrow +dnl calls, and dies with an internal compiler error. If this is the case, +dnl we disable AssertThrow and simply replace it with an `abort' if the +dnl condition is not satisfied. Check this for debug and optimized mode +dnl compiler flags, and define `DISABLE_ASSERT_THROW' if necessary. +DEAL_II_CHECK_ASSERT_THROW(debug, $CXXFLAGSG, CXXFLAGSG="-DDISABLE_ASSERT_THROW $CXXFLAGSG") +DEAL_II_CHECK_ASSERT_THROW(optimized, $CXXFLAGSO, CXXFLAGSO="-DDISABLE_ASSERT_THROW $CXXFLAGSO") + + + dnl ------------------------------------------------------------- dnl Multithreading -- 2.39.5