Caffe編譯報錯
阿新 • • 發佈:2018-11-06
Caffe編譯報錯
博主在修改了電腦環境後重新編譯之前專案的Caffe,出現了幾個小錯誤,在此記錄下來。注意,在每次修改後都需要執行 make clean'
再重新make。更新於2018.10.22。
1
make: *** No rule to make target '/usr/include/google/protobuf/stubs/common.h', needed by '.build_release/cuda/src/caffe/solvers/adam_solver.o'。 停止。
由於protobuf的預設安裝目錄是/usr/local/,而caffe的搜尋目錄是/usr/,因此需要重新安裝protobuf,將./configure改成./configure --prefix=/usr即可。
解除安裝
which protoc
rm /usr/local/bin/protoc
安裝
下載https://github.com/google/protobuf/releases ##Source code (zip)##
./autogen.sh
./configure --prefix=/usr
make
make check
sudo make install
2
caffe/proto/caffe.pb.h: 沒有那個檔案或目錄
可能是make太快的緣故,將make -j 8改成make -j 5。
3
#error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
修改Makefile中的COMMON_FLAGS選項,在最後加上-std=c++11或-std=gnu++11。