Make fails because Protobuf seems not be using C++15
Issue Summary
I have issue with the compilation step. When running make -jsysctl -n hw.logicalcpu the compilation fails with Protobuf assertion stating that it only supports C++14 or newer. However the c++ version used is C++15
[75%] Performing build step for 'openpose_lib' [ 1%] Running C++/Python protocol buffer compiler on /Users/xyz/Projects/openpose/3rdparty/caffe/src/caffe/proto/caffe.proto [ 1%] Building CXX object src/caffe/CMakeFiles/caffeproto.dir///include/caffe/proto/caffe.pb.cc.o In file included from /Users/xyz/Projects/openpose/build/caffe/src/openpose_lib-build/include/caffe/proto/caffe.pb.cc:4: In file included from /Users/xyz/Projects/openpose/build/caffe/src/openpose_lib-build/include/caffe/proto/caffe.pb.h:11: /usr/local/include/google/protobuf/port_def.inc:210:1: error: static assertion failed due to requirement '201103L >= 201402L': Protobuf only supports C++14 and newer. static_assert(PROTOBUF_CPLUSPLUS_MIN(201402L), "Protobuf only supports C++14 and newer.");
Errors (if any)
[75%] Performing build step for 'openpose_lib' [ 1%] Running C++/Python protocol buffer compiler on /Users/xyz/Projects/openpose/3rdparty/caffe/src/caffe/proto/caffe.proto [ 1%] Building CXX object src/caffe/CMakeFiles/caffeproto.dir///include/caffe/proto/caffe.pb.cc.o In file included from /Users/xyz/Projects/openpose/build/caffe/src/openpose_lib-build/include/caffe/proto/caffe.pb.cc:4: In file included from /Users/xyz/Projects/openpose/build/caffe/src/openpose_lib-build/include/caffe/proto/caffe.pb.h:11: /usr/local/include/google/protobuf/port_def.inc:210:1: error: static assertion failed due to requirement '201103L >= 201402L': Protobuf only supports C++14 and newer. static_assert(PROTOBUF_CPLUSPLUS_MIN(201402L), "Protobuf only supports C++14 and newer.");
Type of Issue
Select the topic(s) on your post, delete the rest:
- Compilation/installation error
Your System Configuration
-
Whole console output (if errors appeared), paste the error to PasteBin and then paste the link here: LINK
-
OpenPose version: Latest GitHub code
-
General configuration:
- Installation mode: make -j
sysctl -n hw.logicalcpu - Operating system
- Operating system version x86_64-apple-darwin23.0.0
- Release or Debug mode Release
- Compiler Apple clang version 15.0.0 (clang-1500.0.40.1) Target: x86_64-apple-darwin23.0.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
- Installation mode: make -j
protoc --version libprotoc 24.4
-
Non-default settings:
- 3-D Reconstruction module added no
- Any other custom CMake configuration with respect to the default version? (by default: no): no
-
3rd-party software:
- Caffe version: from openPose
- CMake version cmake version 3.27.7
- OpenCV version: pre-compiled
apt-get install libopencv-dev(only Ubuntu); OpenPose default (only Windows); compiled from source? If so, 2.4.9, 2.4.12, 3.1, 3.2?; ...?
Based on the following post I updated openpose/3rdparty/caffe/CMakeLists.txt to
# ---[ Flags
if(UNIX OR APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -std=c++17")
endif()
This seems to have resolved the protobuf issue, but I am now running into another problem:
io.cpp:57:57: error: too many arguments to function call, expected single argument 'total_bytes_limit', have 2 arguments coded_input->SetTotalBytesLimit(kProtoReadBytesLimit, 536870912);
/usr/local/include/google/protobuf/io/coded_stream.h:390:8: note: 'SetTotalBytesLimit' declared here
void SetTotalBytesLimit(int total_bytes_limit);
^
1 error generated.
Hey, did you manage to solve the issue? If not,
- go to file path
cd <openpose-root-dir>/3rdparty/caffe/src/caffe/util - open file that contains error in an editor:
vim io.cpp - change
coded_input->SetTotalBytesLimit(kProtoReadBytesLimit, 536870912);tocoded_input->SetTotalBytesLimit(kProtoReadBytesLimit);at line 57
after following these steps, go back to build dir and re-run the make command.