[BuildTools] Attn Mac-o-philes: Mac OSX / isnan / -pedantic-errors
problems
Lou Hafer
lou at cs.sfu.ca
Mon Feb 5 17:13:45 EST 2007
Attention Mac-o-philes :-),
Whilst trying to find out why the DyLP build was failing on Mac OSX, I
noticed that CoinUtils wasn't finding isnan. I'm borrowing a machine to test,
and the specs are
Darwin Kernel Version 8.8.0, RELEASE_PPC Power Macintosh powerpc
powerpc-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)
It would appear that DyLP fails to build because Darwin can't compile
its own math.h system header with -pedantic-errors turned on. Do any of you
regular Mac users know if this is persistent, or just a quirk of this particular
configuration?
Moving on to isnan: It would appear that Apple's cmath carefully
removes isnan from the global namespace, leaving only std::isnan. As a result,
the current tests in CoinUtils can't find an isnan equivalent. If I add the
following test:
AC_CHECK_DECL([std::isnan(2.0)],[MY_C_ISNAN=std::isnan],,[<lots of includes>])
to the existing set of checks for isnan, then configuration finds std::isnan and
all is copacetic. (The parameter for std::isnan seems to be necessary to allow
C++ overload resolution.) Do any of you regular Mac users have a more elegant
solution?
Andreas, this sort of begs the question: should we be checking for
std::finite, etc.?
Thanks,
Lou
More information about the BuildTools
mailing list