Skip to content

Commit 5bd6e59

Browse files
committed
make more of CI work
1 parent 4397282 commit 5bd6e59

File tree

3 files changed

+82
-15
lines changed

3 files changed

+82
-15
lines changed

.github/workflows/posix.yml

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
submodules: recursive
7373
fetch-depth: 0
7474
- name: Set up Python 3.8
75-
uses: actions/setup-python@v2
75+
uses: actions/setup-python@v4
7676
with:
7777
python-version: 3.8
7878
- name: Set extra env
@@ -93,7 +93,7 @@ jobs:
9393
echo "DOCKER_TEST_IMAGE: ${DOCKER_TEST_IMAGE}"
9494
- name: Install VirtualEnv
9595
run: |
96-
python -m pip install --upgrade pip
96+
python3 -m pip install --upgrade pip
9797
pip install virtualenv
9898
- name: Build OpenBLAS
9999
run: |
@@ -121,22 +121,30 @@ jobs:
121121
- name: Build wheel
122122
run: |
123123
mkdir -p local/openblas
124+
# This will fail if there is more than one file in libs
124125
tar -C local/openblas --strip-components=2 -xf libs/openblas*.tar.gz
125-
cp local/openblas/lib/libopenblas64_.so local/openblas/libopenblas_python.so
126-
# do not package the static libs and symlinks, they are ~55MB
127-
rm -rf local/openblas/lib/*
126+
# do not package the static libs and symlinks
127+
cp $(find local/openblas/lib -maxdepth 1 -size +1M -executable) local/openblas/libopenblas_python.so
128+
rm -rf local/openblas/lib/lib*
128129
mv local/openblas/libopenblas_python.so local/openblas/lib/
129130
130-
cat <<EOF > run_in_docker.sh
131-
cd /openblas
132-
patchelf --set-soname libopenblas_python.so local/openblas/lib/libopenblas_python.so
133-
python3.7 -m pip wheel -w /tmp/wheelhouse -vv .
134-
auditwheel repair -w dist/ /tmp/wheelhouse/openblas-*.whl
135-
python3.10 -m pip install dist/openblas-*.whl
136-
python3.10 -m openblas
137-
EOF
131+
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
132+
patchelf --set-soname libopenblas_python.so local/openblas/lib/libopenblas_python.so
133+
python3 -m pip install wheel auditwheel
134+
python3 -m pip wheel -w /tmp/wheelhouse -vv .
135+
auditwheel repair -w dist/ /tmp/wheelhouse/openblas-*.whl
136+
137+
else
138+
cat <<EOF > run_in_docker.sh
139+
cd /openblas
140+
patchelf --set-soname libopenblas_python.so local/openblas/lib/libopenblas_python.so
141+
python3.7 -m pip wheel -w /tmp/wheelhouse -vv .
142+
auditwheel repair -w dist/ /tmp/wheelhouse/openblas-*.whl
143+
python3.10 -m pip install dist/openblas-*.whl
144+
python3.10 -m openblas
145+
EOF
138146
139-
docker run --rm -v $(pwd):/openblas quay.io/pypa/manylinux2014_x86_64 /bin/bash -xe /openblas/run_in_docker.sh
147+
docker run --rm -v $(pwd):/openblas quay.io/pypa/manylinux2014_x86_64 /bin/bash -xe /openblas/run_in_docker.sh
140148
141149
- uses: actions/upload-artifact@v3
142150
with:

OpenBLAS

tools/local_build.sh

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Replicate the workflow from posix.yml locally on posix
2+
# This may bitrot, compare it to the original file before using
3+
4+
5+
# Set extra env
6+
if [ "uname -m" == "x86_64" ]; then
7+
export TRAVIS_OS_NAME=ubuntu-latest
8+
export PLAT=x86_64
9+
# export PLAT=i86
10+
DOCKER_TEST_IMAGE=multibuild/xenial_${PLAT}
11+
else
12+
export TRAVIS_OS_NAME=osx
13+
export LDFLAGS="-L/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/lib"
14+
export LIBRARY_PATH="-L/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/lib"
15+
export PLAT=x86_64
16+
# export PLAT=arm64
17+
export SUFFIX=gf_c469a42
18+
19+
fi
20+
export REPO_DIR=OpenBLAS
21+
export OPENBLAS_COMMIT="c2f4bdb"
22+
23+
# export MB_ML_LIBC=musllinux
24+
# export MB_ML_VER=_1_1
25+
# export MB_ML_VER=2014
26+
export INTERFACE64=1
27+
28+
function install_virtualenv {
29+
# Install VirtualEnv
30+
python3 -m pip install --upgrade pip
31+
pip install virtualenv
32+
}
33+
34+
function build_openblas {
35+
# Build OpenBLAS
36+
set -xeo pipefail
37+
if [ "$PLAT" == "arm64" ]; then
38+
sudo xcode-select -switch /Applications/Xcode_12.5.1.app
39+
export SDKROOT=/Applications/Xcode_12.5.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk
40+
clang --version
41+
fi
42+
source travis-ci/build_steps.sh
43+
echo "------ BEFORE BUILD ---------"
44+
before_build
45+
if [[ "$NIGHTLY" = "true" ]]; then
46+
echo "------ CLEAN CODE --------"
47+
clean_code $REPO_DIR develop
48+
echo "------ BUILD LIB --------"
49+
build_lib "$PLAT" "$INTERFACE64" "1"
50+
else
51+
echo "------ CLEAN CODE --------"
52+
clean_code $REPO_DIR $OPENBLAS_COMMIT
53+
echo "------ BUILD LIB --------"
54+
build_lib "$PLAT" "$INTERFACE64" "0"
55+
fi
56+
}
57+
58+
# install_virtualenv
59+
# build_openblas

0 commit comments

Comments
 (0)