From: Wolfgang Bangerth Date: Wed, 2 Mar 2005 16:05:34 +0000 (+0000) Subject: Check for gethostname interactions. X-Git-Tag: v8.0.0~14561 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3f4aeb000ff5743493cbaae656353eb339f404d;p=dealii.git Check for gethostname interactions. git-svn-id: https://svn.dealii.org/trunk@9949 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index f7a42447c2..feee24282a 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -3956,6 +3956,55 @@ using namespace std; +dnl ------------------------------------------------------------- +dnl Check whether the gethostname() function is available. To +dnl spice up things, some versions of cygwin have a problem in +dnl that when you call that function on an AMD system, the FPU +dnl is set into 64bit mode, rather than 80bit mode, and doesn't +dnl do any long double computations any more, even though the +dnl compiler still announces that it does through the std::limits +dnl class. We have to check for this. +dnl +dnl Usage: DEAL_II_CHECK_GETHOSTNAME +dnl +dnl ------------------------------------------------------------- +AC_DEFUN(DEAL_II_CHECK_GETHOSTNAME, dnl +[ + AC_CHECK_FUNCS(gethostname) + + AC_MSG_CHECKING(for bad gethostname/FPU interaction) + AC_LANG(C++) + CXXFLAGS="$CXXFLAGSG" + AC_TRY_RUN( + [ +#include +#include + +int main() +{ + char buf\[100\]; + gethostname(buf,99); + + volatile long double x=1.0; + x += std::numeric_limits::epsilon(); + + return (x != 1.0); +} + ], + [ + AC_MSG_RESULT(ok) + ], + [ + AC_MSG_RESULT([yes. disabling gethostname()]) + AC_DEFINE(DEAL_II_BROKEN_GETHOSTNAME, 1, + [Define if the use of gethostname() leads to strange + results with floating point computations on cygwin + systems.]) + ]) +]) + + + dnl ------------------------------------------------------------- dnl Check whether CXXFLAGSG and CXXFLAGSO are a valid combination dnl of flags or if there are contradicting flags in them. diff --git a/deal.II/configure.in b/deal.II/configure.in index 95ff61c81a..315bbc000a 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -206,7 +206,7 @@ DEAL_II_CHECK_ISNAN DEAL_II_CHECK_RAND_R DEAL_II_CHECK_QUAD_DEFINE DEAL_II_CHECK_ERROR_CODES_DEFINITION -AC_CHECK_FUNCS(gethostname) +DEAL_II_CHECK_GETHOSTNAME