
                Caffe Package Manual for Debian

                            Zhou Mo
                      cdluminate@gmail.com

                   Last update: May. 18 2016

Package Scheme
==============

Caffe supports 2 modes: CPU_ONLY mode and CUDA mode, and actually the
caffe configureed in CUDA mode can run in CPU_ONLY mode. So providing
two sets of Caffe packages, with the CPU_ONLY one in main/science
section and the CUDA one in contrib/science section. Users need to
choose a set of packages to install.

 * source package "caffe" compiles the CPU_ONLY set.
 * source package "caffe-contrib" compiles the CUDA set.

Both of the sources are hosted on Alioth, debian-science.
Here is what binary package can be built from the sources:

 * CPU_ONLY set from source "caffe"
   - caffe-cpu          -- metapackage, pulls tools and python3 interface
   - caffe-tools-cpu    -- command line utilities
   - libcaffe-cpu*      -- core library
   - libcaffe-cpu-dev   -- development files
   - python3-caffe-cpu   -- python3 interface

 * CUDA set from source "caffe-contrib"
   - caffe-cuda         -- ...
   - caffe-tools-cuda   -- ...
   - libcaffe-cuda*     -- ...
   - libcaffe-cuda-dev  -- ...
   - python3-caffe-cuda -- ...

Just choose one that fits your need and enjoy Deep Learning,
then good luck in research or playing around!


Why do We Link Caffe Against libblas.so.3 ?
===========================================

Well this is neither accidental nor awkward. This is due to a
Debian feature called `alternatives`. (So does Ubuntu)

`libblas.so.3` is a symbol link, you can make it point to
either `atlas` or `openblas` without rebuilding Caffe.

See what's your current selection of libblas.so.3 :

  $ sudo update-alternatives --get-selections | grep libblas

If you want to switch the BLAS lib from basic BLAS library
to atlas or openblas, first install your favorate one

  $ sudo apt install libopenblas-dev
  OR $ sudo apt install libatlas-dev

then update the alternatives:

  $ sudo update-alternatives --config libblas.so.3
  $ sudo update-alternatives --config libblas.so

Finally you run Caffe again. Is it faster as you expected?
For more detail pleese see update-alternatives(8).


Notes for Package Maintainer
============================

1. Testing whether the program works, apart from the gtest test programs?

   $ caffe time -model examples/mnist/lenet.prototxt

   or with gpu

   $ caffe time -model examples/mnist/lenet.prototxt -gpu 0

   Well, testing caffe in this way (using deploy version of network)
   requires no dataset, which may be useful for some maintainers
   who are not familiar with Caffe.

   If you want to test Caffe on some real dataset e.g. MNIST, you can take
   a closer look at `examples/mnist/readme.md`.
