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

Possibility to change protobuf version #4026

Closed
CAMOBAP opened this issue May 25, 2020 · 4 comments
Closed

Possibility to change protobuf version #4026

CAMOBAP opened this issue May 25, 2020 · 4 comments

Comments

@CAMOBAP
Copy link

CAMOBAP commented May 25, 2020

Is your feature request related to a problem? Please describe.

I faced with a conflict between different protobuf version (probably this is problem of linker on android)

[libprotobuf FATAL /Users/camobap/.conan/data/onnxruntime/1.2.0/alpr/local/build/f502a074061dd809bc2f0d02202f07e31b204b22/onnxruntime/cmake/external/protobuf/src/google/protobuf/stubs/common.cc:87] This program was compiled against version 3.0.0 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.11.3).  Contact the program author for an update.  If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library.  (Version verification failed in "out/soong/.intermediates/frameworks/av/drm/libmediadrm/libmediadrm/android_x86_64_shared_core/gen/proto/frameworks/av/drm/libmediadrm/protos/plugin_metrics.pb.cc".)terminating with uncaught exception of type google::protobuf::FatalException: This program was compiled against version 3.0.0 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.11.3).  Contact the program author for an update.  If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library.  (Version verification failed in "out/soong/.intermediates/frameworks/av/drm/libmediadrm/libmediadrm/android_x86_64_shared_core/gen/proto/frameworks/av/drm/libmediadrm/protos/plugin_metrics.pb.cc".)

I cannot chance protobuf version of libmediadrm because this is system library.

So it will be nice to have a possibility to change version protobuf library.

Are there some requirements for the minimal protobuf version?

System information

  • ONNX Runtime version (you are using): 1.2.0

Describe the solution you'd like

It will be nice to have some options on build.[sh|bat] or CMakeLists.txt

./build.sh --protobuf_prefix ... or ./build.sh --protobuf_version ... or

Describe alternatives you've considered

A possible workaround is to use dlopen, but it doesn't quite fit my needshttps://stackoverflow.com/questions/52203862/building-an-android-executable-grpc-server-that-uses-protocol-buffers-without-a

Additional context

@snnn
Copy link
Member

snnn commented May 25, 2020

  1. If you only use onnxruntime as a shared library via C/C++, or you only use its Python/C#/... bindings, then you don't need to keep the two protobuf version consist. They can be different. For example, you may build onnxruntime in a clean docker container that doesn't have protobuf installed, then you won't see such build error anymore.

  2. It is a concern only if you static link to onnxruntime . In this case, please turn on the following cmake option:
    https://github.com/microsoft/onnxruntime/blob/master/cmake/CMakeLists.txt#L98

  3. The last choice, go to onnxruntime's protobuf submodule directory, update it to the version you want, like:

git fetch --tags
git reset --hard v3.12.1

@CAMOBAP
Copy link
Author

CAMOBAP commented May 25, 2020

Thanks, @snnn

  1. ... you won't see such build error anymore.

The problem which I faced with happens on runtime, as I said highly likely it's ld bug/issue

#3 works pretty well for me

@CAMOBAP CAMOBAP closed this as completed May 25, 2020
@snnn
Copy link
Member

snnn commented May 25, 2020

BTW, for example, our onnxruntime server depends on GRPC, and GRPC depends on protobuf too. Though it uses a different protobuf version that onnxruntime needs, it doesn't matter.

@snnn
Copy link
Member

snnn commented Jun 1, 2020

Update:
Our latest code doesn't support protobuf v3.12.1. But it does support v3.11.x and lower.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants