Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 10a6e3c

Browse files
committed
WIP: patch OpenBLAS build for quadmath symbols
Apply Carl's patch to OpenBLAS export build of library, to remove libquatmath symbol. See: #82 (comment)
1 parent b9aefee commit 10a6e3c

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

patches/openblas-make-libs.patch

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
diff --git a/exports/Makefile b/exports/Makefile
2+
index d8173534..4e2e0d7b 100644
3+
--- a/exports/Makefile
4+
+++ b/exports/Makefile
5+
@@ -119,11 +119,21 @@ dll : ../$(LIBDLLNAME)
6+
# in their import table. By instead using a stable name it is possible to
7+
# upgrade between library versions, without needing to re-link an application.
8+
# For more details see: https://github.com/xianyi/OpenBLAS/issues/127.
9+
+ifeq ($(DEBUG), 1)
10+
../$(LIBDLLNAME) : ../$(LIBNAME) $(LIBPREFIX).def dllinit.$(SUFFIX)
11+
$(RANLIB) ../$(LIBNAME)
12+
$(CC) $(CFLAGS) $(LDFLAGS) $(LIBPREFIX).def dllinit.$(SUFFIX) \
13+
- -shared -o ../$(LIBDLLNAME) -Wl,--out-implib,../$(IMPLIBNAME) \
14+
+ -shared -o ../$(LIBDLLNAME) -Wl,--defsym,quadmath_snprintf=snprintf \
15+
-Wl,--whole-archive ../$(LIBNAME) -Wl,--no-whole-archive $(FEXTRALIB) $(EXTRALIB)
16+
+ dlltool -D $(LIBDLLNAME) -d $(LIBPREFIX).def -l ../$(LIBDLLNAME).a
17+
+else
18+
+../$(LIBDLLNAME) : ../$(LIBNAME) $(LIBPREFIX).def dllinit.$(SUFFIX)
19+
+ $(RANLIB) ../$(LIBNAME)
20+
+ $(CC) $(CFLAGS) $(LDFLAGS) $(LIBPREFIX).def dllinit.$(SUFFIX) \
21+
+ -shared -o ../$(LIBDLLNAME) -Wl,--defsym,quadmath_snprintf=snprintf -Wl,-gc-sections -Wl,-s \
22+
+ -Wl,--whole-archive ../$(LIBNAME) -Wl,--no-whole-archive $(FEXTRALIB) $(EXTRALIB)
23+
+ dlltool -D $(LIBDLLNAME) -d $(LIBPREFIX).def -l ../$(LIBDLLNAME).a
24+
+endif
25+
26+
$(LIBPREFIX).def : $(GENSYM)
27+
./$(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)

tools/build_openblas.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ fi
6363
# Build name for output library from gcc version and OpenBLAS commit.
6464
GCC_TAG="gcc_$(gcc -dumpversion | tr .- _)"
6565
OPENBLAS_VERSION=$(git describe --tags)
66+
# Patch OpenBLAS to exclude stray GFortran symbol.
67+
# Replacement snprintf symbol only present for UCRTC 64-bit build.
68+
if [ "$BUILD_BITS" == 64 ]; then
69+
patch -p1 < ../patches/openblas-make-libs.patch
70+
fi
6671
# Build OpenBLAS
6772
# Variable used in creating output libraries
6873
export LIBNAMESUFFIX=${OPENBLAS_VERSION}-${GCC_TAG}

0 commit comments

Comments
 (0)