\begin{PageSummary}
\PageName{Installation}
\PageSection{Installing \Bonmin}{sec:install}
\PageSection{Configuring {\tt Cplex}}{sec:cplex_install}
\PageSection{Compiling \Bonmin\ in a external directory}{sec:vpath}
\PageSection{Building documentation}{sec:ref_man}
\PageSection{Running test program}{sec:test}
\end{PageSummary}

\begin{quickref}
\quickcitation{Generic Coin Installation on Coin BuildTools web page}{\linkCoin BuildTools}
\quickcitation{Known issues for building Coin packages}{\linkCoin BuildTools}
\quickcitation{\Bonmin\ build Wiki page.}{\linkCoin Bonmin/wiki/GettingStarted}
\quickcitation{Specific Instructions for building \Bonmin\ on Cygwin}{\linkCoin Bonmin/Wiki/CygwinInstall}
\quickcitation{Specific instructions for building \Bonmin\ on Mac OSX}{\linkCoin Bonmin/Wiki/OsXInstall}
\end{quickref}
\PageTitle{Installing \Bonmin}{sec:install}
The build process for \Bonmin\ should be fairly automatic as it uses
\href{http://sources.redhat.com/autobook/autobook/}{GNU autotools}.
  It has been successfully compiled and run on the following platforms:
\begin{itemize}
\item Linux using g++ version 4.5
\item Windows using version Cygwin 1.5.18
\item Mac OS X using gcc 4.5
\end{itemize}

For Cygwin and OS X some specific setup has to be done prior to instalation. These step are described on the wiki pages of {\tt Bonmin}  \footlink{https://projects.coin-or.org/Bonmin/wiki/CygwinInstall}{CygwinInstall} and \footlink{https://projects.coin-or.org/Bonmin/wiki/OsxInstall}{OsxInstall}.


\Bonmin\ is compiled and installed using the commands:
\begin{colorverb}
\begin{verbatim}

./configure -C
make
make install

\end{verbatim}
\end{colorverb}

This installs the executable {\tt bonmin} in {\tt Bonmin-\stableVersion/bin}. In what follows, we assume
that you have put the executable {\tt bonmin} on your path.

The {\tt configure} script attempts to find all of the machine specific settings (compiler, libraries,...)
necessary to compile and run the code. Although {\tt configure} should find most of the standard
ones, you may have to manually specify a few of the settings.
The options for the configure script can be found by issuing the command

\begin{colorverb}
\begin{verbatim}

./configure --help

\end{verbatim}
\end{colorverb}

For a more in depth description of these options,
the reader is invited to refer to the COIN-OR {\tt BuildTools} \footlink{\linkCoin BuildTools}{trac page}.

\subsectionH{Specifying the location of {\tt Cplex} libraries}{sec:cplex_install}
If you have {\tt Cplex} installed on your machine, you may want to use it
as the Mixed Integer Linear Programming subsolver in {\tt B-OA}, {\tt B-Hyb}
and {\tt B-iFP}.
To do so you have to specify the location of the header files and libraries.
You can either specify the location of the header files directory by passing it as an
argument to the configure script or by writing it into a {\tt config.site}.\\

In the former case, specify the location of the {\tt Cplex} header files by using the
argument {\tt --with-cplexincdir} and the location of the
{\tt Cplex } library with {\tt --with-cplexlib} (note that on the Linux platform you will also
need to add {\tt -lpthread} as an argument to {\tt --with-cplexlib}).\\

For example, on a Linux machine if {\tt Cplex} is installed in {\tt /usr/ilog}~, you would
invoke configure with the arguments as follows:

\begin{colorverb}
\begin{verbatim}

./configure --with-cplex-incdir=/usr/ilog/cplex/include/ilcplex \
  --with-cplex-lib="-L/usr/ilog/cplex/lib  -lcplex -lpthread"
 \end{verbatim}
 \end{colorverb}
 
In the latter case, put a file called {\tt config.site} in a subdirectory named
{\tt share} of the installation directory (if you do not specify an alternate
installation directory to the {\tt configure} script with the {\tt --prefix}
argument, the installation directory is the directory where you execute the
{\tt configure} script). To specify the location of {\tt Cplex}~, insert the
following lines in the {\tt config.site} file:

\begin{colorverb}
 \begin{verbatim}

 with_cplex_lib="-L/usr/ilog/cplex/lib -lcplex -lpthread"
 with_cplex_incdir="/usr/ilog/cplex/include/ilcplex"
 
 \end{verbatim}
\end{colorverb}

 (You will find a {\tt config.site} example in the subdirectory {\tt BuildTools} of {\tt coin-Bonmin}.)

\subsectionH{Compiling \Bonmin\ in a external directory}{sec:vpath}
It is recommended to compile \Bonmin\ in a directory different from the source directory ({\tt Bonmin-\stableVersion} in our case).
This is convenient if you want to have several executables compiled for different architectures or have several executables compiled with different options
(debugging and production, shared and static libraries) but also because
you don't modify the directory where the sources are.\\

To do this just create a new directory, for example {\tt Bonmin-build} in the parent directory of
{\tt coin-Bonmin} and run the configure command from {\tt Bonmin-build}:


\begin{colorverb}
\begin{verbatim}

../Bonmin-\stableVersion/configure -C

\end{verbatim}
\end{colorverb}

This will create the makefiles in {\tt Bonmin-build}, and
you can then compile with the usual {\tt make} and {\tt make install}
(in {\tt Bonmin-build}).

\subsectionH{Building the documentation}{sec:ref_man}
The documentation for \Bonmin\ consists of a users' manual (this document) and a reference manual.
You can build a local copy of the reference manual provided that you have Latex
and Doxygen installed on your machine. Issue the command {\tt make
doxydoc} in {\tt coin-Bonmin}. It calls Doxygen to build a copy of the
reference manual. An html version of the reference manual can then
be accessed in {\tt doc/html/index.html}.

%You can also build a pdf
%version of the reference manual by issuing the command {\tt make
%refman.pdf} ({\tt refman.pdf} is placed in the {\tt doc} subdirectory).

\subsectionH{Running the test programs}{sec:test}
By issuing the command {\tt make test}~, you build and run the automatic test program for \Bonmin.
