$ git clone https://github.com/Itseez/opencv.git
$ mkdir build
$ cd build
$ cmake -DCMAKE_INSTALL_PREFIX=$HOME/.usr/local/ ..
$ make
$ make install
$ git clone https://github.com/google/leveldb.git
$ make
$ mv out-shared/libleveldb.* $HOME/.usr/local/lib/
$ mv out-static/libleveldb.* $HOME/.usr/local/lib/
$ git clone https://github.com/schuhschuh/gflags.git
$ cd gflags
$ mkdir build
$cd build
$cmake -DCMAKE_INSTALL_PREFIX=$HOME/.usr/local/ ..
* Change CMAKE_CXX_FLAGS in CMakeCache.txt
$ vim CMakeCache.txt
...
CMAKE_CXX_FLAGS:STRING=-fPIC
BUILD_SHARED_LIBS:BOOL = ON
BUILD_STATIC_LIBS:BOOL = ON
...
$ make
$ make install
$ git clone https://github.com/google/glog.git
$ cd glog
$ mkdir build
$ cd build
* build make
$ cmake -DCMAKE_INSTALL_PREFIX=$HOME//.usr/local/ -DBUILD_SHARED_LIBS=ON ..
$ make
$ make install
$ wget https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
$ tar -xzvf protobuf-2.5.0.tar.gz
$ cd protobuf-2.5.0
$ bash autogen.sh
$ ./configure --prefix=$HOME/.usr/local/
$ make
$ make install
Now install the Caffee
$git clone https://github.com/BVLC/caffe.git
$cd caffe
$cp Makefile.config.example Makefile.config
#In Makefile.config, uncomment and modify these lines $ vim Makefile.config
...
OPENCV_VERSION := 3
CUDA_DIR := /opt/apps/cuda/8.0.44
#-gencode arch=compute_20,code=sm_20 \
#-gencode arch=compute_20,code=sm_21 \
BLAS := open
BLAS_INCLUDE := /opt/apps/OpenBLAS/0.2.19_gcc-5.4.0/include
BLAS_LIB := /opt/apps/OpenBLAS/0.2.19_gcc-5.4.0/lib
MATLAB_DIR := /opt/apps/matlab/R2016b
PYTHON_INCLUDE := /usr/include/python2.7 \ /opt/apps/python/2.7.13_parallel_studio-2017.1/lib/python2.7/site-packages/numpy-1.11.2-py2.7 -linux-x86_64.egg/numpy/core/include
PYTHON_LIB := /usr/lib
INCLUDE_DIRS := $(PYTHON_INCLUDE) $HOME/.usr/local/include
LIBRARY_DIRS := $(PYTHON_LIB) $HOME/.usr/local/lib /opt/apps/boost/1.63.0/lib/ /opt/apps/hdf5/1.8.18/lib/ /usr/lib64
...
$ make all
$ make test
$ make runtest
$ make distribute
$ make pycaffe