build_audio.sh 1.58 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env bash
if [[ -x "/remote/anaconda_token" ]]; then
    . /remote/anaconda_token || true
fi

set -ex

 # Function to retry functions that sometimes timeout or have flaky failures
retry () {
    $*  || (sleep 1 && $*) || (sleep 2 && $*) || (sleep 4 && $*) || (sleep 8 && $*)
}

13
export TORCHAUDIO_BUILD_VERSION="0.4.0.dev$(date "+%Y%m%d")"
14
15
16
17
18
19
export TORCHAUDIO_BUILD_NUMBER=1

SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"

audio_rootdir="$(pwd)/torchaudio-src"

20
21
22
23
if [[ "$BRANCH" == "" ]]; then
  BRANCH=master
fi

24
25
if [[ ! -d "$audio_rootdir" ]]; then
    rm -rf "$audio_rootdir"
26
    git clone "https://github.com/pytorch/audio" "$audio_rootdir" -b "$BRANCH"
27
28
fi

29
30
export TORCHAUDIO_GITHUB_ROOT_DIR="$audio_rootdir"

31
32
33
34
35
cd "$SOURCE_DIR"

ANACONDA_USER=pytorch
conda config --set anaconda_upload no

36
37
LATEST_PYTORCH_NIGHTLY_VERSION=$(conda search --json 'pytorch-nightly[channel=pytorch]' | python "$SOURCE_DIR/get-latest.py")
export CONDA_PYTORCH_CONSTRAINT="    - pytorch-nightly ==${LATEST_PYTORCH_NIGHTLY_VERSION}"
38
39
export CONDA_CUDATOOLKIT_CONSTRAINT=""
export CUDA_VERSION="None"
40
if [[ "$OSTYPE" == "darwin"* ]]; then
41
42
43
44
  export MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++
fi

time conda build -c $ANACONDA_USER --no-anaconda-upload --python 2.7 torchaudio
45
46
# Currently disabled, see https://github.com/pytorch/pytorch/issues/23738
# time conda build -c $ANACONDA_USER --no-anaconda-upload --python 3.5 torchaudio
47
48
49
50
time conda build -c $ANACONDA_USER --no-anaconda-upload --python 3.6 torchaudio
time conda build -c $ANACONDA_USER --no-anaconda-upload --python 3.7 torchaudio

 set +e