Bayesian-Optimization / doxygen / install.dox

/*! \page install Installing BayesOpt

BayesOpt uses standard C/C++ code (C++98) and it can be compiled in
different platforms and used from different languages.

\section unixinst Installing in Linux/MacOS:

The compilation is very similar in any *nix system. Note that the
Python or Matlab interfaces are not included by default.

\subsection getDepend Getting dependencies:

The easiest way to compile this library is using the cross platform
and cross compiler tool <a href="">CMake</a>.

This code uses Boost libraries for matrix operations (uBlas), random
number generation, math functions and smart pointers. Being only
include files, Boost does not require any speciall install. Boost can
be found in many Linux and MacOS repositories. It can also be
downloaded from

Both Python development files (Python.h) and Numpy are needed if you
want the Python interface. The library has been tested with Python 2.6
and 2.7. The interface relies on Numpy arrays.

Finally, if you want the Matlab interface, just make sure your C++
compiler is compatible with your Matlab version.

\subsubsection cinlinux Linux:
For Ubuntu/Debian, the minimum dependencies (C/C++) can be optained by running:
>> sudo apt-get install libboost-dev cmake cmake-curses-gui g++

If you want the Python interface:
>> sudo apt-get install python-dev python-numpy

If you want the Octave interface:
>> sudo apt-get install octave-headers

And for all dependencies:
>> sudo apt-get install libboost-dev python-dev python-numpy cmake cmake-curses-gui g++ cython octave-headers

\subsubsection cinmac MacOS:
This section assumes \b macports is installed. Similar packages can be
found in \b fink or \b homebrew. For the minimal install, run:
>> sudo port install boost gcc46 cmake

If you want the Python interface:
>> sudo port install python27 py27-numpy

If you want the Octave interface:
>> sudo port install octave

Again, for all dependencies:
>> sudo port install boost python27 py27-numpy gcc46 cmake py27-cython octave

\subsection compile Compile the library:
In order to compile the source code in a *nix system, run this from a terminal.
>> cmake . 
>> make
>> sudo make install

\b Important: If you use \b ccmake instead of \b cmake you will access a graphical
interface to select features such as the include the Python and Matlab
interfaces, debug/release mode or if you want to use shared libraries
or not. \b Shared libraries are required to run the Python interface.

\subsubsection docbuild Building the documentation

If you have doxygen installed on your computer, you can compile the
documentation right after compiling the code by running.
>> make doc
Thid documentation will appear in the "doc" subdirectory.

\subsection instpython Python interface:

Both Python development files (Python.h) and Numpy are needed if you
want the python interface. The library has been tested with Python 2.6
and 2.7. The interface relies on Numpy arrays. If we want to select
the option to compile the Python interface we can just run:
>> ccmake . 
>> make
>> sudo make install

\b Important: Python requires bayesopt to be a \b shared library.


\section cinwin Windows and other systems:
Install this components:
\li CMake:

CMake for Windows provides a nice GUI where you can select your
favorite C++ compiler (MinGW, Visual Studio, etc.). It will
automatically create the necesary configuration files for the compiler
(makefile, solution, etc.).

\li Boost:

Since Boost they are pure template libraries, they do not require
compilation. Just make sure the headers are on the include path. You
can also add an entry named BOOST_ROOT in CMake with the corresponding
path to the library.

\li MinGW:

If you do not have a C++ compiler, we recomend MinGW+MSYS. Then, you
just need to compile from the command line with:
>> mingw32-make

Python for \b Windows has not been tested because getting the
dependencies might be involved. You might need to download and
\li Python:
\li Numpy: 

Also, read this article:


\section instmatlab Install MATLAB/Octave interface

Make sure the library is compiled with the MATLAB_COMPATIBLE option
(using ccmake or CMake in Windows) and configure Matlab/Octave to
compile mex files.

Run the corresponding script compile_matlab.m or compile_octave.m,
which can be found in the \em /matlab/ directory. Modify the path of
the libraries if it is not correct.

If bayesopt or nlopt are compiled as \b shared libraries, then, at run
time, MATLAB/Octave also needs to access to the libraries. For
example, in Linux and Mac OS LD_LIBRARY_PATH must include the folder
where the libraries are. If the install path is the default, you can
execute the script is executed before calling


\section instcython Modifying the Python interface:

Read this part <B>only if you need to modify</B> the Python interface. For this task, you need to install Cython:

In \b Ubuntu/Debian, you can get it by running:
>> sudo apt-get install cython

In \b MacOS you can install macports and run:
>> sudo port install py27-cython

Or we can download it from the website: 

If you want to modify the interface, you need to modify the
pyx file and run the Cython compiler.

$ cython --cplus bayesopt.pyx

and recompile the library.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.