-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathci-before-build.sh
More file actions
executable file
·36 lines (29 loc) · 1.15 KB
/
ci-before-build.sh
File metadata and controls
executable file
·36 lines (29 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#! /bin/bash
set -xe
if [[ "$NIGHTLY" = "true" ]]; then
pushd OpenBLAS
git checkout develop
export OPENBLAS_COMMIT=$(git describe --tags --abbrev=8)
# Set the pyproject.toml version: convert v0.3.24-30-g138ed79f to 0.3.34.30.0
version=$(echo $OPENBLAS_COMMIT | sed -e "s/^v\(.*\)-g.*/\1/" | sed -e "s/-/./g").0
popd
sed -e "s/^version = .*/version = \"${version}\"/" -i.bak pyproject.toml
else
export OPENBLAS_COMMIT=$(cat openblas_commit.txt)
version=$(grep "^version =" pyproject.toml | sed 's/version = "//;s/"//')
fi
# Sanity check, strip off the last (build) number from version, convert - to . in OPENBLAS_COMMIT
if [[ "${OPENBLAS_COMMIT//-/.}" != *"${version%.*}"* ]]; then
echo "OPENBLAS_COMMIT $OPENBLAS_COMMIT does not match the pyproject.toml version $version"
exit -1
fi
sed -e "s/^VERSION = .*/VERSION = ${version}/" -i.bak OpenBLAS/Makefile.rule
echo "creating wheel from $OPENBLAS_COMMIT (NIGHTLY is $NIGHTLY)"
if [ "$(uname)" != "Darwin" ]; then
./tools/install-static-clang.sh
export PATH=/opt/clang/bin:$PATH
fi
# Build OpenBLAS
source build-openblas.sh
# Build wheel
source tools/build_prepare_wheel.sh