From: deal Date: Tue, 23 Nov 2004 16:08:32 +0000 (+0000) Subject: Use the proper fix for the -wd1572 problem. X-Git-Tag: v8.0.0~14667 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3237358385323a35dbe191e4bc4b5e24185024a3;p=dealii.git Use the proper fix for the -wd1572 problem. git-svn-id: https://svn.dealii.org/trunk@9805 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index e179a0e3bb..eecc0ad83d 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -469,17 +469,10 @@ AC_DEFUN(DEAL_II_SET_CXX_FLAGS, dnl CXXFLAGSO="$CXXFLAGSO -opt_report_levelmin" fi - dnl For icc 7 and above, add this warning inhibition flag: - dnl #1572: `floating-point equality and inequality comparisons are - dnl unreliable' - dnl (while true, this warning also triggers on comparisons - dnl with zero, or comparing two variables for which one is - dnl greater; there is about no way to write numeric code - dnl without triggering this warning many times over) - if test "x$GXX_VERSION" != "xintel_icc5" \ - -a "x$GXX_VERSION" != "xintel_icc6"; then - CXXFLAGSG="$CXXFLAGSG -wd1572" - fi + dnl Some versions of icc on some platforms issue a lot of warnings + dnl about the unreliability of floating point comparisons. Check + dnl whether we can switch that off + DEAL_II_ICC_WD_1572 dnl We would really like to use -ansi -Xc, since that dnl is _very_ picky about standard C++, and is thus very efficient @@ -3428,6 +3421,37 @@ AC_DEFUN(DEAL_II_CHECK_BOOST_SHARED_PTR_ASSIGNMENT, dnl +dnl ------------------------------------------------------------- +dnl Some versions of icc on some platforms issue a lot of warnings +dnl about the unreliability of floating point comparisons. Check +dnl whether we can switch that off by checking whether the compiler +dnl allows -wdXXXX for this warning: +dnl #1572: `floating-point equality and inequality comparisons are +dnl unreliable' +dnl (while true, this warning also triggers on comparisons +dnl with zero, or comparing two variables for which one is +dnl greater; there is about no way to write numeric code +dnl without triggering this warning many times over) +dnl +dnl Usage: DEAL_II_ICC_WD_1572 +dnl +dnl ------------------------------------------------------------- +AC_DEFUN(DEAL_II_ICC_WD_1572, dnl +[ + AC_MSG_CHECKING(whether -wd1572 is allowed) + AC_LANG(C++) + CXXFLAGS="$CXXFLAGSG -wd1572" + AC_TRY_COMPILE( [], [], + [ + AC_MSG_RESULT(yes) + CXXFLAGSG="$CXXFLAGSG -wd1572" + ], + [ + AC_MSG_RESULT(no) + ]) +]) + + dnl ------------------------------------------------------------- dnl gcc2.95 doesn't have the std::iterator class, but the standard dnl requires it, so check whether we have to work around it diff --git a/deal.II/configure b/deal.II/configure index f98cdabf64..dcf29edeb2 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -3275,7 +3275,7 @@ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ;; intel_icc*) - CXXFLAGSG="$CXXFLAGS -Kc++eh -Krtti -w1 -wd175 -wd525 -wd327 -wd424 -wd11 -wd1572 -wd734 -wd858 -DDEBUG -inline_debug_info" + CXXFLAGSG="$CXXFLAGS -Kc++eh -Krtti -w1 -wd175 -wd525 -wd327 -wd424 -wd11 -wd734 -wd858 -DDEBUG -inline_debug_info" CXXFLAGSO="$CXXFLAGS -Kc++eh -Krtti -O2 -unroll -w0 -wd424 -wd11" CXXFLAGSPIC="-KPIC" LDFLAGSPIC="-KPIC" @@ -3284,6 +3284,70 @@ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext CXXFLAGSO="$CXXFLAGSO -opt_report_levelmin" fi + + echo "$as_me:$LINENO: checking whether -wd1572 is allowed" >&5 +echo $ECHO_N "checking whether -wd1572 is allowed... $ECHO_C" >&6 + ac_ext=cc +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="$CXXFLAGSG -wd1572" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + CXXFLAGSG="$CXXFLAGSG -wd1572" + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + + if test "x$GXX_VERSION" = "xintel_icc7"; then CXXFLAGSG="$CXXFLAGSG -Xc -ansi" CXXFLAGSO="$CXXFLAGSO -ansi_alias"