next up previous
Next: Source Code Up: Uncapacitated Facility Location - Previous: Uncapacitated Facility Location -

Build Process

The first step is to obtain the COIN source code, as described here, and the example source code here.

Disclaimer: The following build process has only been tested on the following configurations. Also, there seems to be an incompatibility using OSL with the new version of glibc (distributed with Redhat 9.0).

If you are having trouble getting things set up on your system, a good source for getting help is the mailing lists.

Windows

Support (and demand) for COIN on Windows is somewhat limited. In order to build the libraries in Windows check the COIN/Win directory. The file startMsDevStudio.bat should help build the COIN libraries. Read the Linux/Unix section below for a list of dependencies. For the UFL example, use the uflosi_win/uslosi_win.dsp project workspace and adjust the include/library paths as appropriate for your machine.

Linux/Unix

Let us look at the example uflOSI/Makefile. One important feature of the Open Solver Interface (OSI) is the ability to easily switch between solvers - in our case, Linear Programming (LP) solvers. Here, we illustrate the example using both CLP (COIN LP - an open source simplex solver, which is part of the COIN repository) and OSL (Optimization Solutions and Library) which can be downloaded here.

In the first section, we simply need to tell where the COIN directories reside.

COIN_ROOT=$(HOME)/COIN
COIN_INC_DIR=$(COIN_ROOT)/include
COIN_LIB_DIR=$(COIN_ROOT)/lib

Next, we will set the solver to either CLP or OSL.

SOLVER=OSL

We then set the appropriate path to the solver's include and lib directories. In the provided Makefile, when using CLP, I simply point to the COIN include/library directories, which are the default when compiling CLP. When using OSL, I point to OSL's include/library directories, which I store in the environment variables OSL_XXX_DIR.

SOLVER_INC_DIR=$(OSL_INC_DIR)
SOLVER_LIB_DIR=$(OSL_LIB_DIR)

Now, if you are using CLP, you will need to first build the following set of COIN libraries: Osi, OsiClp, Coin, Clp, Sbb, Cgl. If you are using OSL, you will need to build: Osi, OsiOsl, Coin, Cgl. In most situations (including mine), the only configuration needed, is to the file COIN/Makefiles/Makefile.location. In this file, you uncomment any libraries that you want to compile. In this case, you would want to uncomment at least: libCoin, libOsi, libCgl, libClp, libOsl. In addition, you need to set the location of the solver include and lib directories similar to above. In many cases, the defaults work fine.

Given this, you then need to build each of the libraries. You can compile each separately. But, notice, the following dependencies:

Therefore, to build everything you can just build Sbb and OsiOsl.

Additional information on the build process for each module can be found in the corresponding INSTALL and/or README files.

Then, if all the libraries are properly built, simply type make to build the example code. You should end up with an executable called ufl.


next up previous
Next: Source Code Up: Uncapacitated Facility Location - Previous: Uncapacitated Facility Location -
IP Seminar Series 2004-01-11