ubuntu下使用caffe作为自己的库的注意事项
caffe 找不到头文件的问题实例:
/usr/local/include/caffe/blob.hpp:9:34: fatal error: caffe/proto/caffe.pb.h: No such file or directory
#include "caffe/proto/caffe.pb.h"
caffe找不到库文件的问题实例(关键字 has no member):
error: ‘class caffe::MemoryDataLayer<float>’ has no member named ‘AddMatVector’
很关键的一点,可以在官方步骤中的make all完之后,需要cd build,然后cmake .. ,然后 make install,或者直接用cmake-make-make install三部曲进行安装
make install 之后才能将caffe里的库文件全都放到ubuntu系统内,然后才可以用 find_package找到
cmake_minimum_required(VERSION 2.8.8)
find_package(Caffe)
include_directories(${Caffe_INCLUDE_DIRS})
add_definitions(${Caffe_DEFINITIONS})
# ex. -DCPU_ONLY
add_executable(caffeinated_application main.cpp)
target_link_libraries(caffeinated_application ${Caffe_LIBRARIES})