Skip to content

Commit b38ca42

Browse files
committed
fix conda versioned package building
1 parent 0ad5b98 commit b38ca42

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

conda/build_pytorch.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ else
1212
portable_sed='sed --regexp-extended -i'
1313
fi
1414

15+
if [ "$#" -ne 3 ]; then
16+
echo "Illegal number of parameters. Pass cuda version, pytorch version, build number"
17+
exit 1
18+
fi
19+
1520
echo "Building cuda version $1 and pytorch version: $2 build_number: $3"
1621
desired_cuda="$1"
1722
build_version="$2"
@@ -23,6 +28,11 @@ export PYTORCH_BUILD_NUMBER=$build_number
2328

2429
if [[ "$build_version" == "nightly" ]]; then
2530
export PYTORCH_BUILD_VERSION="$(date +"%Y.%m.%d")"
31+
if [[ -z "$PYTORCH_BRANCH" ]]; then
32+
PYTORCH_BRANCH='master'
33+
fi
34+
else
35+
PYTORCH_BRANCH="v$build_version"
2636
fi
2737

2838
# Fill in missing env variables
@@ -37,9 +47,7 @@ fi
3747
if [[ -z "$GITHUB_ORG" ]]; then
3848
GITHUB_ORG='pytorch'
3949
fi
40-
if [[ -z "$PYTORCH_BRANCH" ]]; then
41-
PYTORCH_BRANCH='master'
42-
fi
50+
4351
if [[ "$OSTYPE" == "darwin"* ]]; then
4452
DEVELOPER_DIR=/Applications/Xcode9.app/Contents/Developer
4553
fi
@@ -82,6 +90,7 @@ echo "Using conda-build folder $build_folder"
8290

8391
# Clone the Pytorch repo, so that we can call run_test.py in it
8492
pytorch_rootdir="root_${GITHUB_ORG}pytorch${PYTORCH_BRANCH}"
93+
rm -rf "$pytorch_rootdir"
8594
git clone "https://github.com/$GITHUB_ORG/pytorch.git" "$pytorch_rootdir"
8695
pushd "$pytorch_rootdir"
8796
git checkout "$PYTORCH_BRANCH"
@@ -127,6 +136,7 @@ for py_ver in "${DESIRED_PYTHON[@]}"; do
127136
# the package afterwards, as there's no easy way to extract the final filename
128137
# from conda-build
129138
output_folder="out_$folder_tag"
139+
rm -rf "$output_folder"
130140
mkdir "$output_folder"
131141

132142
# Build the package

conda/pytorch-0.4.1/build.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,17 @@ fname_with_sha256() {
2828
}
2929

3030
DEPS_LIST=(
31+
"/usr/local/cuda/lib64/libcudart.so.9.0"
32+
"/usr/local/cuda/lib64/libnvToolsExt.so.1"
33+
"/usr/local/cuda/lib64/libnvrtc.so.9.0"
34+
"/usr/local/cuda/lib64/libnvrtc-builtins.so"
3135
)
3236

3337
DEPS_SONAME=(
38+
"libcudart.so.9.0"
39+
"libnvToolsExt.so.1"
40+
"libnvrtc.so.9.0"
41+
"libnvrtc-builtins.so"
3442
)
3543

3644

@@ -50,7 +58,9 @@ else
5058

5159
patchedpath=$(fname_with_sha256 $destpath)
5260
patchedname=$(basename $patchedpath)
61+
set +e
5362
mv $destpath $patchedpath
63+
set -e
5464

5565
patched+=("$patchedname")
5666
echo "Copied $filepath to $patchedpath"

conda/pytorch-0.4.1/meta.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ requirements:
2626
- mkl >=2018
2727
- cffi
2828
- ninja
29-
- cudatoolkit =9 # [not osx]
3029

3130
build:
3231
number: {{ environ.get('PYTORCH_BUILD_NUMBER') }}

0 commit comments

Comments
 (0)