Skip to content

Commit d386f0e

Browse files
authored
Merge pull request #218 from mattip/remove-4741
patch to remove OpenBLAS PR 4741, cleanup unused bash code
2 parents 92dce7e + ff7c5d2 commit d386f0e

File tree

7 files changed

+69
-87
lines changed

7 files changed

+69
-87
lines changed

.github/workflows/posix.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ jobs:
5959
submodules: recursive
6060
fetch-depth: 0
6161

62-
- name: Set extra env
63-
run: |
64-
echo "DOCKER_TEST_IMAGE=$(echo multibuild/xenial_${{ matrix.PLAT}})" >> $GITHUB_ENV;
65-
6662
- uses: maxim-lobanov/setup-xcode@v1.6.0
6763
if: ${{ contains(matrix.os, 'macos') }}
6864
with:
@@ -71,7 +67,6 @@ jobs:
7167
- name: Print some Environment variable
7268
run: |
7369
echo "PLAT: ${PLAT}"
74-
echo "DOCKER_TEST_IMAGE: ${DOCKER_TEST_IMAGE}"
7570
7671
# - name: Setup tmate session
7772
# if: ${{ failure() }}

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,24 @@ jobs:
1616
- PLAT=s390x
1717
- MB_ML_VER=2014
1818
- INTERFACE64=0
19-
- DOCKER_TEST_IMAGE=multibuild/xenial_{PLAT}
2019
- os: linux
2120
arch: s390x
2221
env:
2322
- PLAT=s390x
2423
- INTERFACE64=1
2524
- MB_ML_VER=2014
26-
- DOCKER_TEST_IMAGE=multibuild/xenial_{PLAT}
2725
- os: linux
2826
arch: ppc64le
2927
env:
3028
- PLAT=ppc64le
3129
- MB_ML_VER=2014
3230
- INTERFACE64=0
33-
- DOCKER_TEST_IMAGE=multibuild/xenial_{PLAT}
3431
- os: linux
3532
arch: ppc64le
3633
env:
3734
- PLAT=ppc64le
3835
- INTERFACE64=1
3936
- MB_ML_VER=2014
40-
- DOCKER_TEST_IMAGE=multibuild/xenial_{PLAT}
4137

4238
before_install:
4339
- source tools/build_steps.sh

build-openblas.sh

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,6 @@ source tools/build_steps.sh
4747
echo "------ BEFORE BUILD ---------"
4848
before_build
4949

