Skip to content

Instantly share code, notes, and snippets.

@trungnt13
Last active February 12, 2020 14:06
Show Gist options
  • Save trungnt13/0b3143173d2632f56467 to your computer and use it in GitHub Desktop.
Save trungnt13/0b3143173d2632f56467 to your computer and use it in GitHub Desktop.
Install Caffe [Mac OS X 10.10.x]
# Install cuda 7
1. Download and install cuda 7 from here: https://developer.nvidia.com/cuda-downloads
2. add this to .bashrc or .bash_profile (I prefer the first one):
These 2 option will not work:
* export PATH=/Developer/NVIDIA/CUDA-7.0/bin:$PATH
* export DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-7.0/lib:$DYLD_LIBRARY_PATH
Replace by these:
export PATH=/usr/local/cuda/bin:$PATH
export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:$DYLD_LIBRARY_PATH
# Install cudnn v2
1. Donwload cudnn v2 from here: https://developer.nvidia.com/cudnn
2. cd /path/to/downloaded/cudnn/folder
3. sudo cp cudnn.h /usr/local/cuda/include
4. sudo cp libcudnn* /usr/local/cuda/lib
# Using: sudo port install (for following dependencies:)
google-glog, gflags, protobuf-cpp, leveldb, snappy, lmdb,
hdf5, opencv, szip, python27, py27-cython, py27-numpy,
py27-scipy, py27-scikit-image, py27-scikit-learn, py27-matplotlib,
py27-ipython, py27-h5py, py27-networkx, py27-nose, py27-pandas,
py27-protobuf, py27-gflags, py27-leveldb, py27-dateutil
# Install boost 1.57 library
1. Download boost folder included Portfiles from here: https://trac.macports.org/browser/trunk/dports/devel/boost?rev=135000&order=name
2. cd /path/to/downloaded/boost/folder
3. sudo port install +universal
4. cd /opt/local/lib
5. sudo ln -s libboost_system-mt.a libboost_system.a
6. sudo ln -s libboost_system-mt.dylib libboost_system.dylib
7. sudo ln -s libboost_python-mt.a libboost_python.a
8. sudo ln -s libboost_python-mt.dylib libboost_python.dylib
# Install OpenBLAS
1. sudo port install OpenBLAS +lapack
2. cd /opt/local/include/
3. sudo ln -s cblas_openblas.h cblas.h
# Make caffe
### In Makefile.config:
# INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /opt/local/include
# LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /opt/local/lib
### In Makefile:
# if macports installed opencv 3
# add: opencv_imgcodecs to Makefile at the end following lines:
# LIBRARIES += glog gflags protobuf leveldb snappy \
# lmdb boost_system hdf5_hl hdf5 m \
# opencv_core opencv_highgui opencv_imgproc
1. cd /path/to/caffe
2. make all -j4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment