1、安装brew
/usr/bin/ruby -e "$(curl -fsSLhttps://raw.githubusercontent.com/Homebrew/install/master/install)"
2、安装各种依赖
brew install -vd snappy leveldb gflags glog szip lmdb
brew tap homebrew/science
brew install hdf5 opencv
# 需要 pycaffe 输入
brew install --build-from-source --with-python -vd protobuf