Skip to content

Commit

Permalink
debug and 3.20.0
Browse files Browse the repository at this point in the history
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
  • Loading branch information
jcwchen committed Sep 26, 2022
1 parent 73eb7e2 commit a2ffa6f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
13 changes: 8 additions & 5 deletions .azure-pipelines/MacOS-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,21 @@ jobs:
- script: |
# Install Protobuf from source
export NUM_CORES=`sysctl -n hw.logicalcpu`
source workflow_scripts/protobuf/build_protobuf_unix.sh $NUM_CORES $(pwd)/protobuf/protobuf_install
if [ '$(onnx_debug)' == '1' ]; then
export DEBUG=1
source workflow_scripts/protobuf/build_protobuf_unix.sh $NUM_CORES $(pwd)/protobuf/protobuf_install Debug
else
source workflow_scripts/protobuf/build_protobuf_unix.sh $NUM_CORES $(pwd)/protobuf/protobuf_install
fi
git submodule update --init --recursive
python -m pip install -q --upgrade pip
python -m pip install -q -r requirements-release.txt
export ONNX_BUILD_TESTS=1
if [ '$(onnx_debug)' == '1' ]; then
export DEBUG=1
fi
if [ '$(onnx_ml)' == '1' ]; then
export ONNX_ML=1
fi
export ONNX_BUILD_TESTS=1
export CMAKE_ARGS="-DONNX_WERROR=ON"
if [ '$(onnx_lite)' == '1' ]; then
export CMAKE_ARGS="${CMAKE_ARGS} -DONNX_USE_LITE_PROTO=ON"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_linux_aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
${{ env.img }} \
bash -exc '\
source .env/bin/activate && \
python -m pip uninstall -y onnx && python -m pip install protobuf==3.19.5 && \
python -m pip uninstall -y onnx && python -m pip install protobuf==3.20.0 && \
python -m pip install dist/*manylinux2014_aarch64.whl && \
pytest && \
deactivate'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
- name: Verify ONNX with the minimum supported protobuf (from requirements.txt)
if: ${{ always() }}
run: |
python -m pip uninstall -y protobuf onnx && python -m pip install protobuf==3.19.5
python -m pip uninstall -y protobuf onnx && python -m pip install protobuf==3.20.0
for file in dist/*.whl; do python -m pip install --upgrade $file; done
pytest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ jobs:
if: ${{ always() }}
run: |
cd onnx
python -m pip uninstall -y protobuf onnx && python -m pip install protobuf==3.19.5
python -m pip uninstall -y protobuf onnx && python -m pip install protobuf==3.20.0
Get-ChildItem -Path dist/*.whl | foreach {python -m pip install --upgrade $_.fullname}
pytest
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
numpy >= 1.16.6 # TODO: update once TensorFlow 2.6 is end of life
protobuf >= 3.19.5, <= 3.20.1
protobuf >= 3.20.0, <= 3.20.1
typing-extensions >= 3.6.2.1
7 changes: 6 additions & 1 deletion workflow_scripts/protobuf/build_protobuf_unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

export CORE_NUMBER=$1
export INSTALL_PROTOBUF_PATH=$2
export BUILD_TYPE=$3

if [[ -z "$CORE_NUMBER" ]]; then
export CORE_NUMBER=1
Expand All @@ -13,14 +14,18 @@ if [[ -z "$INSTALL_PROTOBUF_PATH" ]]; then
export INSTALL_PROTOBUF_PATH=/usr
fi

if [[ -z "$BUILD_TYPE" ]]; then
export BUILD_TYPE=Release
fi

# Build protobuf from source with -fPIC on Unix-like system
ORIGINAL_PATH=$(pwd)
cd ..
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.20.2/protobuf-cpp-3.20.2.tar.gz
tar -xvf protobuf-cpp-3.20.2.tar.gz
cd protobuf-3.20.2
mkdir build_source && cd build_source
cmake ../cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=$INSTALL_PROTOBUF_PATH -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release
cmake ../cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=$INSTALL_PROTOBUF_PATH -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=$BUILD_TYPE
make -j$CORE_NUMBER
if [ "$INSTALL_PROTOBUF_PATH" == "/usr" ]; then
# install protobuf on default system path so it needs sudo permission
Expand Down

0 comments on commit a2ffa6f

Please sign in to comment.