From 9b888cc4de6414c6f163da58f8f50329a1f10e58 Mon Sep 17 00:00:00 2001 From: wolf Date: Tue, 19 Sep 2000 09:35:16 +0000 Subject: [PATCH] Check for _isnan besides for isnan. git-svn-id: https://svn.dealii.org/trunk@3337 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/configure | 224 ++++++++++++++++++++------- deal.II/lac/source/solver_control.cc | 6 + 2 files changed, 170 insertions(+), 60 deletions(-) diff --git a/deal.II/configure b/deal.II/configure index 9a94116c43..5a774d3269 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -1,6 +1,6 @@ #! /bin/sh -# From configure.in Revision: 1.33 +# From configure.in Revision: 1.34 @@ -1700,8 +1700,9 @@ rm -f conftest* echo "configure:1701: checking whether isnan is declared with debug flags" >&5 CXXFLAGS=$CXXFLAGSG + deal_II_isnan_flag="" cat > conftest.$ac_ext < @@ -1713,7 +1714,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1717: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t"""yes"" 1>&6 @@ -1723,57 +1724,109 @@ if { (eval echo configure:1717: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - - deal_II_isnan_flag="" - for testflag in -D_ISOC99_SOURCE -D__EXTENSIONS__ ; do - CXXFLAGS="$CXXFLAGSG $testflag" - cat > conftest.$ac_ext < conftest.$ac_ext < - + int main() { - double d=0; - isnan (d); - + double d=0; + _isnan (d); + ; return 0; } EOF -if { (eval echo configure:1745: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1746: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - deal_II_isnan_flag="-DHAVE_ISNAN $testflag" - break; - + echo "$ac_t"""yes"" 1>&6 + deal_II_isnan_flag="-DHAVE_UNDERSCORE_ISNAN" + CXXFLAGSG="$deal_II_isnan_flag $CXXFLAGSG" + else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 +fi +rm -f conftest* + fi + + + if test $deal_II_isnan_flag = "" ; then + deal_II_isnan_flag="" + for testflag in -D_ISOC99_SOURCE -D__EXTENSIONS__ ; do + CXXFLAGS="$CXXFLAGSG $testflag" + cat > conftest.$ac_ext < + +int main() { + + double d=0; + isnan (d); + +; return 0; } +EOF +if { (eval echo configure:1778: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - + deal_II_isnan_flag="-DHAVE_ISNAN $testflag" + break; + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 fi rm -f conftest* - done - if test "$deal_II_isnan_flag" = "" ; then - echo "$ac_t""no." 1>&6 - else + cat > conftest.$ac_ext <&6 - CXXFLAGSG="$deal_II_isnan_flag $CXXFLAGSG" - fi - +#include + +int main() { + + double d=0; + _isnan (d); + +; return 0; } +EOF +if { (eval echo configure:1803: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + + deal_II_isnan_flag="-DHAVE_UNDERSCORE_ISNAN $testflag" + break; + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 fi rm -f conftest* + done + + if test "$deal_II_isnan_flag" = "" ; then + echo "$ac_t""no." 1>&6 + else + echo "$ac_t""using $testflag" 1>&6 + CXXFLAGSG="$deal_II_isnan_flag $CXXFLAGSG" + fi + fi echo $ac_n "checking whether isnan is declared with optimized flags""... $ac_c" 1>&6 -echo "configure:1773: checking whether isnan is declared with optimized flags" >&5 +echo "configure:1825: checking whether isnan is declared with optimized flags" >&5 CXXFLAGS=$CXXFLAGSO + deal_II_isnan_flag="" cat > conftest.$ac_ext < @@ -1785,7 +1838,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1789: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1842: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t"""yes"" 1>&6 @@ -1795,50 +1848,101 @@ if { (eval echo configure:1789: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - - deal_II_isnan_flag="" - for testflag in -D_ISOC99_SOURCE -D__EXTENSIONS__ ; do - CXXFLAGS="$CXXFLAGSO $testflag" - cat > conftest.$ac_ext < conftest.$ac_ext < - + int main() { - double d=0; - isnan (d); - + double d=0; + _isnan (d); + ; return 0; } EOF -if { (eval echo configure:1817: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1870: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - deal_II_isnan_flag="-DHAVE_ISNAN $testflag" - break; - + echo "$ac_t"""yes"" 1>&6 + deal_II_isnan_flag="-DHAVE_UNDERSCORE_ISNAN" + CXXFLAGSO="$deal_II_isnan_flag $CXXFLAGSO" + else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 +fi +rm -f conftest* + fi + + + if test $deal_II_isnan_flag = "" ; then + deal_II_isnan_flag="" + for testflag in -D_ISOC99_SOURCE -D__EXTENSIONS__ ; do + CXXFLAGS="$CXXFLAGSO $testflag" + cat > conftest.$ac_ext < + +int main() { + + double d=0; + isnan (d); + +; return 0; } +EOF +if { (eval echo configure:1902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - + deal_II_isnan_flag="-DHAVE_ISNAN $testflag" + break; + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 fi rm -f conftest* - done - if test "$deal_II_isnan_flag" = "" ; then - echo "$ac_t""no." 1>&6 - else + cat > conftest.$ac_ext <&6 - CXXFLAGSO="$deal_II_isnan_flag $CXXFLAGSO" - fi - +#include + +int main() { + + double d=0; + _isnan (d); + +; return 0; } +EOF +if { (eval echo configure:1927: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + + deal_II_isnan_flag="-DHAVE_UNDERSCORE_ISNAN $testflag" + break; + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 fi rm -f conftest* + done + + if test "$deal_II_isnan_flag" = "" ; then + echo "$ac_t""no." 1>&6 + else + echo "$ac_t""using $testflag" 1>&6 + CXXFLAGSO="$deal_II_isnan_flag $CXXFLAGSO" + fi + fi @@ -1859,16 +1963,16 @@ esac CXXFLAGS="$CXXFLAGSG" echo $ac_n "checking for consistency of CXXFLAGSG flags""... $ac_c" 1>&6 -echo "configure:1863: checking for consistency of CXXFLAGSG flags" >&5 +echo "configure:1967: checking for consistency of CXXFLAGSG flags" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1976: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 @@ -1886,16 +1990,16 @@ rm -f conftest* CXXFLAGS="$CXXFLAGSO" echo $ac_n "checking for consistency of CXXFLAGSO flags""... $ac_c" 1>&6 -echo "configure:1890: checking for consistency of CXXFLAGSO flags" >&5 +echo "configure:1994: checking for consistency of CXXFLAGSO flags" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2003: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 diff --git a/deal.II/lac/source/solver_control.cc b/deal.II/lac/source/solver_control.cc index faeb234e67..e56f9951ed 100644 --- a/deal.II/lac/source/solver_control.cc +++ b/deal.II/lac/source/solver_control.cc @@ -68,6 +68,12 @@ SolverControl::check (const unsigned int step, if ((step >= maxsteps) || #ifdef HAVE_ISNAN isnan(check_value) || +#else +# if HAVE_UNDERSCORE_ISNAN + // on Microsoft Windows, the + // function is called _isnan + _isnan(check_value) || +# endif #endif (check_failure && (check_value > failure_residual)) ) -- 2.39.5