-
-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
protobuf: static libraries #136843
protobuf: static libraries #136843
Conversation
Remind me: which formulae need the static |
At least, I'm not aware of others. |
How about we just fix openvino to use the shared libraries? We can build these again now, but these are much less useful since you still need to link to a whole bunch of abseil libraries (which we don't have static libraries for). |
I would say the problem is with protobuf, because it has global storage for registered schemas. With static protobuf each plugin has its own storage and loading / unloading don't lead to errors.
It's not a problem I hope, because # User options
include("${CMAKE_CURRENT_LIST_DIR}/protobuf-options.cmake")
# Depend packages
if(NOT ZLIB_FOUND)
find_package(ZLIB)
endif()
if(NOT TARGET absl::strings)
find_package(absl CONFIG)
endif()
if(NOT TARGET utf8_range)
find_package(utf8_range CONFIG)
endif()
# Imported targets
include("${CMAKE_CURRENT_LIST_DIR}/protobuf-targets.cmake")
# protobuf-generate function
include("${CMAKE_CURRENT_LIST_DIR}/protobuf-generate.cmake")
# CMake FindProtobuf module compatible file
if(protobuf_MODULE_COMPATIBLE)
include("${CMAKE_CURRENT_LIST_DIR}/protobuf-module.cmake")
endif() So, |
I suspect it will be, because, if I understand correctly, Have you been able to build |
Actually, why don't we use CI to find out... |
Right, by default OpenVINO (and all other projects, who does not set
With the first option and static protobuf + dynamic absl libraries, the list of dependencies looks like:
With your change, OpenVINO build failed, because 2023.0.1 version does not support protobuf 4.x (higher CXX standard requirements), it's fixed in current master (commit, future 2023.1.0 release). |
This seems nicer and would be done upstream if possible.
In that case, I suggest adding the static libraries when 2023.1.0 has been released (or, perhaps, just building them in the |
Looks like it's aligned with "official" suggestion from protobuf team protocolbuffers/protobuf#12637 (comment) With requiring
Do you mean compile own static version of protobuf and use only in OpenVINO formula? |
BTW, cmake developers also recommend to use |
Ok, let's use static protobuf 4.x directly in openvino.rb |
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew test <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingbrew install --build-from-source <formula>
)? If this is a new formula, does it passbrew audit --new <formula>
?Aligned with protobuf@21 and older versions (see
homebrew-core/Formula/protobuf@21.rb
Lines 67 to 73 in a26fca5