From 8bff0b21562f94a044fa3f75d801f6369e4d2ab2 Mon Sep 17 00:00:00 2001 From: mattip Date: Sun, 21 Jan 2024 22:50:18 +0200 Subject: [PATCH] fix and rename pkgconfig file --- .../0001-create-a-single-shared-object.patch | 31 ++++++++++++++++--- tools/build_openblas.sh | 5 +-- tools/build_steps.sh | 4 ++- 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/patches/0001-create-a-single-shared-object.patch b/patches/0001-create-a-single-shared-object.patch index 6b2162c..8841ee7 100644 --- a/patches/0001-create-a-single-shared-object.patch +++ b/patches/0001-create-a-single-shared-object.patch @@ -1,14 +1,15 @@ -From 80863b52c024ed2d5fda80546e7b6a0160531b9a Mon Sep 17 00:00:00 2001 +From e5f32d54b742caf4e59ef6e7ec0caa16b7f670d3 Mon Sep 17 00:00:00 2001 From: mattip -Date: Sun, 21 Jan 2024 08:35:54 +0200 +Date: Sun, 21 Jan 2024 22:34:48 +0200 Subject: [PATCH] create a single shared object --- Makefile | 10 ---------- - Makefile.install | 15 --------------- + Makefile.install | 16 +--------------- Makefile.system | 3 +++ exports/Makefile | 4 ++-- - 4 files changed, 5 insertions(+), 27 deletions(-) + openblas.pc.in | 2 +- + 5 files changed, 7 insertions(+), 28 deletions(-) diff --git a/Makefile b/Makefile index 8621a8b3f..56a449306 100644 @@ -71,7 +72,7 @@ index 8621a8b3f..56a449306 100644 do if test -d $$d; then \ $(MAKE) -C $$d $(@F) || exit 1 ; \ diff --git a/Makefile.install b/Makefile.install -index 01899b970..105bc4271 100644 +index 01899b970..958fb9957 100644 --- a/Makefile.install +++ b/Makefile.install @@ -90,30 +90,20 @@ endif @@ -122,6 +123,14 @@ index 01899b970..105bc4271 100644 endif endif +@@ -162,6 +147,7 @@ endif + + @echo Generating $(LIBSONAMEBASE)$(SUFFIX64).pc in "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)" + @echo 'libdir='$(OPENBLAS_LIBRARY_DIR) > "$(PKGFILE)" ++ @echo 'libprefix='$(SYBOLPREFIX) > "$(PKGFILE)" + @echo 'libsuffix='$(SYMBOLSUFFIX) >> "$(PKGFILE)" + @echo 'includedir='$(OPENBLAS_INCLUDE_DIR) >> "$(PKGFILE)" + @echo 'openblas_config= USE_64BITINT='$(INTERFACE64) 'DYNAMIC_ARCH='$(DYNAMIC_ARCH) 'DYNAMIC_OLDER='$(DYNAMIC_OLDER) 'NO_CBLAS='$(NO_CBLAS) 'NO_LAPACK='$(NO_LAPACK) 'NO_LAPACKE='$(NO_LAPACKE) 'NO_AFFINITY='$(NO_AFFINITY) 'USE_OPENMP='$(USE_OPENMP) $(CORE) 'MAX_THREADS='$(NUM_THREADS)>> "$(PKGFILE)" diff --git a/Makefile.system b/Makefile.system index 30b0ddec2..b2c92b99a 100644 --- a/Makefile.system @@ -158,6 +167,18 @@ index 7682f851d..632fa324b 100644 endif ifeq (, $(SYMBOLPREFIX)$(SYMBOLSUFFIX)) +diff --git a/openblas.pc.in b/openblas.pc.in +index 8ad6e8bee..33209293d 100644 +--- a/openblas.pc.in ++++ b/openblas.pc.in +@@ -2,6 +2,6 @@ Name: openblas + Description: OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version + Version: ${version} + URL: https://github.com/xianyi/OpenBLAS +-Libs: -L${libdir} -lopenblas${libsuffix} ++Libs: -L${libdir} -l${libprefix}openblas${libsuffix} + Libs.private: ${extralib} + Cflags: -I${includedir} -- 2.34.1 diff --git a/tools/build_openblas.sh b/tools/build_openblas.sh index 350dce2..69ec301 100644 --- a/tools/build_openblas.sh +++ b/tools/build_openblas.sh @@ -122,7 +122,7 @@ cp -f "${static_libname}.renamed" "$openblas_root/$build_bits/lib/${DLL_BASENAME cd $openblas_root # Copy library link file for custom name -cd $build_bits/lib +pushd $build_bits/lib cp ${our_wd}/OpenBLAS/exports/${DLL_BASENAME}.def ${DLL_BASENAME}.def # At least for the mingwpy wheel, we have to use the VC tools to build the # export library. Maybe fixed in later binutils by patch referred to in @@ -135,7 +135,8 @@ dlltool --input-def ${DLL_BASENAME}.def \ --output-lib ${DLL_BASENAME}.lib # Replace the DLL name with the generated name. sed -i "s/ -lopenblas.*$/ -l${DLL_BASENAME:3}/g" pkgconfig/openblas*.pc -cd ../.. +mv pkgconfig/*.pc pkgconfig/scipy-openblas.pc +popd # Build template site.cfg for using this build cat > ${build_bits}/site.cfg.template << EOF [openblas${SYMBOLSUFFIX}] diff --git a/tools/build_steps.sh b/tools/build_steps.sh index eb2db67..cbb300a 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -190,12 +190,14 @@ function do_build_lib { cp -f "OpenBLAS/${renamed_libname}" "$BUILD_PREFIX/lib/${static_libname}" # set +x fi + mv $BUILD_PREFIX/lib/pkgconfig/openblas*.pc $BUILD_PREFIX/lib/pkgconfig/scipy-openblas.pc + local out_name="openblas${symbolsuffix}-${version}-${plat_tag}${suff}.tar.gz" tar zcvf libs/$out_name \ $BUILD_PREFIX/include/*blas* \ $BUILD_PREFIX/include/*lapack* \ $BUILD_PREFIX/lib/libscipy_openblas* \ - $BUILD_PREFIX/lib/pkgconfig/openblas* \ + $BUILD_PREFIX/lib/pkgconfig/scipy-openblas* \ $BUILD_PREFIX/lib/cmake/openblas }