menoh
menoh copied to clipboard
Unhelpful error message when wrong version of protobuf
Hi Menoh fails to compile probably because my local protobuf is too old :
$ cmake ... -- Found Protobuf: /usr/lib64/libprotobuf.so;-lpthread (found version "2.5.0") -- Found Protobuf: /usr/lib64/libprotobuf.so;-lpthread;-lpthread (found version "2.5.0") ... cmake exits successfully
$ make Scanning dependencies of target gen_onnx_proto [ 1%] Running gen_proto.py on onnx/onnx.in.proto Processing /home/wtambellini/repos/menoh/external/onnx/onnx/onnx.in.proto Writing /home/wtambellini/repos/menoh/Debug/external/onnx/onnx/onnx.proto Writing /home/wtambellini/repos/menoh/Debug/external/onnx/onnx/onnx.proto3 generating /home/wtambellini/repos/menoh/Debug/external/onnx/onnx/onnx_pb.py [ 2%] Running C++ protocol buffer compiler on /home/wtambellini/repos/menoh/Debug/external/onnx/onnx/onnx.proto onnx/onnx.proto:393:5: Expected "required", "optional", or "repeated". onnx/onnx.proto:393:17: Missing field number. onnx/onnx.proto:420:3: Expected "required", "optional", or "repeated". onnx/onnx.proto:420:15: Missing field number. make[2]: *** [external/onnx/onnx/onnx.pb.cc] Error 1 make[1]: *** [external/onnx/CMakeFiles/gen_onnx_proto.dir/all] Error 2 make: *** [all] Error 2
Yes, I know the md doc state protobuf 2.6.1, but should nt cmake simply assert/check the version of protoc/protobuf ?
I see in the main cmake : find_package(Protobuf ${PROTOBUF_VERSION} REQUIRED)
but PROTOBUF_VERSION is not set so empty so not imposing any minimum version. I could prepare a PR if you re ok to check protobuf version at cmake time. Kind
Thank you for your report @WilliamTambellini and sorry for the trouble. Checking at cmake time is suitable. We would like to take your PR.
ok I ll prepare a PR.