dlprimitives
dlprimitives copied to clipboard
Build error. Possible cause, removed/changed functions in later version of protobuf.
Error:
[ 90%] Running cpp protocol buffer compiler on proto/onnx.proto
[ 92%] Building CXX object CMakeFiles/dlprim_onnx.dir/src/importers/onnx.cpp.o
In file included from /home/skunkwork/experiments/dlprimitives/include/dlprim/opencl_include.hpp:26,
from /home/skunkwork/experiments/dlprimitives/include/dlprim/context.hpp:9,
from /home/skunkwork/experiments/dlprimitives/include/dlprim/tensor.hpp:9,
from /home/skunkwork/experiments/dlprimitives/include/dlprim/model.hpp:9,
from /home/skunkwork/experiments/dlprimitives/include/dlprim/onnx.hpp:9,
from /home/skunkwork/experiments/dlprimitives/src/importers/onnx.cpp:8:
/usr/include/CL/cl2.hpp:18:151: note: ‘#pragma message: cl2.hpp has been renamed to opencl.hpp to make it clear that it supports all versions of OpenCL. Please include opencl.hpp directly.’
18 | med to opencl.hpp to make it clear that it supports all versions of OpenCL. Please include opencl.hpp directly.")
| ^
/home/skunkwork/experiments/dlprimitives/src/importers/onnx.cpp: In member function ‘void dlprim::ONNXModel::load_proto(const std::string&)’:
/home/skunkwork/experiments/dlprimitives/src/importers/onnx.cpp:112:34: error: no matching function for call to ‘google::protobuf::io::CodedInputStream::SetTotalBytesLimit(int, int)’
112 | stream.SetTotalBytesLimit(std::numeric_limits<int>::max(),std::numeric_limits<int>::max());
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/skunkwork/experiments/dlprimitives/build/onnx.pb.h:23,
from /home/skunkwork/experiments/dlprimitives/src/importers/onnx.cpp:11:
/usr/include/google/protobuf/io/coded_stream.h:384:8: note: candidate: ‘void google::protobuf::io::CodedInputStream::SetTotalBytesLimit(int)’
384 | void SetTotalBytesLimit(int total_bytes_limit);
| ^~~~~~~~~~~~~~~~~~
/usr/include/google/protobuf/io/coded_stream.h:384:8: note: candidate expects 1 argument, 2 provided
make[2]: *** [CMakeFiles/dlprim_onnx.dir/build.make:84: CMakeFiles/dlprim_onnx.dir/src/importers/onnx.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:489: CMakeFiles/dlprim_onnx.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
Fix:
File: dlprimitives/src/importers/onnx.cpp line: 112
- stream.SetTotalBytesLimit(std::numeric_limits<int>::max(),std::numeric_limits<int>::max());
+ stream.SetTotalBytesLimit(std::numeric_limits<int>::max());
Ohhh yes, I remember it - some breaking code between different protobuf versions. I need to fix it - add ifdefs according to version.
Already fixed some time ago