[petsc-dev] libm autodetection broken with -ffast-math
Barry Smith
bsmith at mcs.anl.gov
Wed Apr 2 19:02:21 CDT 2014
Why not just always assume -lm is needed and only remove -lm if it doesn’t exist?
Barry
On Apr 2, 2014, at 12:24 PM, Jed Brown <jed at jedbrown.org> wrote:
> "gcc -O3 -ffast-math" and "clang -O3 -fast-math" remove the calls in our
> math checks, resulting in configure thinking that -lm is not required.
> To fix the test, we have to ensure that the functions get called with
> values not known at compile time, which will make the configure code
> more complicated/less generic. This may become an issue in other places
> if compilers learn more about side-effect-free functions appearing in
> libraries.
>
> In the mean-time, you can configure with LIBS=-lm.
More information about the petsc-dev
mailing list