Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit 692714b

Browse files
committed
Harden conda install check
1 parent 87bd535 commit 692714b

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

.jenkins/build.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,27 @@ source /etc/lsb-release
99
# condition: if any and non-conda, simply build TC from scratch
1010

1111
if [[ "$DISTRIB_RELEASE" == 14.04 ]]; then
12-
if which conda &> /dev/null; then
12+
if [[ $(conda --version | wc -c) -ne 0 ]]; then
1313
echo "Building TC in conda env"
1414
source activate
1515
conda install -y -c pytorch pytorch
1616
conda install -y pyyaml
17-
WITH_PYTHON_C2=OFF CLANG_PREFIX=/usr/local/clang+llvm-tapir5.0 BUILD_TYPE=Release ./build.sh --all
17+
WITH_PYTHON_C2=OFF CORES=$(nproc) CLANG_PREFIX=/usr/local/clang+llvm-tapir5.0 BUILD_TYPE=Release ./build.sh --all
1818
else
1919
echo "Building TC in non-conda env"
20-
WITH_PYTHON_C2=OFF CLANG_PREFIX=/usr/local/clang+llvm-tapir5.0 BUILD_TYPE=Release ./build.sh --all
20+
WITH_PYTHON_C2=OFF CORES=$(nproc) CLANG_PREFIX=/usr/local/clang+llvm-tapir5.0 BUILD_TYPE=Release ./build.sh --all
2121
fi
2222
fi
2323

2424
if [[ "$DISTRIB_RELEASE" == 16.04 ]]; then
25-
if which conda &> /dev/null; then
25+
if [[ $(conda --version | wc -c) -ne 0 ]]; then
2626
echo "Building TC in conda env"
2727
source activate
2828
conda install -y pytorch cuda90 -c pytorch
2929
conda install -y pyyaml
30-
WITH_PYTHON_C2=OFF CLANG_PREFIX=/usr/local/clang+llvm-tapir5.0 BUILD_TYPE=Release ./build.sh --all
30+
WITH_PYTHON_C2=OFF CORES=$(nproc) CLANG_PREFIX=/usr/local/clang+llvm-tapir5.0 BUILD_TYPE=Release ./build.sh --all
3131
else
3232
echo "Building TC in non-conda env"
33-
WITH_PYTHON_C2=OFF CLANG_PREFIX=/usr/local/clang+llvm-tapir5.0 BUILD_TYPE=Release ./build.sh --all
33+
WITH_PYTHON_C2=OFF CORES=$(nproc) CLANG_PREFIX=/usr/local/clang+llvm-tapir5.0 BUILD_TYPE=Release ./build.sh --all
3434
fi
3535
fi

.jenkins/run_test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ source /etc/lsb-release
1111
if [[ "$DISTRIB_RELEASE" == 14.04 ]]; then
1212
echo "Running TC backend tests"
1313
./test.sh
14-
if which conda &> /dev/null; then
14+
if [[ $(conda --version | wc -c) -ne 0 ]]; then
1515
source activate
1616
echo "Running TC PyTorch tests"
1717
./test_python/run_test.sh
1818
fi
1919
fi
2020

2121
if [[ "$DISTRIB_RELEASE" == 16.04 ]]; then
22-
if which conda &> /dev/null; then
22+
if [[ $(conda --version | wc -c) -ne 0 ]]; then
2323
echo "Running TC PyTorch tests"
2424
source activate
2525
./test_python/run_test.sh

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ function install_tc_python() {
327327
export PYTHONPATH=${TC_DIR}/build/tensor_comprehensions/pybinds:${PYTHONPATH}
328328
echo "PYTHONPATH: ${PYTHONPATH}"
329329
else
330-
if which conda &> /dev/null; then
330+
if [[ $(conda --version | wc -c) -ne 0 ]]; then
331331
echo "Found conda, going to install Python packages"
332332
cd ${TC_DIR}
333333
export CONDA_PYTHON=$(which python3)

0 commit comments

Comments
 (0)