From e36e9989ead8d12b73682606638ab2b2a186efae Mon Sep 17 00:00:00 2001 From: bangerth Date: Fri, 17 Oct 2008 00:19:55 +0000 Subject: [PATCH] Use less -W... options when compiling with trilinos to suppress the millions of warnings trilinos produces in its header files. git-svn-id: https://svn.dealii.org/trunk@17252 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/aclocal.m4 | 54 +++++++++++++++ deal.II/configure | 161 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 215 insertions(+) diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index 29ef7d97ef..19840bf58d 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -5463,6 +5463,7 @@ AC_DEFUN(DEAL_II_CONFIGURE_TRILINOS, dnl DEAL_II_DEFINE_DEAL_II_USE_TRILINOS=DEAL_II_USE_TRILINOS DEAL_II_CHECK_TRILINOS_SHARED_STATIC + DEAL_II_CHECK_TRILINOS_WARNINGS DEAL_II_EXPAND_TRILINOS_VECTOR="TrilinosWrappers::Vector" DEAL_II_EXPAND_TRILINOS_MPI_VECTOR="TrilinosWrappers::MPI::Vector" @@ -5543,6 +5544,59 @@ AC_DEFUN(DEAL_II_CHECK_TRILINOS_SHARED_STATIC, dnl ]) + +dnl ------------------------------------------------------------ +dnl Trilinos has headers that produce tons of warnings when +dnl used with -W -Wall (which includes -Wunused). Regrettable +dnl though it may be, these warnings pretty much drown everything +dnl else and we better disable some of the warnings to enable us +dnl to see through the clutter. +dnl +dnl Usage: DEAL_II_CHECK_TRILINOS_WARNINGS +dnl +dnl ------------------------------------------------------------ +AC_DEFUN(DEAL_II_CHECK_TRILINOS_WARNINGS, dnl +[ + OLD_CXXFLAGS="$CXXFLAGS" + + AC_MSG_CHECKING(whether we can use -Wno-unused to suppress Trilinos warnings) + CXXFLAGS=-Wno-unused + AC_TRY_COMPILE([], [;], + [ + AC_MSG_RESULT(yes) + CXXFLAGSG="$CXXFLAGSG -Wno-unused" + ], + [ + AC_MSG_RESULT(no) + ]) + + AC_MSG_CHECKING(whether we can use -Wno-overloaded-virtual to suppress Trilinos warnings) + CXXFLAGS=-Wno-overloaded-virtual + AC_TRY_COMPILE([], [;], + [ + AC_MSG_RESULT(yes) + CXXFLAGSG="$CXXFLAGSG -Wno-overloaded-virtual" + ], + [ + AC_MSG_RESULT(no) + ]) + + AC_MSG_CHECKING(whether we can use -Wno-extra to suppress Trilinos warnings) + CXXFLAGS=-Wno-extra + AC_TRY_COMPILE([], [;], + [ + AC_MSG_RESULT(yes) + CXXFLAGSG="$CXXFLAGSG -Wno-extra" + ], + [ + AC_MSG_RESULT(no) + ]) + + CXXFLAGS="${OLD_CXXFLAGS}" +]) + + + dnl ------------------------------------------------------------ dnl Check whether Metis is installed, and if so store the dnl respective links diff --git a/deal.II/configure b/deal.II/configure index 817dcbc346..e70db828dc 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -12227,6 +12227,167 @@ echo "$as_me: error: When building deal.II with shared libraries, Trilinos also fi + OLD_CXXFLAGS="$CXXFLAGS" + + { echo "$as_me:$LINENO: checking whether we can use -Wno-unused to suppress Trilinos warnings" >&5 +echo $ECHO_N "checking whether we can use -Wno-unused to suppress Trilinos warnings... $ECHO_C" >&6; } + CXXFLAGS=-Wno-unused + 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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $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 + 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 + + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + CXXFLAGSG="$CXXFLAGSG -Wno-unused" + +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 core conftest.err conftest.$ac_objext conftest.$ac_ext + + { echo "$as_me:$LINENO: checking whether we can use -Wno-overloaded-virtual to suppress Trilinos warnings" >&5 +echo $ECHO_N "checking whether we can use -Wno-overloaded-virtual to suppress Trilinos warnings... $ECHO_C" >&6; } + CXXFLAGS=-Wno-overloaded-virtual + 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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $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 + 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 + + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + CXXFLAGSG="$CXXFLAGSG -Wno-overloaded-virtual" + +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 core conftest.err conftest.$ac_objext conftest.$ac_ext + + { echo "$as_me:$LINENO: checking whether we can use -Wno-extra to suppress Trilinos warnings" >&5 +echo $ECHO_N "checking whether we can use -Wno-extra to suppress Trilinos warnings... $ECHO_C" >&6; } + CXXFLAGS=-Wno-extra + 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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $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 + 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 + + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + CXXFLAGSG="$CXXFLAGSG -Wno-extra" + +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 core conftest.err conftest.$ac_objext conftest.$ac_ext + + CXXFLAGS="${OLD_CXXFLAGS}" + + DEAL_II_EXPAND_TRILINOS_VECTOR="TrilinosWrappers::Vector" DEAL_II_EXPAND_TRILINOS_MPI_VECTOR="TrilinosWrappers::MPI::Vector" DEAL_II_EXPAND_TRILINOS_BLOCKVECTOR="TrilinosWrappers::BlockVector" -- 2.39.5