Skip to content

Commit 9d07de9

Browse files
authored
Merge pull request #178 from mattip/v0.3.28
OpenBLAS v0.3.28
2 parents 3920096 + 547f146 commit 9d07de9

File tree

10 files changed

+71
-50
lines changed

10 files changed

+71
-50
lines changed

.github/workflows/posix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
env:
1313
REPO_DIR: OpenBLAS
14-
OPENBLAS_COMMIT: "d11e7340"
14+
OPENBLAS_COMMIT: "v0.3.28"
1515
MACOSX_DEPLOYMENT_TARGET: 10.9
1616

1717
jobs:

.github/workflows/windows.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
workflow_dispatch: null
99

1010
env:
11-
OPENBLAS_COMMIT: "d11e7340"
11+
OPENBLAS_COMMIT: "v0.3.28"
1212
OPENBLAS_ROOT: "c:\\opt"
1313
# Preserve working directory for calls into bash
1414
# Without this, invoking bash will cd to the home directory
@@ -45,13 +45,14 @@ jobs:
4545
echo "PLAT=i686" >> $env:GITHUB_ENV
4646
echo "WHEEL_PLAT=win32" >> $env:GITHUB_ENV
4747
echo "MSYSTEM=MINGW32" >> $env:GITHUB_ENV
48-
echo "LDFLAGS=-static -static-libgcc" >> $env:GITHUB_ENV
48+
# No ucrt on 32-bits, so use _snprintf_c instead
49+
echo "LDFLAGS=-static -static-libgcc -Wl,--defsym,_quadmath_snprintf=__snprintf_c" >> $env:GITHUB_ENV
4950
echo "BUILD_BITS=32" >> $env:GITHUB_ENV
5051
} else {
5152
echo "PLAT=x86_64" >> $env:GITHUB_ENV
5253
echo "WHEEL_PLAT=win_amd64" >> $env:GITHUB_ENV
5354
echo "MSYSTEM=UCRT64" >> $env:GITHUB_ENV
54-
echo "LDFLAGS=-lucrt -static -static-libgcc" >> $env:GITHUB_ENV
55+
echo "LDFLAGS=-lucrt -static -static-libgcc -Wl,--defsym,quadmath_snprintf=snprintf" >> $env:GITHUB_ENV
5556
echo "BUILD_BITS=64" >> $env:GITHUB_ENV
5657
}
5758
if ( ${{ matrix.INTERFACE64 }} -eq "1" ) {

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ env:
22
global:
33
# The archive that gets built has name from ``git describe`` on this
44
# commit.
5-
- OPENBLAS_COMMIT: "d11e7340"
5+
- OPENBLAS_COMMIT: "v0.3.28"
66
- REPO_DIR=OpenBLAS
77

88
sudo: required
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/exports/Makefile b/exports/Makefile
2+
index 668a4866e..956b51bf4 100644
3+
--- a/exports/Makefile
4+
+++ b/exports/Makefile
5+
@@ -126,8 +126,9 @@ dll : ../$(LIBDLLNAME)
6+
../$(LIBDLLNAME) : ../$(LIBNAME) $(LIBPREFIX).def dllinit.$(SUFFIX)
7+
$(RANLIB) ../$(LIBNAME)
8+
$(CC) $(CFLAGS) $(LDFLAGS) $(LIBPREFIX).def dllinit.$(SUFFIX) \
9+
- -shared -o ../$(LIBDLLNAME) -Wl,--out-implib,../$(IMPLIBNAME) \
10+
+ -shared -o ../$(LIBDLLNAME) -Wl,-gc-sections -Wl,-s -Wl,-Map,output.map \
11+
-Wl,--whole-archive ../$(LIBNAME) -Wl,--no-whole-archive $(FEXTRALIB) $(EXTRALIB)
12+
+ dlltool -D $(LIBDLLNAME) -d $(LIBPREFIX).def -l ../$(LIBDLLNAME).a
13+
14+
$(LIBPREFIX).def : $(GENSYM)
15+
./$(GENSYM) win2k $(ARCH) dummy $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) "$(SYMBOLPREFIX)" "$(SYMBOLSUFFIX)" $(BUILD_LAPACK_DEPRECATED) $(BUILD_BFLOAT16) $(BUILD_SINGLE) $(BUILD_DOUBLE) $(BUILD_COMPLEX) $(BUILD_COMPLEX16) > $(@F)

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ build-backend = "setuptools.build_meta"
88

99
[project]
1010
name = "scipy-openblas64"
11-
# v0.3.27-350-gd11e7340
12-
version = "0.3.27.350.0"
11+
# v0.3.28
12+
version = "0.3.28.0.0"
1313
requires-python = ">=3.7"
1414
description = "Provides OpenBLAS for python packaging"
1515
readme = "README.md"

tools/LICENSE_linux.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This binary distribution of NumPy also bundles the following software:
55

66

