I have been trying to install Caffe on my mac running OSX 10.13.6
I have followed several guides, including the installation guide on the caffe site. I have erased everything and restarted several times. I get the same problem no matter what. When I go to compile everything I am getting this
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_); }
I have also tried using CMake and run into the same problem. I'm not sure where to go from here. I am not incredibly knowledgable about building processes so I apologize if this is vague and will be happy to provide whatever other information might help fix this.
Thank you!
如果使用make
编译,请按如下方式更改Makefile
:
- CXXFLAGS += -pthread -fPIC $(COMMON_FLAGS) $(WARNINGS)
+ CXXFLAGS += -pthread -fPIC $(COMMON_FLAGS) $(WARNINGS) -std=c++11
This is the same problem as reported here: https://trac.macports.org/ticket/57093#comment:1
The compiler needs to be using C++11. Try making this change in CMakeLists.txt
:
if(UNIX OR APPLE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -std=c++11") endif()
You just need to replace the newest version of protobuf with protobuf v3.5.1.
wget https://github.com/protocolbuffers/protobuf/archive/v3.5.1.zip
You need to download to source code, and compile it yourself.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.