mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-14 20:48:00 +00:00
1. Add scripts to build Yocto image & toolchain 2. Update docker build scripts to support Onnxruntime build with ARM ACL 19.02/19.05
42 lines
1.2 KiB
Bash
Executable file
42 lines
1.2 KiB
Bash
Executable file
#!/bin/bash
|
|
set -e
|
|
#Download a file from internet
|
|
function GetFile {
|
|
local uri=$1
|
|
local path=$2
|
|
local force=${3:-false}
|
|
local download_retries=${4:-5}
|
|
local retry_wait_time_seconds=${5:-30}
|
|
|
|
if [[ -f $path ]]; then
|
|
if [[ $force = false ]]; then
|
|
echo "File '$path' already exists. Skipping download"
|
|
return 0
|
|
else
|
|
rm -rf $path
|
|
fi
|
|
fi
|
|
|
|
if [[ -f $uri ]]; then
|
|
echo "'$uri' is a file path, copying file to '$path'"
|
|
cp $uri $path
|
|
return $?
|
|
fi
|
|
|
|
echo "Downloading $uri"
|
|
# Use aria2c if available, otherwise use curl
|
|
if command -v aria2c > /dev/null; then
|
|
aria2c -q -d $(dirname $path) -o $(basename $path) "$uri"
|
|
else
|
|
curl "$uri" -sSL --retry $download_retries --retry-delay $retry_wait_time_seconds --create-dirs -o "$path" --fail
|
|
fi
|
|
|
|
return $?
|
|
}
|
|
|
|
GetFile https://github.com/protocolbuffers/protobuf/archive/v3.6.1.tar.gz /tmp/src/v3.6.1.tar.gz
|
|
tar -xf /tmp/src/v3.6.1.tar.gz -C /tmp/src
|
|
cd /tmp/src/protobuf-3.6.1
|
|
cmake ./cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Relwithdebinfo
|
|
make -j$(getconf _NPROCESSORS_ONLN)
|
|
make install
|