| #!/bin/bash |
| |
| set -ex |
|
|
| ldconfig |
|
|
| script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" |
| . "$script_dir/pkg_helpers.bash" |
|
|
| echo "Build Settings:" |
| echo "CU_VERSION: $CU_VERSION" |
| echo "D2_VERSION_SUFFIX: $D2_VERSION_SUFFIX" |
| echo "PYTHON_VERSION: $PYTHON_VERSION" |
| echo "PYTORCH_VERSION: $PYTORCH_VERSION" |
|
|
| setup_cuda |
| setup_wheel_python |
|
|
| yum install ninja-build -y |
| ln -sv /usr/bin/ninja-build /usr/bin/ninja || true |
|
|
| pip_install pip numpy -U |
| pip_install "torch==$PYTORCH_VERSION" \ |
| -f https://download.pytorch.org/whl/"$CU_VERSION"/torch_stable.html |
|
|
| |
| BASE_BUILD_DIR=build/$CU_VERSION-py$PYTHON_VERSION-pt$PYTORCH_VERSION |
| python setup.py \ |
| build -b "$BASE_BUILD_DIR" \ |
| bdist_wheel -b "$BASE_BUILD_DIR/build_dist" -d "wheels/$CU_VERSION/torch$PYTORCH_VERSION" |
| rm -rf "$BASE_BUILD_DIR" |
|
|