Compiling from Source

Following, you will find the software dependencies required for Bob’s compilation and instructions on how to compile Bob.

Dependencies

This section describes software dependencies required for Bob’s compilation and runtime dependencies.

Note

We keep here a comprehensive list of all packages you may need to compile most of the available Bob packages. You may not need all this software for special deployments. You should choose whatever suits you best. If you have problems or would like to report a success story, please use our mailing list for discussions.

Library Min. Versio n License Notes
Std. C/C++ Libraries any Depends on the compiler Required by all packages with C/C++ bindings
Blitz++ 0.10 Artistic-2.0 or LGPLv3+ or GPLv3+ Required by all packages with C/C++ bindings
Lapack any BSD-style Required by bob.math
Python 2.5 Python-2.0 Required by all packages
Boost 1.34 BSL-1.0 Required by all packages with C/C++ bindings
HDF5 1.8.4 HDF5 License (BSD-like, 5 clauses) Required by all I/O operations (direct or indirect dependencies to bob.io.base)
libpng 1.2.42 ? libpng license Required by all packages that do image I/O and manipulation (depend directly or indirectly on bob.io.image)
libtiff 3.9.2 BSD-style Required by all packages that do image I/O and manipulation (depend directly or indirectly on bob.io.image)
giflib 4.1.6- 9 MIT Required by all packages that do image I/O and manipulation (depend directly or indirectly on bob.io.image)
libjpeg 6.2? GPL-2.0 or later (also commercial) Required by all packages that do image I/O and manipulation (depend directly or indirectly on bob.io.image)
FFMpeg or libAV 0.5 (ffmpe g) or 0.8 (libav ) LGPL-2.1 or later, or GPL-2.0 or later Required by all packages that do video I/O and manipulation (depend directly or indirectly on bob.io.video)
MatIO 1.3.3? BSD-2-Clause Required by all packages that do Matlab I/O and manipulation (depend directly or indirectly on bob.io.matlab)
VLFeat 0.9.14 BSD-2-Clause Required by bob.ip.base and all dependents
LIBSVM 2.89+ BSD-3-Clause Required by bob.learn.libsvm and all dependents
CMake 2.8 BSD-3-Clause Required by all packages with C/C++ bindings. Use at least CMake 2.8.12 on Mac OS X.
Dvipng 1.12? GPL-3.0 Required by all packages (documentation generation)
LaTeX any ? Required by all packages (documentation generation). You will also need to install the Extra-Latex fonts package.
pkg-config any GPL-2.0 Required to find dependencies while building bob packages.

Here is a list of Python packages software that is also used by Bob. It is not required that such software be installed at the moment you compile Bob. It will be fetched automatically from PyPI otherwise.

Library Min . Ver sio n License Notes
NumPy 1.3 BSD-3-Clause Required by all packages. If not installed natively on your machine, may not correctly use optimized LaPACK or BLAS implementations. Consequently, bob.math will not either.
SciPy 0.7 ? BSD-3-Clause Required at least by bob.ap, bob.learn.boosting, bob.ip.optflow.hornschunk and facereclib
Matplotlib 0.9 9 Based on Python-2.0 Required for plotting
SQLAlchemy 0.5 MIT Required by all database accessor packages (i.e., any that starts with bob.db)
nose 1.0 ? LGPL-2.1 For unit testing, on all packages
Sphinx 0.6 BSD-2-Clause Required by all packages (documentation generation)
Setuptools 8.0 Python-2.0 Required by all packages (Buildout and package compilation)
Pillow 1.7 .x? BSD-like Required by at least bob.io.video and bob.ip.optflow.liu
IPython any BSD-3-Clause Recommended as interactive prompt

Installing Bob from source

Once the dependecies are installed you can use pip to install Bob from source.

It is possible to install Bob packages using pip, globally or on your private virtualenv, if that is the way you like your Python work environments. You will need to manually install all packages you need (directly or indirectly), as pip/setuptools has presently no way to coherently install Python packages that depend on each other for building, such as is the case of many Bob packages.

For example, to install bob.io.image in a newly created virtual environment, here is the sequence of commands to execute:

$ pip install numpy
$ pip install bob.extension
$ pip install bob.blitz
$ pip install bob.core
$ pip install bob.io.base
$ pip install bob.io.image

Note

Each pip command must be executed separately, respecting the inter- package dependency.

The following will not work as expected:

$ #Do not do this:
$ pip install numpy bob.io.image

The dependency of Bob core packages can be summarized into 8 layers and the following script can be used to install all core Bob packages using pip:

$ bash pip_install_bob.sh
-------------------------
#!/bin/bash
set -e

get_layer() {
case $1 in
  1)
    packages=("bob.extension")
    ;;
  2)
    packages=("bob.blitz")
    ;;
  3)
    packages=("bob.core" "bob.ip.draw")
    ;;
  4)
    packages=("bob.io.base" "bob.sp" "bob.math")
    ;;
  5)
    packages=("bob.ap" "bob.measure" "bob.db.base" "bob.io.image" "bob.io.video" "bob.io.matlab" "bob.ip.base" "bob.ip.color" "bob.ip.gabor" "bob.learn.activation" "bob.learn.libsvm" "bob.learn.boosting")
    ;;
  6)
    packages=("bob.io.audio" "bob.learn.linear" "bob.learn.mlp" "bob.db.wine" "bob.db.mnist" "bob.db.atnt" "bob.ip.flandmark" "bob.ip.facedetect" "bob.ip.optflow.hornschunck" "bob.ip.optflow.liu")
    ;;
  7)
    packages=("bob.learn.em" "bob.db.iris")
    ;;
  8)
    packages=("bob")
    ;;
esac
}

for layer in `seq 1 8`;
do
  get_layer ${layer}
  for pkg in "${packages[@]}";
  do
    pip install $pkg
  done
done

Hooking-in privately compiled externals

If you have placed external libraries outside default search paths, make sure you set the environment variable BOB_PREFIX_PATH to point to the root of the installation paths for those, before you run pip install...:

$ export BOB_PREFIX_PATH="/path/to/my-install:/path/to/my-other-install"
$ pip install numpy
$ pip install bob.io.image
...

Developer’s Guide

Please refer to Bob Package Development for a complete guide on how to develop existing and new Bob packages.