1*da0073e9SAndroid Build Coastguard Worker#!/bin/bash 2*da0073e9SAndroid Build Coastguard Worker 3*da0073e9SAndroid Build Coastguard Workerset -ex 4*da0073e9SAndroid Build Coastguard Worker 5*da0073e9SAndroid Build Coastguard Worker# realpath might not be available on MacOS 6*da0073e9SAndroid Build Coastguard Workerscript_path=$(python -c "import os; import sys; print(os.path.realpath(sys.argv[1]))" "${BASH_SOURCE[0]}") 7*da0073e9SAndroid Build Coastguard Workertop_dir=$(dirname $(dirname $(dirname "$script_path"))) 8*da0073e9SAndroid Build Coastguard Workertp2_dir="$top_dir/third_party" 9*da0073e9SAndroid Build Coastguard Worker 10*da0073e9SAndroid Build Coastguard Workerpip install ninja 11*da0073e9SAndroid Build Coastguard Worker 12*da0073e9SAndroid Build Coastguard Worker# Install onnx 13*da0073e9SAndroid Build Coastguard Workerpip install --no-use-pep517 -e "$tp2_dir/onnx" 14*da0073e9SAndroid Build Coastguard Worker 15*da0073e9SAndroid Build Coastguard Worker# Install caffe2 and pytorch 16*da0073e9SAndroid Build Coastguard Workerpip install -r "$top_dir/caffe2/requirements.txt" 17*da0073e9SAndroid Build Coastguard Workerpip install -r "$top_dir/requirements.txt" 18*da0073e9SAndroid Build Coastguard Workerpython setup.py develop 19