50-
function fill_submodule {
51-
# Restores .git directory to submodule, if necessary
52-
# See:
53-
# https://stackoverflow.com/questions/41776331/is-there-a-way-to-reconstruct-a-git-directory-for-a-submodule
54-
local repo_dir="$1"
55-
[ -z "$repo_dir" ] && echo "repo_dir not defined" && exit 1
56-
local git_loc="$repo_dir/.git"
57-
# For ordinary submodule, .git is a file.
58-
[ -d "$git_loc" ] && return
59-
# Need to recreate .git directory for submodule
60-
local origin_url=$(cd "$repo_dir" && git config --get remote.origin.url)
61-
local repo_copy="$repo_dir-$RANDOM"
62-
git clone --recursive "$repo_dir" "$repo_copy"
63-
rm -rf "$repo_dir"
64-
mv "${repo_copy}" "$repo_dir"
65-
(cd "$repo_dir" && git remote set-url origin $origin_url)
66-
}
67-
6850
function clean_code {
6951
local repo_dir=${1:-$REPO_DIR}
7052
local build_commit=${2:-$BUILD_COMMIT}
@@ -74,7 +56,6 @@ function clean_code {
7456
# have a .git directory. If $repo_dir is copied around, tools like
7557
# Versioneer which require that it be a git repository are unable
7658
# to determine the version. Give submodule proper git directory
77-
fill_submodule "$repo_dir"
7859
(cd $repo_dir \
7960
&& git fetch origin --tags \
8061
&& git checkout $build_commit \
@@ -94,4 +75,4 @@ else
9475
clean_code $REPO_DIR $OPENBLAS_COMMIT
9576
echo "------ BUILD LIB --------"
9677
build_lib "$PLAT" "$INTERFACE64" "0"
97-
fi
78+
fi

patches/0001-backout-PR-4741.patch

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
From fe2f02876134dcfdd75860c622226b6913eef93e Mon Sep 17 00:00:00 2001
2+
From: mattip <matti.picus@gmail.com>
3+
Date: Wed, 22 Oct 2025 14:40:01 +0300
4+
Subject: [PATCH] backout PR 4741
5+
6+
---
7+
driver/level3/level3_thread.c | 24 ++++++++++++------------
8+
1 file changed, 12 insertions(+), 12 deletions(-)
9+
10+
diff --git a/driver/level3/level3_thread.c b/driver/level3/level3_thread.c
11+
index 22f27975b..0832db58b 100644
12+
--- a/driver/level3/level3_thread.c
13+
+++ b/driver/level3/level3_thread.c
14+
@@ -588,8 +588,8 @@ static int gemm_driver(blas_arg_t *args, BLASLONG *range_m, BLASLONG
15+
InitializeCriticalSection((PCRITICAL_SECTION)&level3_lock);
16+
#else
17+
static pthread_mutex_t level3_lock = PTHREAD_MUTEX_INITIALIZER;
18+
- static pthread_cond_t level3_wakeup = PTHREAD_COND_INITIALIZER;
19+
- volatile static BLASLONG CPU_AVAILABLE = MAX_CPU_NUMBER;
20+
+ // static pthread_cond_t level3_wakeup = PTHREAD_COND_INITIALIZER;
21+
+ // volatile static BLASLONG CPU_AVAILABLE = MAX_CPU_NUMBER;
22+
#endif
23+
24+
blas_arg_t newarg;
25+
@@ -659,12 +659,12 @@ static int gemm_driver(blas_arg_t *args, BLASLONG *range_m, BLASLONG
26+
EnterCriticalSection((PCRITICAL_SECTION)&level3_lock);
27+
#else
28+
pthread_mutex_lock(&level3_lock);
29+
- while(CPU_AVAILABLE < nthreads) {
30+
- pthread_cond_wait(&level3_wakeup, &level3_lock);
31+
- }
32+
- CPU_AVAILABLE -= nthreads;
33+
- WMB;
34+
- pthread_mutex_unlock(&level3_lock);
35+
+ // while(CPU_AVAILABLE < nthreads) {
36+
+ // pthread_cond_wait(&level3_wakeup, &level3_lock);
37+
+ // }
38+
+ // CPU_AVAILABLE -= nthreads;
39+
+ // WMB;
40+
+ // pthread_mutex_unlock(&level3_lock);
41+
#endif
42+
43+
#ifdef USE_ALLOC_HEAP
44+
@@ -816,10 +816,10 @@ static int gemm_driver(blas_arg_t *args, BLASLONG *range_m, BLASLONG
45+
#elif defined(OS_WINDOWS)
46+
LeaveCriticalSection((PCRITICAL_SECTION)&level3_lock);
47+
#else
48+
- pthread_mutex_lock(&level3_lock);
49+
- CPU_AVAILABLE += nthreads;
50+
- WMB;
51+
- pthread_cond_signal(&level3_wakeup);
52+
+ // pthread_mutex_lock(&level3_lock);
53+
+ // CPU_AVAILABLE += nthreads;
54+
+ // WMB;
55+
+ // pthread_cond_signal(&level3_wakeup);
56+
pthread_mutex_unlock(&level3_lock);
57+
#endif
58+
59+
--
60+
2.43.0
61+

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
99
[project]
1010
name = "scipy-openblas64"
1111
# v0.3.30
12-
version = "0.3.30.0.3"
12+
version = "0.3.30.0.4"
1313
requires-python = ">=3.7"
1414
description = "Provides OpenBLAS for python packaging"
1515
readme = "README.md"

tools/build_steps.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build script for manylinux and OSX
2-
BUILD_PREFIX=/usr/local
2+
BUILD_PREFIX=${BUILD_PREFIX:-/usr/local}
33

44
ROOT_DIR=$(dirname $(dirname "${BASH_SOURCE[0]}"))
55

tools/local_build.sh

Lines changed: 5 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -9,79 +9,28 @@ if [[ $(uname) == "Darwin" ]]; then
99
export PLAT=x86_64
1010
elif [[ $(uname -m) == "x86_64" ]]; then
1111
echo got x86_64
12-
export TRAVIS_OS_NAME=ubuntu-latest
1312
export PLAT=x86_64
1413
# export PLAT=i86
15-
DOCKER_TEST_IMAGE=multibuild/xenial_${PLAT}
1614
elif [[ $(uname -m) == arm64 ]]; then
1715
echo got arm64
1816
exit -1
1917
else
2018
echo got nothing
2119
exit -1
22-
export TRAVIS_OS_NAME=osx
2320
export LDFLAGS="-L/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/lib"
2421
export LIBRARY_PATH="-L/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/lib"
2522
export PLAT=x86_64
2623
# export PLAT=arm64
2724
export SUFFIX=gf_c469a42
2825
fi
2926
export REPO_DIR=OpenBLAS
30-
export OPENBLAS_COMMIT="v0.3.30"
27+
export OPENBLAS_COMMIT="develop"
3128

3229
# export MB_ML_LIBC=musllinux
33-
# export MB_ML_VER=_1_1
30+
# export MB_ML_VER=_1_2
3431
# export MB_ML_VER=2014
3532
export INTERFACE64=1
33+
# export BUILD_PREFIX=/tmp/openblas
34+
# mkdir -p $BUILD_PREFIX
3635

37-
function install_virtualenv {
38-
# Install VirtualEnv
39-
python3 -m pip install --upgrade pip
40-
pip install virtualenv
41-
}
42-
43-
function clean_code_local {
44-
# Copied from common_utils.sh, with added debugging
45-
local repo_dir=${1:-$REPO_DIR}
46-
local build_commit=${2:-$BUILD_COMMIT}
47-
[ -z "$repo_dir" ] && echo "repo_dir not defined" && exit 1
48-
[ -z "$build_commit" ] && echo "build_commit not defined" && exit 1
49-
# The package $repo_dir may be a submodule. git submodules do not
50-
# have a .git directory. If $repo_dir is copied around, tools like
51-
# Versioneer which require that it be a git repository are unable
52-
# to determine the version. Give submodule proper git directory
53-
# XXX no need to do this
54-
# fill_submodule "$repo_dir"
55-
pushd $repo_dir
56-
git fetch origin --tags
57-
git checkout $build_commit
58-
git clean -fxd
59-
git reset --hard
60-
git submodule update --init --recursive
61-
popd
62-
}
63-
64-
function build_openblas {
65-
if [[ -z VIRTUAL_ENV ]]; then
66-
echo "must be run in a virtualenv"
67-
fi
68-
# Build OpenBLAS
69-
set -xeo pipefail
70-
source tools/build_steps.sh
71-
echo "------ BEFORE BUILD ---------"
72-
before_build
73-
if [[ "$NIGHTLY" = "true" ]]; then
74-
echo "------ CLEAN CODE --------"
75-
clean_code $REPO_DIR develop
76-
echo "------ BUILD LIB --------"
77-
build_lib "$PLAT" "$INTERFACE64" "1"
78-
else
79-
echo "------ CLEAN CODE --------"
80-
clean_code $REPO_DIR $OPENBLAS_COMMIT
81-
echo "------ BUILD LIB --------"
82-
build_lib "$PLAT" "$INTERFACE64" "0"
83-
fi
84-
}
85-
86-
# install_virtualenv
87-
build_openblas
36+
bash ./build-openblas.sh

0 commit comments

Comments
 (0)