Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to build Caffe2 from source

📅 2017-May-30 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

I followed these steps to build and use Caffe2 from source:

$ sudo apt install build-essential cmake git libgoogle-glog-dev libprotobuf-dev protobuf-compiler python-dev python-pip libgflags2 libgtest-dev libiomp-dev libleveldb-dev liblmdb-dev libopencv-dev libopenmpi-dev libsnappy-dev openmpi-bin openmpi-doc python-pydot
$ sudo pip install numpy protobuf flask graphviz hypothesis jupyter matplotlib pydot python-nvd3 pyyaml requests scikit-image scipy setuptools tornado
$ git clone git@github.com:caffe2/caffe2.git
$ git tag
$ git co -b v_0_7_0 v0.7.0
$ mkdir build
$ cd build
$ cmake ..
$ make
$ cmake -DCMAKE_INSTALL_PREFIX:PATH=/home/joe/caffe2_deploy ..
$ make install
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/joe/caffe2_deploy/lib
$ export PYTHONPATH=$PYTHONPATH:/home/joe/caffe2_deploy
$ python -m caffe2.python.operator_test.relu_op_test

Tried with: Ubuntu 14.04