mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Summary: Continuing pjh5's work to remove FULL_CAFFE2 flag completely. With these changes you'll be able to also do something like ``` NO_TEST=1 python setup.py build_deps ``` and this will skip building tests in caffe2, aten, and c10d. By default the tests are built. cc mingzhe09088 Yangqing Pull Request resolved: https://github.com/pytorch/pytorch/pull/11321 Reviewed By: mingzhe09088 Differential Revision: D9694950 Pulled By: orionr fbshipit-source-id: ff5c4937a23d1a263378a196a5eda0cba98af0a8
39 lines
958 B
Bash
Executable File
39 lines
958 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -ex
|
|
|
|
# realpath might not be available on MacOS
|
|
script_path=$(python -c "import os; import sys; print(os.path.realpath(sys.argv[1]))" "${BASH_SOURCE[0]}")
|
|
top_dir=$(dirname $(dirname $(dirname "$script_path")))
|
|
tp2_dir="$top_dir/third_party"
|
|
BUILD_DIR="$top_dir/build"
|
|
mkdir -p "$BUILD_DIR"
|
|
|
|
_pip_install() {
|
|
if [[ -n "$CI" ]]; then
|
|
if [[ -z "${SCCACHE_BUCKET}" ]]; then
|
|
ccache -z
|
|
fi
|
|
fi
|
|
if [[ -n "$CI" ]]; then
|
|
time pip install "$@"
|
|
else
|
|
pip install "$@"
|
|
fi
|
|
if [[ -n "$CI" ]]; then
|
|
if [[ -n "${SCCACHE_BUCKET}" ]]; then
|
|
sccache --show-stats
|
|
else
|
|
ccache -s
|
|
fi
|
|
fi
|
|
}
|
|
|
|
# Install onnx
|
|
_pip_install -b "$BUILD_DIR/onnx" "file://$tp2_dir/onnx#egg=onnx"
|
|
|
|
# Install caffe2 and pytorch
|
|
pip install -r "$top_dir/caffe2/requirements.txt"
|
|
pip install -r "$top_dir/requirements.txt"
|
|
USE_OPENCV=1 BUILD_BINARY=1 python setup.py install
|