1. 从https://github.com/chyh1990/caffe-compact下载caffe-compact代码;
2. 通过CMake(cmake-gui)生成vs2013 x64 caffeproject。
3. 从https://github.com/google/protobuf下载ProtoBuf,解压缩,编译ProtoBuf:
(1)、打开cmake-gui,source code路径:E:/GitCode/Caffe/src/thirdparty/ProtoBuf/protobuf-master/cmake和build thebinaries路径:E:/GitCode/Caffe/src/thirdparty/ProtoBuf/vs2013。
(2)、点击Configure,选择Visual Studio 12 2013 Win64。
(3)、去掉BUILD_TESTING的勾选。将CMAKE_INSTALL_PREFIX设置为E:/GitCode/Caffe/src/thirdparty/ProtoBuf/install。再次点击Configure;
(4)、点击Generate,生成vs2013 protobuf.slnproject。
(5)、打开protobuf.slnproject,分别在x64 Debug和x64 Release下,点击ALL_BUILD,又一次生成。点击INSTALL,生成;手动拷贝生成的库和头文件放在/install/include和/install/lib文件夹下。将protoc.exe放在/install/bin文件夹下;
(6)、将/install/include文件夹增加到caffeproject中。
4. 通过ProtoBuf中的protoc.exe又一次生成caffe.pb.h和caffe.pb.cc:
(1)、打开命令提示符。将protoc.exe复制到/caffe-compact-master/src/caffe/proto文件夹下。运行:protoc.execaffe.proto --cpp_out=./ ;
(2)、将生成的caffe.pb.h文件复制到/caffe-compact-master/include/caffe/proto文件夹下;
5. 依照http://blog.csdn.net/fengbingchun/article/details/47378515将Eigen增加到caffeproject中;
6. 分别在Debug和Release下。点击ALL_BUILD,编译生成caffe-compact.lib静态库。