Ubuntu Installation

    Everything including caffe itself is packaged in 17.04 and higher versions.To install pre-compiled Caffe package, just do it by

    for CPU-only version, or

    for CUDA version. Note, the cuda version may break if your NVIDIA driverand CUDA toolkit are not installed by APT.

    Package status of CPU-only version

    Installing Caffe from source

    It requires a deb-src line in your sources.list.Continue with compilation.

    For Ubuntu (< 17.04)

    General dependencies

    1. sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
    2. sudo apt-get install --no-install-recommends libboost-all-dev

    CUDA: Install by apt-get or the NVIDIA .run package.The NVIDIA package tends to follow more recent library and driver versions, but the installation is more manual.If installing from packages, install the library and latest driver separately; the driver bundled with the library is usually out-of-date.This can be skipped for CPU-only installation.

    BLAS: install ATLAS by sudo apt-get install libatlas-base-dev or install OpenBLAS by sudo apt-get install libopenblas-dev or MKL for better CPU performance.

    Python (optional): if you use the default Python you will need to the python-dev package to have the Python headers for building the pycaffe interface.

    Compatibility notes, 16.04

    Remaining dependencies, 14.04

    Everything is packaged in 14.04.

    Remaining dependencies, 12.04

    These dependencies need manual installation in 12.04.

    1. # glog
    2. tar zxvf v0.3.3.tar.gz
    3. cd glog-0.3.3
    4. ./configure
    5. make && make install
    6. # gflags
    7. cd gflags-master
    8. mkdir build && cd build
    9. export CXXFLAGS="-fPIC" && cmake .. && make VERBOSE=1
    10. make && make install
    11. # lmdb
    12. git clone https://github.com/LMDB/lmdb

    Note that glog does not compile with the most recent gflags version (2.1), so before that is resolved you will need to build with glog first.

    Continue with compilation.