microsoft/onnxruntime-extensions
Publicmirrored from https://github.com/microsoft/onnxruntime-extensionsAvailable
build.sh
16lines · modecode
| 1 | #!/bin/bash |
| 2 | |
| 3 | # The example build script to build the source in Linux-like platform |
| 4 | set -e -x -u |
| 5 | |
| 6 | OSNAME=$(uname -s) |
| 7 | if [[ "$OSNAME" == "Darwin" ]]; then |
| 8 | alias nproc="sysctl -n hw.logicalcpu" |
| 9 | fi |
| 10 | |
| 11 | BUILD_FLAVOR=RelWithDebInfo |
| 12 | target_dir=out/$OSNAME/$BUILD_FLAVOR |
| 13 | mkdir -p "$target_dir" && cd "$target_dir" |
| 14 | if [ -z ${CPU_NUMBER+x} ]; then CPU_NUMBER=$(nproc); fi |
| 15 | # it looks the parallel build on CI pipeline machine causes crashes. |
| 16 | cmake "$@" ../../.. && cmake --build . --config $BUILD_FLAVOR --parallel "${CPU_NUMBER}" |
| 17 | |