]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Check for bad interaction between gethostname and FP computations.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 2 Mar 2005 16:19:15 +0000 (16:19 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 2 Mar 2005 16:19:15 +0000 (16:19 +0000)
git-svn-id: https://svn.dealii.org/trunk@9951 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/aclocal.m4
deal.II/configure

index 4de5129f7df35dacd0c1a2cc273c2cdf98cc82b9..77dc38b8971e7e88490a14f0c0dcff8eab8c5425 100644 (file)
@@ -3979,6 +3979,7 @@ AC_DEFUN(DEAL_II_CHECK_GETHOSTNAME, dnl
     [
 #include <unistd.h>
 #include <limits>
+#include <iostream>
 
 int main()
 {
@@ -3988,11 +3989,14 @@ int main()
    volatile long double x=1.0;
    x += std::numeric_limits<long double>::epsilon();
 
-   return (x != 1.0);
+   if (x == 1.0)
+     return 1;  // this shouldn't happen...
+   else
+     return 0;
 }
     ],
     [
-      AC_MSG_RESULT(ok)
+      AC_MSG_RESULT(no)
     ],
     [
       AC_MSG_RESULT([yes. disabling gethostname()])
index 0b86de7bb9c047b824b1f7cb275889a9da6176e2..d4d836f43df10e4ba90baaa025d227f4e0e9b2e9 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 1.185 .
+# From configure.in Revision: 1.186 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.59.
 #
@@ -8126,6 +8126,7 @@ fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
+
 for ac_func in gethostname
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
@@ -8228,6 +8229,83 @@ fi
 done
 
 
+  echo "$as_me:$LINENO: checking for bad gethostname/FPU interaction" >&5
+echo $ECHO_N "checking for bad gethostname/FPU interaction... $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"
+  if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <unistd.h>
+#include <limits>
+#include <iostream>
+
+int main()
+{
+   char buf[100];
+   gethostname(buf,99);
+
+   volatile long double x=1.0;
+   x += std::numeric_limits<long double>::epsilon();
+
+   if (x == 1.0)
+     return 1;  // this shouldn't happen...
+   else
+     return 0;
+}
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (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: no" >&5
+echo "${ECHO_T}no" >&6
+
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+
+      echo "$as_me:$LINENO: result: yes. disabling gethostname()" >&5
+echo "${ECHO_T}yes. disabling gethostname()" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define DEAL_II_BROKEN_GETHOSTNAME 1
+_ACEOF
+
+
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
 
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.