Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] -frounding-math compiler option

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] -frounding-math compiler option


Chronological Thread 
  • From: "Laurent Rineau (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] -frounding-math compiler option
  • Date: Thu, 18 Feb 2010 12:32:42 +0100
  • Organization: GeometryFactory

On Wednesday 17 February 2010 16:29:12 Jens Seidel wrote:
> On Wed, Feb 17, 2010 at 12:14:11PM +0100, Edoardo Milotti wrote:
> > I am using the Intel compiler on Mac OS X and cgal 3.5.0 compiled with
> > g++ 4.4 and the macports makefile. Since icc does not have the
> > -frounding-math option, the linked program returns an error (the internal
> > rounding-math test fails). I found out that the internal test can be
> > disabled simply changing lines 76-77 in the Interval_nt.h header file to
> >
> > #if !defined(CGAL_DISABLE_ROUNDING_MATH_CHECK) &&
> > defined(__INTEL_COMPILER)
> >
> > In the original file the internal test is disabled only on linux systems,
> > while in this way it is always disabled for the Intel compiler. With this
> > fix my program runs, however I wonder whether this is correct, and if it
> > is, shouldn't it be included in future versions of CGAL?
>
> I have to define CGAL_DISABLE_ROUNDING_MATH_CHECK also on a Linux box using
> -frounding-math, namely if I want to start the program via valgrind. It is
> not sufficient to define -frounding-math in all cases :-((

valgrind does not emulate the FPU correctly. :-(

For Intel, i recommend that you use the following flags:
-D_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC=1 -fp-model strict -diag-disable 980

"-fp-model strict" is the equivalent of -frounding-math

I am surprised that the CMake scripts of CGAL have not set that -fp-model
flag. It is correctly handled by CGAL-3.5.1, and I am pretty sure that it was
also by CGAL-3.5.0. Do you use CMake?

--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory http://www.geometryfactory.com/
Release Manager of the CGAL Project http://www.cgal.org/



Archive powered by MHonArc 2.6.16.

Top of Page