77
Name: OpenBLAS
8-
Files: numpy.libs/libopenblas*.so
8+
Files: numpy.libs/libscipy_openblas*.so
99
Description: bundled as a dynamically linked library
1010
Availability: https://github.com/OpenMathLib/OpenBLAS/
1111
License: BSD-3-Clause-Attribution
@@ -41,7 +41,7 @@ License: BSD-3-Clause-Attribution
4141

4242

4343
Name: LAPACK
44-
Files: numpy.libs/libopenblas*.so
44+
Files: numpy.libs/libscipy_openblas*.so
4545
Description: bundled in OpenBLAS
4646
Availability: https://github.com/OpenMathLib/OpenBLAS/
4747
License: BSD-3-Clause-Attribution

tools/LICENSE_osx.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
This binary distribution of NumPy also bundles the following software:
55

66
Name: OpenBLAS
7-
Files: numpy/.dylibs/libopenblas*.so
7+
Files: numpy/.dylibs/libscipy_openblas*.so
88
Description: bundled as a dynamically linked library
99
Availability: https://github.com/OpenMathLib/OpenBLAS/
1010
License: BSD-3-Clause-Attribution
@@ -40,7 +40,7 @@ License: BSD-3-Clause-Attribution
4040

4141

4242
Name: LAPACK
43-
Files: numpy/.dylibs/libopenblas*.so
43+
Files: numpy/.dylibs/libscipy_openblas*.so
4444
Description: bundled in OpenBLAS
4545
Availability: https://github.com/OpenMathLib/OpenBLAS/
4646
License: BSD-3-Clause-Attribution

tools/LICENSE_win32.txt

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This binary distribution of NumPy also bundles the following software:
55

66

77
Name: OpenBLAS
8-
Files: numpy.libs\libopenblas*.dll
8+
Files: libs/libscipy_openblas*.dll
99
Description: bundled as a dynamically linked library
1010
Availability: https://github.com/OpenMathLib/OpenBLAS/
1111
License: BSD-3-Clause-Attribution
@@ -41,7 +41,7 @@ License: BSD-3-Clause-Attribution
4141

4242

4343
Name: LAPACK
44-
Files: numpy.libs\libopenblas*.dll
44+
Files: libs/libscipy_openblas*.dll
4545
Description: bundled in OpenBLAS
4646
Availability: https://github.com/OpenMathLib/OpenBLAS/
4747
License: BSD-3-Clause-Attribution
@@ -96,7 +96,7 @@ License: BSD-3-Clause-Attribution
9696

9797

9898
Name: GCC runtime library
99-
Files: numpy.libs\libopenblas*.dll
99+
Files: libs/libscipy_openblas*.dll
100100
Description: statically linked to files compiled with gcc
101101
Availability: https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=libgfortran
102102
License: GPL-3.0-with-GCC-exception
@@ -878,25 +878,3 @@ may consider it more useful to permit linking proprietary applications with
878878
the library. If this is what you want to do, use the GNU Lesser General
879879
Public License instead of this License. But first, please read
880880
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
881-
882-
Name: libquadmath
883-
Files: numpy.libs\libopenb*.dll
884-
Description: statically linked to files compiled with gcc
885-
Availability: https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=libquadmath
886-
License: LGPL-2.1-or-later
887-
888-
GCC Quad-Precision Math Library
889-
Copyright (C) 2010-2019 Free Software Foundation, Inc.
890-
Written by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
891-
892-
This file is part of the libquadmath library.
893-
Libquadmath is free software; you can redistribute it and/or
894-
modify it under the terms of the GNU Library General Public
895-
License as published by the Free Software Foundation; either
896-
version 2.1 of the License, or (at your option) any later version.
897-
898-
Libquadmath is distributed in the hope that it will be useful,
899-
but WITHOUT ANY WARRANTY; without even the implied warranty of
900-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
901-
Lesser General Public License for more details.
902-
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html

tools/build_openblas.sh

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ fflags="$fextra $cflags -frecursive -ffpe-summary=invalid,zero"
7676

