Skip to content

Commit 8bff0b2

Browse files
committed
fix and rename pkgconfig file
1 parent 2893245 commit 8bff0b2

File tree

3 files changed

+32
-8
lines changed

3 files changed

+32
-8
lines changed

patches/0001-create-a-single-shared-object.patch

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
From 80863b52c024ed2d5fda80546e7b6a0160531b9a Mon Sep 17 00:00:00 2001
1+
From e5f32d54b742caf4e59ef6e7ec0caa16b7f670d3 Mon Sep 17 00:00:00 2001
22
From: mattip <[email protected]>
3-
Date: Sun, 21 Jan 2024 08:35:54 +0200
3+
Date: Sun, 21 Jan 2024 22:34:48 +0200
44
Subject: [PATCH] create a single shared object
55

66
---
77
Makefile | 10 ----------
8-
Makefile.install | 15 ---------------
8+
Makefile.install | 16 +---------------
99
Makefile.system | 3 +++
1010
exports/Makefile | 4 ++--
11-
4 files changed, 5 insertions(+), 27 deletions(-)
11+
openblas.pc.in | 2 +-
12+
5 files changed, 7 insertions(+), 28 deletions(-)
1213

1314
diff --git a/Makefile b/Makefile
1415
index 8621a8b3f..56a449306 100644
@@ -71,7 +72,7 @@ index 8621a8b3f..56a449306 100644
7172
do if test -d $$d; then \
7273
$(MAKE) -C $$d $(@F) || exit 1 ; \
7374
diff --git a/Makefile.install b/Makefile.install
74-
index 01899b970..105bc4271 100644
75+
index 01899b970..958fb9957 100644
7576
--- a/Makefile.install
7677
+++ b/Makefile.install
7778
@@ -90,30 +90,20 @@ endif
@@ -122,6 +123,14 @@ index 01899b970..105bc4271 100644
122123
endif
123124

124125
endif
126+
@@ -162,6 +147,7 @@ endif
127+
128+
@echo Generating $(LIBSONAMEBASE)$(SUFFIX64).pc in "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)"
129+
@echo 'libdir='$(OPENBLAS_LIBRARY_DIR) > "$(PKGFILE)"
130+
+ @echo 'libprefix='$(SYBOLPREFIX) > "$(PKGFILE)"
131+
@echo 'libsuffix='$(SYMBOLSUFFIX) >> "$(PKGFILE)"
132+
@echo 'includedir='$(OPENBLAS_INCLUDE_DIR) >> "$(PKGFILE)"
133+
@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)"
125134
diff --git a/Makefile.system b/Makefile.system
126135
index 30b0ddec2..b2c92b99a 100644
127136
--- a/Makefile.system
@@ -158,6 +167,18 @@ index 7682f851d..632fa324b 100644
158167
endif
159168

160169
ifeq (, $(SYMBOLPREFIX)$(SYMBOLSUFFIX))
170+
diff --git a/openblas.pc.in b/openblas.pc.in
171+
index 8ad6e8bee..33209293d 100644
172+
--- a/openblas.pc.in
173+
+++ b/openblas.pc.in
174+
@@ -2,6 +2,6 @@ Name: openblas
175+
Description: OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version
176+
Version: ${version}
177+
URL: https://github.com/xianyi/OpenBLAS
178+
-Libs: -L${libdir} -lopenblas${libsuffix}
179+
+Libs: -L${libdir} -l${libprefix}openblas${libsuffix}
180+
Libs.private: ${extralib}
181+
Cflags: -I${includedir}
161182
--
162183
2.34.1
163184

tools/build_openblas.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ cp -f "${static_libname}.renamed" "$openblas_root/$build_bits/lib/${DLL_BASENAME
122122

123123
cd $openblas_root
124124
# Copy library link file for custom name
125-
cd $build_bits/lib
125+
pushd $build_bits/lib
126126
cp ${our_wd}/OpenBLAS/exports/${DLL_BASENAME}.def ${DLL_BASENAME}.def
127127
# At least for the mingwpy wheel, we have to use the VC tools to build the
128128
# export library. Maybe fixed in later binutils by patch referred to in
@@ -135,7 +135,8 @@ dlltool --input-def ${DLL_BASENAME}.def \
135135
--output-lib ${DLL_BASENAME}.lib
136136
# Replace the DLL name with the generated name.
137137
sed -i "s/ -lopenblas.*$/ -l${DLL_BASENAME:3}/g" pkgconfig/openblas*.pc
138-
cd ../..
138+
mv pkgconfig/*.pc pkgconfig/scipy-openblas.pc
139+
popd
139140
# Build template site.cfg for using this build
140141
cat > ${build_bits}/site.cfg.template << EOF
141142
[openblas${SYMBOLSUFFIX}]

tools/build_steps.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,14 @@ function do_build_lib {
190190
cp -f "OpenBLAS/${renamed_libname}" "$BUILD_PREFIX/lib/${static_libname}"
191191
# set +x
192192
fi
193+
mv $BUILD_PREFIX/lib/pkgconfig/openblas*.pc $BUILD_PREFIX/lib/pkgconfig/scipy-openblas.pc
194+
193195
local out_name="openblas${symbolsuffix}-${version}-${plat_tag}${suff}.tar.gz"
194196
tar zcvf libs/$out_name \
195197
$BUILD_PREFIX/include/*blas* \
196198
$BUILD_PREFIX/include/*lapack* \
197199
$BUILD_PREFIX/lib/libscipy_openblas* \
198-
$BUILD_PREFIX/lib/pkgconfig/openblas* \
200+
$BUILD_PREFIX/lib/pkgconfig/scipy-openblas* \
199201
$BUILD_PREFIX/lib/cmake/openblas
200202
}
201203

0 commit comments

Comments
 (0)