.. _compilation-tutorial: Download and Compilation ================================================= Download ---------------------------- To get **limbo**, simply clone the source code from https://github.com/resibots/limbo with git, or download it as a zip. Dependencies ~~~~~~~~~~~~~ Required +++++++++++++ * `Boost `_ , with the following libraries: filesystem, system, unit_test_framework (test), program_options, and thread; `Boost` is mainly used for the interaction with the system. * `Eigen 3 `_, Eigen3 is a highly-efficient, templated-based C++ library for linear algebra. Optional but highly recommended +++++++++++++++++++++++++++++++++ * `NLOpt `_ with C++ binding: :: ./configure --with-cxx --enable-shared --without-python --without-matlab --without-octave sudo make install * `libcmaes `_. Be careful that gtest (which is a dependency of libcmaes) needs to be manually compiled **even if you install it with your package manager** (e.g. apt-get). Follow the instructions `here `_, reproduced for your convenience:: sudo apt-get install libgtest-dev sudo cd /usr/src/gtest sudo mkdir build && cd build sudo cmake .. sudo make sudo cp *.a /usr/lib * `Intel TBB `_ is not mandatory, but highly recommended; TBB is used in Limbo to take advantage of multicore architectures. Optional +++++++++++++ * `Intel MKL `_ is supported as backend for Eigen. In our experience, it provided best results when compiling with Intel's Compiler (ICC) * `Sferes2 `_ if you plan to use the multi-objective bayesian optimization algorithms (experimental). Compilation ---------------------------- We use the `WAF `_ build system, which is provided with the **limbo** source code. To know why we use waf (and not CMAKE, SCONS, traditional makefiles, etc.), see the :ref:`FAQ `. Like most build systems, it has a configuration and build steps, described bellow. Configuration ~~~~~~~~~~~~~ .. caution:: Make sure that the waf file has execution rights. The first step is to configure your waf environment. For this, assuming that you are in the root directory of Limbo, you have to run the command: :: ./waf configure If everything is okay, you should expect an output like this: :: Setting top to : /path/to/limbo Setting out to : /path/to/limbo/build Checking for 'g++' (c++ compiler) : /usr/bin/g++ Checking for 'gcc' (c compiler) : /usr/bin/gcc Checking boost includes : 1_55 Checking boost libs : ok Checking Intel TBB includes : not found Checking for compiler option to support OpenMP : -fopenmp Checking Intel MKL includes : not found ['-Wall', '-std=c++11', '-O3', '-march=native', '-g'] The actual ouput may differ, depending on your configuration and installed libraries. Waf should automatically detect the libraries if they where installed in the default folders, but if it doesn't, you can use the following command-line options to indicate where they are: * ``--libcmaes=/path/to/libcmaes`` * ``--nlopt=/path/to/nlopt`` * ``--tbb=/path/to/tbb`` * ``--mkl=/path/to/mkl`` * ``--sferes=/path/to/sferes2`` * ``--boost-includes /path/to/boost-includes`` [.h] * ``--boost-libs /path/to/boost-libraries`` [.a, .so, .dynlib] * ``--eigen /path/to/eigen3`` Note that Sferes2 won't be used unless you specify it's installation folder. You can also specify a different compiler than the default, setting the environment variables ``CC`` and ``CXX``. A full example:: CC=icc CXX=icpc ./waf configure --sferes ~/sferes2 --mkl ~/intel/mkl --tbb ~/intel/tbb Build ~~~~~~~~~~~~~ The second step is to run the build command:: ./waf build Depending on your compiler, there may be some warnings, but the output should end with the following lines: :: 'build' finished successfully (time in sec) Building the documentation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. note:: This section is only useful for developers who need to update the documentation. Install sphinx via pip: :: sudo pip install Sphinx sudo pip install sphinxcontrib-bibtex .. warning:: On Mac OSX, do not use `brew install sphinx` because this is not the right sphinx Install the Resibots theme for Sphinx:: git clone https://github.com/resibots/sphinx_resibots_theme export SPHINX_RESIBOTS_THEME="/home/me/path/to/sphinx_resibots_theme" Install `breathe `_ via pip:: sudo pip install breathe Install `doxygen `_ via your package manager (e.g. apt-get / brew):: apt-get install doxygen In the `doc` directory:: make html About sphinx and ReStructuredText: - `There is a tutorial `_, - `Primer for ReStructuredText `_, the markup language of Sphinx, - `markup specific to Sphinx `_, - `About C++ in Sphinx `_ - `Breathe (bridge between sphinx and doxygen) `_