4

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!

3 Answers 3

5

If compiling with make, change Makefile as follows:

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

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

Sign up to request clarification or add additional context in comments.

Comments

2

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()

Comments

1

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.