OSX Caffe编译因预期的表达错误而失败

Spa*_*oup 4 python macos machine-learning caffe

我一直在尝试在运行OSX 10.13.6的Mac上安装Caffe

我遵循了一些指南,包括caffe网站上的安装指南。我已经擦除了所有内容并重新启动了几次。无论如何,我都会遇到同样的问题。当我去编译所有东西时,我得到了这个

Scanning dependencies of target caffeproto [ 1%] Building CXX object src/caffe/CMakeFiles/caffeproto.dir/__/__/include/caffe/proto/caffe.pb.cc.o In file included from /Users/Name/Documents/Programming/PythonEnv/caffe/build/include/caffe/proto/caffe.pb.cc:4: In file included from /Users/Name/Documents/Programming/PythonEnv/caffe/build/include/caffe/proto/caffe.pb.h:9: /usr/local/include/google/protobuf/stubs/common.h:209:17: error: expected expression OnShutdownRun([](const void* p) { delete static_cast<const T*>(p); }, p); ^ In file included from /Users/Name/Documents/Programming/PythonEnv/caffe/build/include/caffe/proto/caffe.pb.cc:4: In file included from /Users/Name/Documents/Programming/PythonEnv/caffe/build/include/caffe/proto/caffe.pb.h:25: In file included from /usr/local/include/google/protobuf/generated_message_table_driven.h:34: In file included from /usr/local/include/google/protobuf/map.h:49: In file included from /usr/local/include/google/protobuf/map_type_handler.h:35: In file included from /usr/local/include/google/protobuf/wire_format_lite_inl.h:43: /usr/local/include/google/protobuf/message_lite.h:117:3: error: unknown type name 'constexpr' constexpr const T& get() const { return reinterpret_cast<const T&>(union_); }

我也尝试过使用CMake并遇到相同的问题。我不确定从这里去哪里。对于构建过程,我的知识不是很了解,因此,我对此是否含糊表示歉意,并很乐意提供任何其他可能有助于解决此问题的信息。

谢谢!

小智 5

如果使用进行编译make,请进行以下更改Makefile

- CXXFLAGS += -pthread -fPIC $(COMMON_FLAGS) $(WARNINGS)

+ CXXFLAGS += -pthread -fPIC $(COMMON_FLAGS) $(WARNINGS) -std=c++11