7777
# Set suffixed-ILP64 flags
7878
if [ "$if_bits" == "64" ]; then
79-
SYMBOLSUFFIX="64_"
79+
LIBNAMESUFFIX="64_"
8080
interface_flags="INTERFACE64=1 SYMBOLSUFFIX=64_ LIBNAMESUFFIX=64_"
8181
# We override FCOMMON_OPT, so we need to set default integer manually
8282
fflags="$fflags -fdefault-integer-8"
@@ -90,8 +90,13 @@ interface_flags="$interface_flags SYMBOLPREFIX=scipy_ LIBNAMEPREFIX=scipy_ FIXED
9090
# Build name for output library from gcc version and OpenBLAS commit.
9191
GCC_TAG="gcc_$(gcc -dumpversion | tr .- _)"
9292
OPENBLAS_VERSION=$(git describe --tags --abbrev=8)
93+
94+
# Patch OpenBLAS build to resolve all symbols and avoid linking
95+
# with libquadmath
96+
patch -p1 < ../patches-windows/openblas-make-libs.patch
97+
9398
# Build OpenBLAS
94-
# Variable used in creating output libraries
99+
CFLAGS="$CFLAGS -fvisibility=protected -fno-ident" \
95100
make BINARY=$build_bits DYNAMIC_ARCH=1 USE_THREAD=1 USE_OPENMP=0 \
96101
NUM_THREADS=24 NO_WARMUP=1 NO_AFFINITY=1 CONSISTENT_FPCSR=1 \
97102
BUILD_LAPACK_DEPRECATED=1 TARGET=PRESCOTT BUFFERSIZE=20\
@@ -100,8 +105,38 @@ make BINARY=$build_bits DYNAMIC_ARCH=1 USE_THREAD=1 USE_OPENMP=0 \
100105
FCOMMON_OPT="$fflags" \
101106
MAX_STACK_ALLOC=2048 \
102107
$interface_flags
108+
109+
# Make sure quadmath library is not statically linked in to the DLL by checking
110+
# the output.map generated by the linker when using `-Wl,-gc-sections -Wl,-s`
111+
# the map will have libname(o-filename) for each function pulled out of the
112+
# library libname
113+
# The file itself appears in the map, so look for "libquadmath.a(". Use '-A 3'
114+
# to show a bit of context if any symbols appear (which should not happen)
115+
set +e
116+
grep -A 2 "libquadmath.a(" exports/output.map
117+
case $? in
118+
0)
119+
echo "link uses libquadmath.a when it should not"
120+
exit -1
121+
;;
122+
1)
123+
if [ -f exports/output.map ]; then
124+
echo "Good, verified no 'libquadmath' used when linking"
125+
else
126+
echo "error occurred"
127+
exit -1
128+
fi
129+
;;
130+
*)
131+
echo "grep returned $?, error occurred"
132+
exit -1
133+
;;
134+
esac
135+
set -e
136+
103137
make PREFIX=$openblas_root/$build_bits $interface_flags install
104-
DLL_BASENAME=libscipy_openblas${SYMBOLSUFFIX}${LIBNAMESUFFIX}
138+
DLL_BASENAME=libscipy_openblas${LIBNAMESUFFIX}
139+
cp -f *.dll.a $openblas_root/$build_bits/lib/${DLL_BASENAME}.dll.a
105140

106141
# OpenBLAS does not build a symbol-suffixed static library on Windows:
107142
# do it ourselves. On 32-bit builds, the objcopy.def names need a '_' prefix
@@ -143,16 +178,8 @@ else
143178
sed -e "s/^Cflags.*/\0 -DBLAS_SYMBOL_PREFIX=scipy_/" -i pkgconfig/scipy-openblas.pc
144179
fi
145180
popd
146-
# Build template site.cfg for using this build
147-
cat > ${build_bits}/site.cfg.template << EOF
148-
[openblas${SYMBOLSUFFIX}]
149-
libraries = $DLL_BASENAME
150-
library_dirs = {openblas_root}\\${build_bits}\\lib
151-
include_dirs = {openblas_root}\\${build_bits}\\include
152-
EOF
153-
154181
ls $openblas_root/$build_bits/lib
155182

156-
zip_name="openblas${SYMBOLSUFFIX}-${OPENBLAS_VERSION}-${plat_tag}-${GCC_TAG}.zip"
183+
zip_name="openblas${LIBNAMESUFFIX}-${OPENBLAS_VERSION}-${plat_tag}-${GCC_TAG}.zip"
157184
zip -r $zip_name $build_bits
158185
cp $zip_name ${builds_dir}

tools/build_steps.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,13 @@ function do_build_lib {
174174
patch_source
175175
echo start building
176176
if [ -v dynamic_list ]; then
177-
CFLAGS="$CFLAGS -fvisibility=protected -Wno-uninitialized" \
177+
CFLAGS="$CFLAGS -fvisibility=protected -Wno-uninitialized -fno-ident" \
178178
make BUFFERSIZE=20 DYNAMIC_ARCH=1 \
179179
USE_OPENMP=0 NUM_THREADS=64 \
180180
DYNAMIC_LIST="$dynamic_list" \
181181
BINARY=$bitness $interface_flags $target_flags shared 2>&1 1>/dev/null
182182
else
183-
CFLAGS="$CFLAGS -fvisibility=protected -Wno-uninitialized" \
183+
CFLAGS="$CFLAGS -fvisibility=protected -Wno-uninitialized -fno-ident" \
184184
make BUFFERSIZE=20 DYNAMIC_ARCH=1 \
185185
USE_OPENMP=0 NUM_THREADS=64 \
186186
BINARY=$bitness $interface_flags $target_flags shared 2>&1 1>/dev/null

0 commit comments

Comments
 (0)