[Users] Fwd: commit/SimFactory2: rhaas80: Ubuntu: disable finite-math-only

Erik Schnetter schnetter at cct.lsu.edu
Wed Dec 7 19:55:45 CST 2016


On Wed, Dec 7, 2016 at 5:36 PM, Roland Haas <rhaas at illinois.edu> wrote:

> Hello Erik,
>
> > Cactus offers functions "CCTK_isnan" etc. that always do what the name
> > suggests, so that compilers can optimize "isnan" away if they want.
> Are you sure about this? I have (in src/util/Math.c):
>
> --8<--
> int CCTK_isnan(double x)
> {
> #ifdef HAVE_ISNAN
>   return isnan(x);
> #else
>   return 0;                     /* default */
> #endif
> }
> --8<--
> and -ffinite-math-only turns isnan into a no-op that always returns
> "true".
>
> HAVE_ISNAN is set by the configure script. NaNChecker uses CCTK_isnan
> yet it failed on machines using unbuntu.cfg which uses -ffast-math
> (which includes -ffinite-math-only).
>

When I checked, only C++ compilers replaced "isnan", not C compilers, thus
redirecting C++ calls to this C function worked fine. If this doesn't work
any more then we'll have to be more clever and examine the bit pattern. (We
can do this even in a header file, we then don't need the C implementation
file any more.)

-erik

-- 
Erik Schnetter <schnetter at cct.lsu.edu>
http://www.perimeterinstitute.ca/personal/eschnetter/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.einsteintoolkit.org/pipermail/users/attachments/20161207/40730b09/attachment.html 


More information about the Users mailing list