From 14ebf5d80efd52345f7c5ac66086eac956d80b73 Mon Sep 17 00:00:00 2001 From: Matti Picus Date: Tue, 16 Apr 2024 23:50:52 +1000 Subject: [PATCH 1/6] add debug info for issue 153 --- patches/0001-debug-cruft.patch | 27 +++++++++++++++++++++++++++ pyproject.toml | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 patches/0001-debug-cruft.patch diff --git a/patches/0001-debug-cruft.patch b/patches/0001-debug-cruft.patch new file mode 100644 index 00000000..066a260f --- /dev/null +++ b/patches/0001-debug-cruft.patch @@ -0,0 +1,27 @@ +From 63d7007a2fc6886409baf0c8e5796723df737c53 Mon Sep 17 00:00:00 2001 +From: Matti Picus +Date: Tue, 16 Apr 2024 23:48:32 +1000 +Subject: [PATCH] debug cruft + +--- + exports/Makefile | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/exports/Makefile b/exports/Makefile +index 27a291f34..8bdcc7494 100644 +--- a/exports/Makefile ++++ b/exports/Makefile +@@ -150,6 +150,10 @@ else + $(OBJCONV) @objconv.def ../$(LIBNAME) ../$(LIBNAME).osx.renamed + $(LIBDYNNAME) : ../$(LIBNAME).osx.renamed osx.def + endif ++ echo INTERNALNAME=$(INTERNAMNAME) ++ echo LIBPREFIX=$(LIBPREFIX) ++ echo LIBNAMESUFFIX=$(LIBNAMESUFFIX) ++ echo FIXED_LIBNAME=$(FIXED_LIBNAME) + ifneq (,$(filter 1 2,$(NOFORTRAN))) + #only build without Fortran + $(CC) $(CFLAGS) $(LDFLAGS) -all_load -headerpad_max_install_names -install_name "$(CURDIR)/../$(INTERNALNAME)" -dynamiclib -o ../$(LIBDYNNAME) $< -Wl,-exported_symbols_list,osx.def $(FEXTRALIB) +-- +2.39.3 (Apple Git-146) + diff --git a/pyproject.toml b/pyproject.toml index 8093389d..44ddc221 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta" [project] name = "scipy-openblas64" -version = "0.3.27.44.0" +version = "0.3.27.44.1" requires-python = ">=3.7" description = "Provides OpenBLAS for python packaging" readme = "README.md" From 7816846f0047315516362417df63034cb4d8b79c Mon Sep 17 00:00:00 2001 From: Matti Picus Date: Wed, 17 Apr 2024 06:57:53 +1000 Subject: [PATCH 2/6] do not swallow make output --- tools/build_steps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_steps.sh b/tools/build_steps.sh index 02445d27..6d4b0184 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -170,7 +170,7 @@ function do_build_lib { CFLAGS="$CFLAGS -fvisibility=protected -Wno-uninitialized" \ make BUFFERSIZE=20 DYNAMIC_ARCH=1 \ USE_OPENMP=0 NUM_THREADS=64 \ - BINARY=$bitness $interface_flags $target_flags > /dev/null + BINARY=$bitness $interface_flags $target_flags make PREFIX=$BUILD_PREFIX $interface_flags install popd stop_spinner From 3248624371da38c3fb8421f83f6265b437296de6 Mon Sep 17 00:00:00 2001 From: Matti Picus Date: Wed, 17 Apr 2024 08:22:42 +1000 Subject: [PATCH 3/6] typo --- patches/0001-debug-cruft.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/0001-debug-cruft.patch b/patches/0001-debug-cruft.patch index 066a260f..522fd7f7 100644 --- a/patches/0001-debug-cruft.patch +++ b/patches/0001-debug-cruft.patch @@ -15,7 +15,7 @@ index 27a291f34..8bdcc7494 100644 $(OBJCONV) @objconv.def ../$(LIBNAME) ../$(LIBNAME).osx.renamed $(LIBDYNNAME) : ../$(LIBNAME).osx.renamed osx.def endif -+ echo INTERNALNAME=$(INTERNAMNAME) ++ echo INTERNALNAME=$(INTERNALNAME) + echo LIBPREFIX=$(LIBPREFIX) + echo LIBNAMESUFFIX=$(LIBNAMESUFFIX) + echo FIXED_LIBNAME=$(FIXED_LIBNAME) From 9aaebc0e27ba0f4766ff408295fd838a1b62974f Mon Sep 17 00:00:00 2001 From: Matti Picus Date: Wed, 17 Apr 2024 09:27:19 +1000 Subject: [PATCH 4/6] do not add extra LIBNAMESUFFIX, it already exists --- patches/0001-debug-cruft.patch | 27 ------------------- ...01-do-not-add-LIBNAMESUFFIX-to-dylib.patch | 25 +++++++++++++++++ 2 files changed, 25 insertions(+), 27 deletions(-) delete mode 100644 patches/0001-debug-cruft.patch create mode 100644 patches/0001-do-not-add-LIBNAMESUFFIX-to-dylib.patch diff --git a/patches/0001-debug-cruft.patch b/patches/0001-debug-cruft.patch deleted file mode 100644 index 522fd7f7..00000000 --- a/patches/0001-debug-cruft.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 63d7007a2fc6886409baf0c8e5796723df737c53 Mon Sep 17 00:00:00 2001 -From: Matti Picus -Date: Tue, 16 Apr 2024 23:48:32 +1000 -Subject: [PATCH] debug cruft - ---- - exports/Makefile | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/exports/Makefile b/exports/Makefile -index 27a291f34..8bdcc7494 100644 ---- a/exports/Makefile -+++ b/exports/Makefile -@@ -150,6 +150,10 @@ else - $(OBJCONV) @objconv.def ../$(LIBNAME) ../$(LIBNAME).osx.renamed - $(LIBDYNNAME) : ../$(LIBNAME).osx.renamed osx.def - endif -+ echo INTERNALNAME=$(INTERNALNAME) -+ echo LIBPREFIX=$(LIBPREFIX) -+ echo LIBNAMESUFFIX=$(LIBNAMESUFFIX) -+ echo FIXED_LIBNAME=$(FIXED_LIBNAME) - ifneq (,$(filter 1 2,$(NOFORTRAN))) - #only build without Fortran - $(CC) $(CFLAGS) $(LDFLAGS) -all_load -headerpad_max_install_names -install_name "$(CURDIR)/../$(INTERNALNAME)" -dynamiclib -o ../$(LIBDYNNAME) $< -Wl,-exported_symbols_list,osx.def $(FEXTRALIB) --- -2.39.3 (Apple Git-146) - diff --git a/patches/0001-do-not-add-LIBNAMESUFFIX-to-dylib.patch b/patches/0001-do-not-add-LIBNAMESUFFIX-to-dylib.patch new file mode 100644 index 00000000..9a1956cf --- /dev/null +++ b/patches/0001-do-not-add-LIBNAMESUFFIX-to-dylib.patch @@ -0,0 +1,25 @@ +From cb3d41f8c1b0dce4c954937b32eb76f7154c33ee Mon Sep 17 00:00:00 2001 +From: Matti Picus +Date: Wed, 17 Apr 2024 09:24:51 +1000 +Subject: [PATCH] do not add LIBNAMESUFFIX to dylib + +--- + exports/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/exports/Makefile b/exports/Makefile +index 33c47d477..457e59b2c 100644 +--- a/exports/Makefile ++++ b/exports/Makefile +@@ -137,7 +137,7 @@ libgoto_hpl.def : $(GENSYM) + + ifeq ($(OSNAME), Darwin) + ifeq ($(FIXED_LIBNAME),1) +-INTERNALNAME = $(LIBPREFIX)$(LIBNAMESUFFIX).dylib ++INTERNALNAME = $(LIBPREFIX).dylib + else + INTERNALNAME = $(LIBPREFIX).$(MAJOR_VERSION).dylib + endif +-- +2.39.3 (Apple Git-146) + From af2c55561173d606dd44cae8c4d699de062eb981 Mon Sep 17 00:00:00 2001 From: Matti Picus Date: Wed, 17 Apr 2024 11:39:52 +1000 Subject: [PATCH 5/6] use install_name_tool to fix the SONAME inside the shared object --- tools/build_wheel.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/build_wheel.sh b/tools/build_wheel.sh index 456d3ef2..b1823fc2 100644 --- a/tools/build_wheel.sh +++ b/tools/build_wheel.sh @@ -34,6 +34,11 @@ if [[ $py_version != $pkg_version* ]]; then exit 1 fi +if [ $(uname) == "Darwin" ]; then + soname=$(cd local/scipy_openblas64/lib; ls libscipy_openblas*.dylib) + install_name_tool -id $soname local/scipy_openblas64/lib/$soname +fi + rm -rf local/scipy_openblas64/lib/pkgconfig echo "" >> LICENSE.txt echo "----" >> LICENSE.txt From 74ea513c6d79db8a23a1166e855bf3694b1e6672 Mon Sep 17 00:00:00 2001 From: Matti Picus Date: Wed, 17 Apr 2024 15:50:53 +1000 Subject: [PATCH 6/6] document the need to use install_name_tool --- tools/build_wheel.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/build_wheel.sh b/tools/build_wheel.sh index b1823fc2..f2f2ca9a 100644 --- a/tools/build_wheel.sh +++ b/tools/build_wheel.sh @@ -36,6 +36,9 @@ fi if [ $(uname) == "Darwin" ]; then soname=$(cd local/scipy_openblas64/lib; ls libscipy_openblas*.dylib) + echo otool -D local/scipy_openblas64/lib/$soname + otool -D local/scipy_openblas64/lib/$soname + # issue 153: there is a ".0" in the install_name. Remove it install_name_tool -id $soname local/scipy_openblas64/lib/$soname fi