Skip to content

Commit

Permalink
create a single shared object
Browse files Browse the repository at this point in the history
  • Loading branch information
mattip committed Jan 19, 2024
1 parent f544ee0 commit ab46c97
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 3 deletions.
72 changes: 72 additions & 0 deletions patches/0001-build-a-single-shared-object.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
From f3f6eeba8e569e66a0f92b9e58f8465924f636f4 Mon Sep 17 00:00:00 2001
From: mattip <[email protected]>
Date: Fri, 19 Jan 2024 15:13:13 +0200
Subject: [PATCH] build a single shared object

---
Makefile | 5 -----
Makefile.system | 3 +++
exports/Makefile | 4 ++--
3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index 8621a8b3f..0febfd0a6 100644
--- a/Makefile
+++ b/Makefile
@@ -134,17 +134,12 @@ shared : libs netlib $(RELA)
ifneq ($(NO_SHARED), 1)
ifeq ($(OSNAME), $(filter $(OSNAME),Linux SunOS Android Haiku FreeBSD DragonFly))
@$(MAKE) -C exports so
- @ln -fs $(LIBSONAME) $(LIBPREFIX).so
- @ln -fs $(LIBSONAME) $(LIBPREFIX).so.$(MAJOR_VERSION)
endif
ifeq ($(OSNAME), $(filter $(OSNAME),OpenBSD NetBSD))
@$(MAKE) -C exports so
- @ln -fs $(LIBSONAME) $(LIBPREFIX).so
endif
ifeq ($(OSNAME), Darwin)
@$(MAKE) -C exports dyn
- @ln -fs $(LIBDYNNAME) $(LIBPREFIX).dylib
- @ln -fs $(LIBDYNNAME) $(LIBPREFIX).$(MAJOR_VERSION).dylib
endif
ifeq ($(OSNAME), WINNT)
@$(MAKE) -C exports dll
diff --git a/Makefile.system b/Makefile.system
index 30b0ddec2..b2c92b99a 100644
--- a/Makefile.system
+++ b/Makefile.system
@@ -1695,6 +1695,9 @@ LIBNAME_P = $(LIBPREFIX)p$(REVISION)_p.$(LIBSUFFIX)
endif
endif

+# Override for scipy-openblas: don't put the revision into the so name
+LIBNAME = $(LIBPREFIX).$(LIBSUFFIX)
+LIBNAME_P = $(LIBPREFIX)_p.$(LIBSUFFIX)

LIBDLLNAME = $(LIBPREFIX).dll
IMPLIBNAME = lib$(LIBNAMEBASE).dll.a
diff --git a/exports/Makefile b/exports/Makefile
index 7682f851d..632fa324b 100644
--- a/exports/Makefile
+++ b/exports/Makefile
@@ -132,7 +132,7 @@ libgoto_hpl.def : $(GENSYM)
./$(GENSYM) win2khpl $(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)

ifeq ($(OSNAME), Darwin)
-INTERNALNAME = $(LIBPREFIX).$(MAJOR_VERSION).dylib
+INTERNALNAME = $(LIBPREFIX).dylib
endif

ifeq (, $(SYMBOLPREFIX)$(SYMBOLSUFFIX))
@@ -169,7 +169,7 @@ INTERNALNAME = $(LIBPREFIX).so
FEXTRALIB += -lm
EXTRALIB += -lm
else
-INTERNALNAME = $(LIBPREFIX).so.$(MAJOR_VERSION)
+INTERNALNAME = $(LIBPREFIX).so
endif

ifeq (, $(SYMBOLPREFIX)$(SYMBOLSUFFIX))
--
2.34.1

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "scipy_openblas64"
version = "0.3.24.95.1"
version = "0.3.24.95.2"
requires-python = ">=3.7"
description = "Provides OpenBLAS for python packaging"
readme = "README.md"
Expand Down
6 changes: 4 additions & 2 deletions tools/build_steps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,10 @@ function build_lib {

function patch_source {
# Runs inside OpenBLAS directory
# bash does not like an empty function, add a null statement
:
# Make the patches by git format-patch <old commit>
for f in $(ls ../patches); do
git apply ../patches/$f
done
}

function do_build_lib {
Expand Down

0 comments on commit ab46c97

Please sign in to comment.