[Coin-discuss] Building Coin on multiple platforms

Ted Ralphs tkralphs at lehigh.edu
Fri Nov 10 10:50:04 EST 2006


Actually, the configure script is set up to do exactly what you are
trying to do using what is called a "VPATH build." Instead of
configuring directly in the Cbc root directory, you can just create a
separate directory for each architecture and call configure from there.
These directories can be anywhere, but I would put them right under the
Cbc root. So you would do

cd COIN-Cbc
mkdir build-linux
cd build-linux
../configure + options
make
make install
cd ..
mkdir build-sunos
cd build-sunos
../configure + options
make
make install
etc...

When you do this, the original files are never touched. All dynamically
created files are placed in the architecture-specific directories. You
also won't have to reconfigure if you do an update. Just go into each
architecture-specific directory and type "make." With the way you're
currently doing it, I'm not surprised you're having problems. If you
want to configure in the root directory and then switch architectures, I
think the only safe way to do it is to "make distclean" in between. This
restores the original state of the distribution.

Cheers,

Ted

Kish Shen wrote:
> Hi,
> 
> I am building Cbc (from the trunk branch, checked out 2 days ago) for multiple platforms
> on the same shared file space. I have done this successfully in Aug (with the devel branch),
> but am now running into a problem.
> 
> I am building for the following:
> 
> * Linux, running on x86 
> * SunOS5, running on Sparc
> * Windows, running on x86, by cross compiling on Linux with mingw
> 
> Up to now, I have been using --exec-prefix option in configure to put the platform dependent
> stuff into different directories, as follows:
> 
>   ./configure --exec-prefix=$HOME/<COIN>/$ARCH  --enable-static --without-asldir
> 
> (for the cross-compile, I also need to specify --build and --host options, plus setting CONFIG_SITE
> environment variable)
> 
> The problem I ran into:
> 
> 1) I first build the Linux version of Cbc, and after this I was able to compile my own code 
> successfully using Coin/Cbc.
> 
> 2) I then build the Windows version of Cbc (on a different process).  When I now try to
> compile the same code as in 1), I get an error:
> 
> g++ -DCOIN -DCOIN_USE_CLP -I. -I../include/i386_linux -I../sepia/include -I- -I/vol/Eclipse/thirdparty/gmp4.1/include -I/vol/Eclipse/thirdparty/tcltk8.4/include -I/usr/X11R6/include  -O2 -I/homes/kish/Coin-Cbc20061108/include -c coinplex.cpp
> In file included from /homes/kish/Coin-Cbc20061108/include/CoinMessageHandler.hpp:15,
>                  from /homes/kish/Coin-Cbc20061108/include/OsiSolverInterface.hpp:9,
>                  from coinplex.cpp:40:
> /homes/kish/Coin-Cbc20061108/include/CoinFinite.hpp: In function `bool 
>    CoinIsnan(double)':
> /homes/kish/Coin-Cbc20061108/include/CoinFinite.hpp:90: error: `_isnan' 
>    undeclared (first use this function)
> /homes/kish/Coin-Cbc20061108/include/CoinFinite.hpp:90: error: (Each undeclared 
>    identifier is reported only once for each function it appears in.)
> make: *** [i386_linux/seosiclpcbc.so] Error 1
> 
> I ran the same command to compile the code, on the same process, in the two cases.
> The Linux and the Windows builds are ran on other processes.
> 
> It seems that the Windows build have made changes to the include directory, which is in
> <COIN>/include, and is shared by all the platforms. 
> 
> I am now working around this by adding the --includedir option in configure so that the
> include files are also placed in platform specific directories. This seems to work. However,
> I didn't expect the include files to be platform dependent, and as there are 144 files in the
> include directories, I am not sure how I can make a comparison between the different 
> include directories to see what the differences are.
> 
> Does any one know if I am doing something wrong to cause this problem, or if the include
> files are expected to be platform specific? 
> 
> Thanks in advance for any information,
> 
> Kish Shen
> _______________________________________________
> Coin-discuss mailing list
> Coin-discuss at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/coin-discuss


-- 
Dr. Ted Ralphs
Associate Professor
Industrial and Systems Engineering
Lehigh University
(610)758-4784
tkralphs at lehigh.edu
www.lehigh.edu/~tkr2



More information about the Coin-discuss mailing list