[Coin-discuss] COIN on a Mac

ScottWelz at aol.com ScottWelz at aol.com
Wed Jan 1 19:34:59 EST 2003


I have made the changes necessary to get some of the COIN libraries running 
on the Mac OS X Unix kernel (Darwin).   Darwin is based on BSD unix (netBSD 
4.4) and also includes some elements from FreeBSD and GNU (gcc in 
particular).   I have successfully compiled and run:   VOL, CLP, OSI, CGL, 
and BCP.   The unitTest for CLP completes successfully and MaxCut is 
successful on the junger1 test problem.

I realize that there probably won’t be many who use this platform, but since 
its what I’ve got, I’m hoping you’ll make the changes necessary to support 
it.

Here are the code changes:

1.)   ./COIN/Coin/include/CoinFinite.hpp

Add the following code before the last #endif in the file:

#if defined(__GNUC__) && defined(__MACH__)
extern "C" {
    int isnan(double);
}
inline int CoinFinite(double d);
# define CoinFinite finite
# define CoinIsnan   isnan
#endif

2.) ./COIN/Bcp/include/BCP_os.hpp

Add the following code before the last #endif in the file:

#if defined(__MACH__) && defined(__GNUC__) 
#   include "BCP_MACH.hpp"
#endif

3.) Add a couple of OS specific files

Need to add the file Makefile.Darwin to the COIN/Makefiles directory and the 
file BCP_MACH to the COIN/Bcp/include directory.   I have not included these 
files here in the interest of space.   What is the best way to get these 
files into the library?

Darwin does not support shared libraries, so all the libraries must be 
created as STATIC, not SHARED (just something the user needs to be aware of 
when trying to make the libraries).

Also, I needed to make a change in the OsiClpSolverInterface.cpp file.   When 
making the library, the system was not finding the #include <time.h> file.   
I needed to change this line to #include <sys/time.h> to get the time 
functions needed.   Not sure if this is an idiosyncrasy of Darwin or a bug in 
the code.   If it's not a bug, I’ll need to add a conditional to handle the 
#include for Darwin while leaving it the same for everyone else.

Are there any issues with adding these changes to the library?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/coin-discuss/attachments/20030101/b3c2822b/attachment.html>


More information about the Coin-discuss mailing list