Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building with "--minimal_build" fails #5786

Closed
Linux13524 opened this issue Nov 12, 2020 · 3 comments
Closed

Building with "--minimal_build" fails #5786

Linux13524 opened this issue Nov 12, 2020 · 3 comments
Labels
build build issues; typically submitted using template platform:mobile issues related to ONNX Runtime mobile; typically submitted using template

Comments

@Linux13524
Copy link

Describe the bug
Im trying to build onnxruntime with --minimal_build as described in ONNX Runtime for Mobile Platforms, but getting the following error:

[ 41%] Building CXX object CMakeFiles/onnx_proto.dir/onnx/onnx-ml.pb.cc.o
In file included from /home/lkloeckner/onnxruntime/cmake/external/protobuf/src/google/protobuf/map_type_handler.h:34,
                 from /home/lkloeckner/onnxruntime/cmake/external/protobuf/src/google/protobuf/map.h:49,
                 from /home/lkloeckner/onnxruntime/cmake/external/protobuf/src/google/protobuf/generated_message_table_driven.h:34,
                 from /home/lkloeckner/onnxruntime/build/Linux/MinSizeRel/onnx/onnx-ml.pb.h:26,
                 from /home/lkloeckner/onnxruntime/build/Linux/MinSizeRel/onnx/onnx-ml.pb.cc:4:
/home/lkloeckner/onnxruntime/cmake/external/protobuf/src/google/protobuf/parse_context.h: In instantiation of ‘bool google::protobuf::internal::ExpectTag(const char*) [with unsigned int tag = 186]’:
/home/lkloeckner//onnxruntime/build/Linux/MinSizeRel/onnx/onnx-ml.pb.cc:1130:73:   required from here
/home/lkloeckner/onnxruntime/cmake/external/protobuf/src/google/protobuf/parse_context.h:397:17: error: comparison is always false due to limited range of data type [-Werror=type-limits]
  397 |     return *ptr == tag;
      |            ~~~~~^~~~~~
/home/lkloeckner/onnxruntime/cmake/external/protobuf/src/google/protobuf/parse_context.h: In instantiation of ‘bool google::protobuf::internal::ExpectTag(const char*) [with unsigned int tag = 162]’:
/home/lkloeckner/onnxruntime/build/Linux/MinSizeRel/onnx/onnx-ml.pb.cc:2768:73:   required from here
/home/lkloeckner/onnxruntime/cmake/external/protobuf/src/google/protobuf/parse_context.h:397:17: error: comparison is always false due to limited range of data type [-Werror=type-limits]
cc1plus: all warnings being treated as errors

I tried with v1.5.1, v1.5.3 and latest master (2a87108).

Normal build without --minimal_build does work.

Any idea?

System information

  • OS Platform and Distribution: Fedora 32
  • ONNX Runtime version: 1.5.3
  • Python version: 3.8.6
  • GCC/Compiler version: 10.2.1

To Reproduce
Trying to build with: ./build.sh --config=MinSizeRel --build_shared_lib --minimal_build --disable_ml_ops --disable_exceptions --skip_tests --include_ops_by_config required_operators.config

required_operators.config contains ai.onnx.ml;1;TreeEnsembleClassifier

Expected behavior
Successful build

Full Log

full_log.txt

@edgchen1 edgchen1 added build build issues; typically submitted using template platform:mobile issues related to ONNX Runtime mobile; typically submitted using template type:bug labels Nov 12, 2020
@Linux13524
Copy link
Author

Linux13524 commented Nov 13, 2020

Small update: Just tried to build it with gcc-9 and it works fine. Can someone reproduce the error with gcc-10?

EDIT: This issue might be related: protocolbuffers/protobuf#7514

@snnn
Copy link
Member

snnn commented May 1, 2021

Yes, I tried gcc 10 and saw this error. It doesn't related to the "--minimal_build" build flag.

@snnn
Copy link
Member

snnn commented May 1, 2021

I will close this PR for now, because it is not an onnnxruntime bug. When protobuf v3.16.0 is released, I will bring it in and the problem will be gone.

@snnn snnn closed this as completed May 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build issues; typically submitted using template platform:mobile issues related to ONNX Runtime mobile; typically submitted using template
Projects
None yet
Development

No branches or pull requests

3 participants