forked from microsoft/onnxruntime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added aarch64 build pipeline (microsoft#3841)
* Added aarch64 build pipeline * Fix build error * Remove auditwheel repair which doesn't work with cross compiling * Statically link C++ * Added auditwheel repair back and fix stdlib.h * Remove extra space
- Loading branch information
Prabhat
authored
May 11, 2020
1 parent
d7e3956
commit ce3678f
Showing
3 changed files
with
88 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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 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
59 changes: 59 additions & 0 deletions
59
tools/ci_build/github/azure-pipelines/linux-arm-ci-pipeline.yml
This file contains 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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
jobs: | ||
- job: Linux_ARM | ||
timeoutInMinutes: 60 | ||
pool: 'Linux-CPU' | ||
strategy: | ||
matrix: | ||
Py37: | ||
python.include: '3.7m' | ||
cp.tag: 'cp37-cp37m' | ||
Py36: | ||
python.include: '3.6m' | ||
cp.tag: 'cp36-cp36m' | ||
Py35: | ||
python.include: '3.5m' | ||
cp.tag: 'cp35-cp35m' | ||
steps: | ||
- task: CmdLine@2 | ||
inputs: | ||
script: | | ||
set -e -x | ||
sudo rm -rf * | ||
cd $(Build.SourcesDirectory) | ||
git submodule update --init --recursive | ||
cd - | ||
sudo apt-get install -y qemu-user-static | ||
sudo chmod a+x /usr/bin/azcopy | ||
cat << EOF > tool-chain.cmake | ||
SET(CMAKE_SYSTEM_NAME Linux) | ||
SET(CMAKE_SYSTEM_VERSION 1) | ||
SET(CMAKE_C_COMPILER aarch64-linux-gnu-gcc) | ||
set(CMAKE_C_FLAGS "-march=armv8-a -mtune=generic -Wno-unused-parameter -Wno-type-limits") | ||
SET(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++) | ||
set(CMAKE_CXX_FLAGS "-march=armv8-a -mtune=generic -Wno-unused-parameter -Wno-type-limits") | ||
SET(CMAKE_FIND_ROOT_PATH /mnt/toolchains/manylinux2014_aarch64) | ||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) | ||
EOF | ||
export PATH=/mnt/toolchains/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin:$PATH | ||
azcopy cp https://onnxruntimetestdata.blob.core.windows.net/models/toolchains.tar.xz $(Build.BinariesDirectory)/toolchains.tar.xz | ||
sudo rm -rf /mnt/toolchains | ||
mkdir /mnt/toolchains | ||
tar -Jxf $(Build.BinariesDirectory)/toolchains.tar.xz -C /mnt/toolchains | ||
aria2c -q https://github.com/protocolbuffers/protobuf/releases/download/v3.11.1/protoc-3.11.1-linux-x86_64.zip | ||
unzip protoc-3.11.1-linux-x86_64.zip | ||
aria2c -q https://github.com/Kitware/CMake/releases/download/v3.17.1/cmake-3.17.1-Linux-x86_64.tar.gz | ||
tar --strip=1 -zxf cmake-3.17.1-Linux-x86_64.tar.gz | ||
sudo cp /mnt/toolchains/manylinux2014_aarch64/usr/include/stdlib.h /mnt/toolchains/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/libc/usr/include/ | ||
bin/cmake -Donnxruntime_GCC_STATIC_CPP_RUNTIME=ON -DCMAKE_BUILD_TYPE=Release -Dprotobuf_WITH_ZLIB=OFF -DCMAKE_TOOLCHAIN_FILE=tool-chain.cmake -Donnxruntime_ENABLE_PYTHON=ON -DPYTHON_LIBRARY=dl -DPYTHON_EXECUTABLE=/mnt/toolchains/manylinux2014_aarch64/opt/python/'$(cp.tag)'/bin/python3 -Donnxruntime_BUILD_SHARED_LIB=OFF -Donnxruntime_RUN_ONNX_TESTS=OFF -Donnxruntime_DEV_MODE=ON -DONNX_CUSTOM_PROTOC_EXECUTABLE=$(Build.BinariesDirectory)/bin/protoc "-DPYTHON_INCLUDE_DIR=/mnt/toolchains/manylinux2014_aarch64/usr/include;/mnt/toolchains/manylinux2014_aarch64/opt/python/$(cp.tag)/include/python$(python.include)" -DNUMPY_INCLUDE_DIR=/mnt/toolchains $(Build.SourcesDirectory)/cmake | ||
make -j$(getconf _NPROCESSORS_ONLN) | ||
docker run -v /usr/bin/qemu-aarch64-static:/usr/bin/qemu-aarch64-static -v $(Build.BinariesDirectory):/tmp/a -v $(Build.SourcesDirectory):/tmp/b -w /tmp/a --rm quay.io/pypa/manylinux2014_aarch64 /opt/python/'$(cp.tag)'/bin/python3 /tmp/b/setup.py bdist_wheel | ||
workingDirectory: $(Build.BinariesDirectory) | ||
- task: PublishBuildArtifacts@1 | ||
displayName: 'Publish Artifact: wheels' | ||
inputs: | ||
PathtoPublish: '$(Build.BinariesDirectory)/dist' | ||
ArtifactName: wheels |