-
Notifications
You must be signed in to change notification settings - Fork 367
protobuf upgrade #3255
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
Open
Sunny-Anand
wants to merge
38
commits into
onnx:main
Choose a base branch
from
Sunny-Anand:protobuf-update
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
protobuf upgrade #3255
Changes from 28 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
6a7d306
protobuf upgrade
Sunny-Anand e745797
fix git error for macos
Sunny-Anand 2bc50fa
updates
Sunny-Anand c4a7ae1
updates
Sunny-Anand f32f22a
updates
Sunny-Anand bae4408
updates
Sunny-Anand a1d9a3a
updates osx
Sunny-Anand 7efe63f
updates osx
Sunny-Anand a3d4701
updates osx
Sunny-Anand c69a66f
updates osx
Sunny-Anand f0c3c9b
updates osx
Sunny-Anand a269c63
updates osx
Sunny-Anand f88f3bd
updates osx
Sunny-Anand ab79c14
updates osx
Sunny-Anand c1b6106
updates osx
Sunny-Anand c543bae
updates osx
Sunny-Anand 00b384e
updates osx
Sunny-Anand 90e06b4
updates osx
Sunny-Anand 6b93539
updates osx
Sunny-Anand b12664a
updates osx
Sunny-Anand c1bc4ac
updates osx
Sunny-Anand 2594aeb
updates osx
Sunny-Anand 28d335f
updates osx
Sunny-Anand 0e55aa6
Merge branch 'main' into protobuf-update
AlexandreEichenberger 6750e53
add cppcheck suppression
Sunny-Anand 7a2474b
update s390x
Sunny-Anand f87d82d
update s390x
Sunny-Anand 92bdbce
update s390x
Sunny-Anand 9beeb47
updates
Sunny-Anand 137e940
updates
Sunny-Anand 0394448
Merge branch 'main' into protobuf-update
Sunny-Anand d298915
Merge branch 'main' into protobuf-update
Sunny-Anand c972e44
revert to using cpp implementation using whl files - can't use bazel …
Sunny-Anand e08b36c
comment the install
Sunny-Anand 577f5bf
update the clone path
Sunny-Anand 59518c5
update the clone path
Sunny-Anand 8774fe6
Merge branch 'main' into protobuf-update
Sunny-Anand e296fd6
Merge branch 'main' into protobuf-update
Sunny-Anand File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,34 @@ | ||
# Check out protobuf | ||
PROTOBUF_VERSION=21.12 | ||
git clone -b v${PROTOBUF_VERSION} --depth 1 --recursive https://github.com/protocolbuffers/protobuf.git | ||
# Exit immediately if a command exits with a non-zero status. | ||
set -e | ||
|
||
cd protobuf | ||
./autogen.sh | ||
./configure --enable-static=no | ||
make -j$(sysctl -n hw.logicalcpu) install | ||
cd python | ||
python3 setup.py install --cpp_implementation | ||
export INSTALL_PROTOBUF_PATH=~/work/protobuf_install # Changed to a dedicated install directory | ||
export BUILD_TYPE=Release | ||
export CORE_NUMBER=1 | ||
|
||
# Build protobuf from source with -fPIC on Unix-like system | ||
ORIGINAL_PATH=$(pwd) | ||
cd .. | ||
wget https://github.com/abseil/abseil-cpp/releases/download/20230802.2/abseil-cpp-20230802.2.tar.gz | ||
tar -xvf abseil-cpp-20230802.2.tar.gz | ||
|
||
wget https://github.com/protocolbuffers/protobuf/releases/download/v25.1/protobuf-25.1.tar.gz | ||
tar -xvf protobuf-25.1.tar.gz | ||
cd protobuf-25.1 | ||
mkdir build_source && cd build_source | ||
cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=$INSTALL_PROTOBUF_PATH -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DABSL_ROOT_DIR="${ORIGINAL_PATH}/../abseil-cpp-20230802.2" -DCMAKE_CXX_STANDARD=17 -DABSL_PROPAGATE_CXX_STD=on .. | ||
if [ "$INSTALL_PROTOBUF_PATH" == "/usr" ]; then | ||
# Don't use sudo for root | ||
if [[ "$(id -u)" == "0" ]]; then | ||
cmake --build . --target install --parallel $CORE_NUMBER | ||
else | ||
# install Protobuf on default system path so it needs sudo permission | ||
sudo cmake --build . --target install --parallel $CORE_NUMBER | ||
fi | ||
else | ||
cmake --build . --target install --parallel $CORE_NUMBER | ||
export PATH=$INSTALL_PROTOBUF_PATH/include:$INSTALL_PROTOBUF_PATH/lib:$INSTALL_PROTOBUF_PATH/bin:$PATH | ||
export LDFLAGS="-L$INSTALL_PROTOBUF_PATH/lib" | ||
export CPPFLAGS="-I$INSTALL_PROTOBUF_PATH/include" | ||
fi | ||
protoc --version | ||
cd $ORIGINAL_PATH |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version is 4.25.1 in other places. What's the reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no difference between the 2 as you can see the commit is the same. The different naming style is due to the fact that

3.
or4.
or5.
is a different release style adopted by protobuf for python verions.So all the places where there is a python pip reference the
4.25.1
version is used while in onnx-mlir we rely on the c++ protobuf so the verion is25.1
https://pypi.org/project/protobuf/4.25.1/