Skip to content

Commit ab8b10d

Browse files
committed
fix travis error
Co-authored by: nijincheng@iscas.ac.cn;
1 parent e6c99f5 commit ab8b10d

File tree

3 files changed

+44
-3
lines changed

3 files changed

+44
-3
lines changed

tools/build_steps.sh

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,49 @@ function do_build_lib {
288288
$BUILD_PREFIX/lib/cmake/openblas
289289
}
290290

291+
292+
function build_lib_on_travis {
293+
# OSX or manylinux build
294+
#
295+
# Input arg
296+
# plat - one of i686, x86_64, arm64
297+
# interface64 - 1 if build with INTERFACE64 and SYMBOLSUFFIX
298+
# nightly - 1 if building for nightlies
299+
#
300+
# Depends on globals
301+
# BUILD_PREFIX - install suffix e.g. "/usr/local"
302+
# MB_ML_VER
303+
set -x
304+
local plat=${1:-$PLAT}
305+
local interface64=${2:-$INTERFACE64}
306+
local nightly=${3:0}
307+
local manylinux=${MB_ML_VER:-1}
308+
309+
# Manylinux wrapper
310+
local libc=${MB_ML_LIBC:-manylinux}
311+
local docker_image=quay.io/pypa/${libc}${manylinux}_${plat}
312+
docker pull $docker_image
313+
# Docker sources this script, and runs `do_build_lib`
314+
docker run --rm \
315+
-e BUILD_PREFIX="$BUILD_PREFIX" \
316+
-e PLAT="${plat}" \
317+
-e INTERFACE64="${interface64}" \
318+
-e NIGHTLY="${nightly}" \
319+
-e PYTHON_VERSION="$MB_PYTHON_VERSION" \
320+
-e MB_ML_VER=${manylinux} \
321+
-e MB_ML_LIBC=${libc} \
322+
-v $PWD:/io \
323+
$docker_image /io/tools/docker_build_wrap.sh
324+
}
325+
326+
327+
291328
function build_on_travis {
292329
if [ ${TRAVIS_EVENT_TYPE} == "cron" ]; then
293-
build_lib "$PLAT" "$INTERFACE64" 1
330+
build_lib_on_travis "$PLAT" "$INTERFACE64" 1
294331
version=$(cd OpenBLAS && git describe --tags --abbrev=8 | sed -e "s/^v\(.*\)-g.*/\1/" | sed -e "s/-/./g")
295332
sed -e "s/^version = .*/version = \"${version}\"/" -i.bak pyproject.toml
296333
else
297-
build_lib "$PLAT" "$INTERFACE64" 0
334+
build_lib_on_travis "$PLAT" "$INTERFACE64" 0
298335
fi
299336
}

tools/build_wheel.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# $INTERFACE64 ("1" or "0")
33
# $PLAT (x86_64, i686, arm64, aarch64, s390x, ppc64le)
44

5+
set -xe
6+
57
source tools/build_prepare.sh
68

79
$PYTHON -m pip wheel -w dist -v .

tools/docker_build_wrap.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
set -e
66

77
# Change into root directory of repo
8-
# cd /io
8+
if [[ ! -e tools/build_steps.sh ]];then
9+
cd /io
10+
fi
911
source tools/build_steps.sh
1012
do_build_lib "$PLAT" "" "$INTERFACE64" "$NIGHTLY"

0 commit comments

Comments
 (0)