[CoinUtils] Patch for compiling CoinUtils on Mac OS X

Andrew (Yahoo) andrew_coles at yahoo.co.uk
Thu Nov 10 09:59:24 EST 2011


On Mac OS X, the 'finite' function is only available with a precise combination of compiler flags, as it's deprecated.  Annoyingly, this causes a bug, because it's available with the compiler flags used when running configure; but not available with the compiler flags when using the header files more widely. 


As the preferred (and as far as I understand it, standards-compliant) option is to use isfinite, BuildTools/coin.m4 can be patched to check for isfinite before finite.  This is harmless at configure time and AFAIK on other platforms, and ensures the correct function is available on Macs from thereon.

 The patch is as follows: 


--- coin.m4     2011-09-03 21:07:59.000000000 +0100
+++ coin.m4.patched     2011-11-10 14:14:54.000000000 +0000
@@ -2294,7 +2294,7 @@ AC_COIN_CHECK_CXX_CHEADER(ieeefp) COIN_C_FINITE=
-AC_CHECK_DECL([finite],[COIN_C_FINITE=finite],,[
+AC_CHECK_DECL([isfinite],[COIN_C_FINITE=isfinite],,[ #ifdef HAVE_CMATH # include <cmath> #else
@@ -2317,7 +2317,7 @@ # endif #endif]) if test -z "$COIN_C_FINITE"; then
-  AC_CHECK_DECL([_finite],[COIN_C_FINITE=_finite],,[
+  AC_CHECK_DECL([finite],[COIN_C_FINITE=finite],,[ #ifdef HAVE_CMATH # include <cmath> #else
@@ -2340,7 +2340,7 @@ # endif #endif]) if test -z "$COIN_C_FINITE"; then
-    AC_CHECK_DECL([isfinite],[COIN_C_FINITE=isfinite],,[
+    AC_CHECK_DECL([_finite],[COIN_C_FINITE=_finite],,[ #ifdef HAVE_CMATH # include <cmath> #else


Best wishes,

Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/coinutils/attachments/20111110/5108ff84/attachment.html>


More information about the CoinUtils mailing list