我需要帮助在 Ubuntu 14.04 上构建 Caffe(深度学习)。运行命令后,sudo make all -j4
我收到如下报告:
In file included from /usr/local/include/google/protobuf/arena.h:48:0,
from .build_release/src/caffe/proto/caffe.pb.h:23,
from ./include/caffe/util/signal_handler.h:4,
from src/caffe/util/signal_handler.cpp:7:
/usr/include/c++/4.8/typeinfo:39:37: error: expected ‘}’ before end of line
#pragma GCC visibility push(default)
^
/usr/include/c++/4.8/typeinfo:39:37: error: expected unqualified-id before end of line
/usr/include/c++/4.8/typeinfo:39:37: error: expected ‘}’ before end of line
/usr/include/c++/4.8/typeinfo:39:37: error: expected ‘}’ before end of line
/usr/include/c++/4.8/typeinfo:39:37: error: expected ‘}’ before end of line
/usr/include/c++/4.8/typeinfo:39:37: error: expected declaration before end of line
make: *** [.build_release/src/caffe/util/signal_handler.o] Error 1
此错误是什么意思?以下是我用来构建的说明Caffe:因为我是 Linux 操作系统的新手,所以我很乐意听取任何能解决我的错误的建议:)
答案1
您看到关于c++11
或 的任何消息了gnu++11
吗?
看起来这里有一个类似的问题:https://github.com/BVLC/caffe/issues/6359
解决方案是
更新 protobuf 并将以下内容添加到 MAKEFILE:
CXXFLAGs += -std=c++11
不确定 MAKEFILE 中是否需要这些标志(如果上述方法不起作用,请尝试它们):
NVCCFLAGS += -std=c++11 CXXFLAGS += -std=c++11 LINKFLAGS += -std=c++11
使用与 c++ 98 兼容的旧版 protobuf (2.x)