Skip to content

Commit

Permalink
Download protoc in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
daquexian committed May 23, 2019
1 parent 202aefb commit 21cf8b6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ci/build_dnnlibrary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install 'ndk-bundle'
nproc=$(ci/get_cores.sh)

mkdir build_dnnlibrary && pushd build_dnnlibrary
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-27 -DANDROID_ABI=x86_64 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Release -DDNN_READ_ONNX=ON ..
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-27 -DANDROID_ABI=x86_64 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Release -DDNN_READ_ONNX=ON -DDNN_CUSTOM_PROTOC_EXECUTABLE=protoc/bin/protoc ..
cmake --build . -- -j$nproc
popd
2 changes: 2 additions & 0 deletions ci/dnnlibrary_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ steps:
submodules: true
- bash: brew install watch gnu-sed
displayName: Install watch and gnu-sed
- bash: ci/download_protoc.sh
displayName: Download protoc
- bash: ci/build_dnnlibrary.sh
displayName: Build
- bash: ci/start_android_emulator.sh
Expand Down
5 changes: 5 additions & 0 deletions ci/download_protoc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#! /usr/bin/env bash
set -e

wget https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/protoc-3.7.1-osx-x86_64.zip -O protoc.zip
unzip protoc.zip -d protoc
4 changes: 4 additions & 0 deletions cmake/onnx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ macro(configure_onnx)
endif()
set(ONNX_BUILD_MAIN_LIB ON)
set(ONNX_NAMESPACE ${DAQ_ONNX_NAMESPACE} CACHE STRING "onnx namespace")
if (NOT EXISTS ${DNN_CUSTOM_PROTOC_EXECUTABLE})
message(FATAL ERROR "DNN_CUSTOM_PROTOC_EXECUTABLE is not set or wrong.")
endif()
set(ONNX_CUSTOM_PROTOC_EXECUTABLE ${DNN_CUSTOM_PROTOC_EXECUTABLE})
add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/onnx)
target_compile_definitions(onnx_proto PRIVATE ONNX_BUILD_MAIN_LIB)
# Since https://github.com/onnx/onnx/pull/1318 is merged, we don't need to set it manually
Expand Down

0 comments on commit 21cf8b6

Please sign in to comment.