Skip to content

Instantly share code, notes, and snippets.

@Deadlyelder
Last active March 25, 2018 12:23
Show Gist options
  • Save Deadlyelder/7d6ea5ece0e53d5ca3dfd8c509c6367e to your computer and use it in GitHub Desktop.
Save Deadlyelder/7d6ea5ece0e53d5ca3dfd8c509c6367e to your computer and use it in GitHub Desktop.
For HPC

OpenCV

$ git clone https://github.com/Itseez/opencv.git
$ mkdir build
$ cd build
$ cmake -DCMAKE_INSTALL_PREFIX=$HOME/.usr/local/ .. 
$ make
$ make install

Leveldb

$ 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/

GFlag

$ 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

Glog

$ 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

Protobuf

$ 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment