Caffe installation on server without root access
Caffe is a deep learning framework developed at BLVC. While the installation on Linux systems are straightforward with its guides, the dependencies make it hard to compile the codes without root accesses. This guide is about how I installed it into a CentOS 6.5 server while several library shipped are obsolete. Some of the tips are from here.
Suppose we have a project folder that you can access as an user to the server. /home/you
. We create a folder /home/you/usr
to hold all the dependencies. We first setup the environment variables.
cmake
Usually it is shipped with the OS. But it may have a lower version than that some of the dependencies required. In case of that, download it from here. there is a compiled binary for Linux platform. Copy the files in the bin
folder to /home/you/usr/bin
.
CUDA
Luckily my CUDA runtime is 6.5 so I dont have to worry about that. CUDA 5 is fine, according to the official page, but remember you have to turn-off the gencode 2*
flags from the caffe Makefile.config
.
BLAS
I use ATLAS
, which is the default library for caffe. Please refer to this article for the compilation of ATLAS. If you dont have the compiled python availabe, follow the instructions as well.
Boost
It seems quite a standard C++ library, but mine is 1.47 which is lower than the required version 1.55. Fine we can compile it! Download it from here and install it into your usr
folder.
OpenCV
If you dont have one, download it here and install.
This will take very long time. Deleting some of the gencode of older architecures can improve it a little bit
protobuf
Easy https://github.com/google/protobuf
glog
Easy https://github.com/google/glog
gflags
This -fPIC
step is important otherwise it come back to you when compiling caffe
hdf5
I have that with my system, lucky. the offical site is here
leveldb
site https://github.com/google/leveldb
It does not have make install
, copy them manually
snappy
easy https://github.com/google/snappy
lmdb
site here https://gitorious.org/mdb/mdb
Finally, Caffe itself
Download the source codes
Go to the caffe
folder, cp Makefile.config.example Makefile.config
and edit it. Most of the instructions can be found on the offical installation page. Here is a few things that have to be specify
Setup the path to your ATLAS compilation
Setup path to your python installation
Add your dependencies to the makefile
Then finally
Another long wait … Hopefully you see the success