[petsc-dev] libm autodetection broken with -ffast-math

Satish Balay balay at mcs.anl.gov
Thu Apr 3 10:31:51 CDT 2014


On Thu, 3 Apr 2014, Jed Brown wrote:

> Matthew Knepley <knepley at gmail.com> writes:
> 
> > On Wed, Apr 2, 2014 at 11:32 PM, Jed Brown <jed at jedbrown.org> wrote:
> >
> >> Barry Smith <bsmith at mcs.anl.gov> writes:
> >>
> >> >    Why not just always assume -lm is needed and only remove -lm if it
> >> doesn't exist?
> >>
> >> That would be fine with me.
> >
> >
> > How does this solve the problem? You might get an error from the linker if
> > -lm is not found (maybe not),
> > but you still cannot test that the symbols we expect to be there are
> > actually there.
> 
> True, but that is C89 so it's where they are suppose to be.  It's
> amazing how much easier our configure would be if vendors consistently
> implemented the 25-year-old standards.  I think libm is relatively
> conforming as these things go.

There are compilers that automatically link with internal libm
equivalent - so absense of '-lm' is a valid usage. And then there are
compielers that have -lsunpro or -lsci for such things..

And there are compilers that use '/usr/lib/libm.a' and not -lm :(

Satish



More information about the petsc-dev mailing list