* [gentoo-commits] repo/gentoo:master commit in: sci-libs/openblas/, sci-libs/openblas/files/
@ 2019-07-06 15:48 Benda XU
0 siblings, 0 replies; 6+ messages in thread
From: Benda XU @ 2019-07-06 15:48 UTC (permalink / raw
To: gentoo-commits
commit: 62f95abf6b504a047c22500f5e95364ddc594010
Author: Mo Zhou <cdluminate <AT> gmail <DOT> com>
AuthorDate: Sat Jul 6 05:05:54 2019 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Sat Jul 6 15:47:42 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=62f95abf
sci-libs/openblas: new package with eselect-ldso feature integrated.
Closes: https://bugs.gentoo.org/584534
Closes: https://bugs.gentoo.org/658034
Closes: https://github.com/gentoo/gentoo/pull/12357
Signed-off-by: Mo Zhou <cdluminate <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
sci-libs/openblas/Manifest | 1 +
sci-libs/openblas/files/shared-blas-lapack.patch | 137 +++++++++++++++++++++++
sci-libs/openblas/metadata.xml | 20 ++++
sci-libs/openblas/openblas-0.3.5.ebuild | 85 ++++++++++++++
4 files changed, 243 insertions(+)
diff --git a/sci-libs/openblas/Manifest b/sci-libs/openblas/Manifest
new file mode 100644
index 00000000000..8ebcf20cda7
--- /dev/null
+++ b/sci-libs/openblas/Manifest
@@ -0,0 +1 @@
+DIST openblas-0.3.5.tar.gz 11853101 BLAKE2B a9b249bc397fcb1d80401d1c60c6985803016e4fd0908649fe6386ae84a09a53569814b3af65fd8fbfa92f2cdd5d4af313ba91a80f7daa7e481a7941cbb9af2c SHA512 15520c3eca79b002f1afbee64257afa24705dec667a89bd46acfcdae426e29342816fb586db98ff256fcc9d0fd744b14b347fed23995958e7646a5e3e7310cf4
diff --git a/sci-libs/openblas/files/shared-blas-lapack.patch b/sci-libs/openblas/files/shared-blas-lapack.patch
new file mode 100644
index 00000000000..fc77427362c
--- /dev/null
+++ b/sci-libs/openblas/files/shared-blas-lapack.patch
@@ -0,0 +1,137 @@
+diff --git a/sci-libs/openblas/files/Makefile b/sci-libs/openblas/files/Makefile
+index 20ec74e..87e842f 100644
+--- a/interface/Makefile
++++ b/interface/Makefile
+@@ -2151,3 +2151,132 @@ cblas_zgeadd.$(SUFFIX) cblas_zgeadd.$(PSUFFIX) : zgeadd.c
+
+ cblas_xerbla.$(SUFFIX) cblas_xerbla.$(PSUFFIX) : xerbla.c
+ $(CC) -c $(CFLAGS) -DCBLAS $< -o $(@F)
++
++#############################################################################
++# Customized shared objects
++
++FSBLAS1OBJS = \
++ saxpy.$(SUFFIX) sswap.$(SUFFIX) \
++ scopy.$(SUFFIX) sscal.$(SUFFIX) \
++ sdot.$(SUFFIX) sdsdot.$(SUFFIX) dsdot.$(SUFFIX) \
++ sasum.$(SUFFIX) snrm2.$(SUFFIX) \
++ smax.$(SUFFIX) samax.$(SUFFIX) ismax.$(SUFFIX) isamax.$(SUFFIX) \
++ smin.$(SUFFIX) samin.$(SUFFIX) ismin.$(SUFFIX) isamin.$(SUFFIX) \
++ srot.$(SUFFIX) srotg.$(SUFFIX) srotm.$(SUFFIX) srotmg.$(SUFFIX) \
++ saxpby.$(SUFFIX)
++
++FSBLAS2OBJS = \
++ sgemv.$(SUFFIX) sger.$(SUFFIX) \
++ strsv.$(SUFFIX) strmv.$(SUFFIX) ssymv.$(SUFFIX) \
++ ssyr.$(SUFFIX) ssyr2.$(SUFFIX) sgbmv.$(SUFFIX) \
++ ssbmv.$(SUFFIX) sspmv.$(SUFFIX) \
++ sspr.$(SUFFIX) sspr2.$(SUFFIX) \
++ stbsv.$(SUFFIX) stbmv.$(SUFFIX) \
++ stpsv.$(SUFFIX) stpmv.$(SUFFIX)
++
++FSBLAS3OBJS = \
++ sgemm.$(SUFFIX) ssymm.$(SUFFIX) strmm.$(SUFFIX) \
++ strsm.$(SUFFIX) ssyrk.$(SUFFIX) ssyr2k.$(SUFFIX) \
++ somatcopy.$(SUFFIX) simatcopy.$(SUFFIX)\
++ sgeadd.$(SUFFIX)
++
++
++FDBLAS1OBJS = \
++ daxpy.$(SUFFIX) dswap.$(SUFFIX) \
++ dcopy.$(SUFFIX) dscal.$(SUFFIX) \
++ ddot.$(SUFFIX) \
++ dasum.$(SUFFIX) dnrm2.$(SUFFIX) \
++ dmax.$(SUFFIX) damax.$(SUFFIX) idmax.$(SUFFIX) idamax.$(SUFFIX) \
++ dmin.$(SUFFIX) damin.$(SUFFIX) idmin.$(SUFFIX) idamin.$(SUFFIX) \
++ drot.$(SUFFIX) drotg.$(SUFFIX) drotm.$(SUFFIX) drotmg.$(SUFFIX) \
++ daxpby.$(SUFFIX)
++
++FDBLAS2OBJS = \
++ dgemv.$(SUFFIX) dger.$(SUFFIX) \
++ dtrsv.$(SUFFIX) dtrmv.$(SUFFIX) dsymv.$(SUFFIX) \
++ dsyr.$(SUFFIX) dsyr2.$(SUFFIX) dgbmv.$(SUFFIX) \
++ dsbmv.$(SUFFIX) dspmv.$(SUFFIX) \
++ dspr.$(SUFFIX) dspr2.$(SUFFIX) \
++ dtbsv.$(SUFFIX) dtbmv.$(SUFFIX) \
++ dtpsv.$(SUFFIX) dtpmv.$(SUFFIX)
++
++FDBLAS3OBJS = \
++ dgemm.$(SUFFIX) dsymm.$(SUFFIX) dtrmm.$(SUFFIX) \
++ dtrsm.$(SUFFIX) dsyrk.$(SUFFIX) dsyr2k.$(SUFFIX) \
++ domatcopy.$(SUFFIX) dimatcopy.$(SUFFIX)\
++ dgeadd.$(SUFFIX)
++
++FCBLAS1OBJS = \
++ caxpy.$(SUFFIX) caxpyc.$(SUFFIX) cswap.$(SUFFIX) \
++ ccopy.$(SUFFIX) cscal.$(SUFFIX) csscal.$(SUFFIX) \
++ cdotc.$(SUFFIX) cdotu.$(SUFFIX) \
++ scasum.$(SUFFIX) scnrm2.$(SUFFIX) \
++ scamax.$(SUFFIX) icamax.$(SUFFIX) \
++ scamin.$(SUFFIX) icamin.$(SUFFIX) \
++ csrot.$(SUFFIX) crotg.$(SUFFIX) \
++ caxpby.$(SUFFIX)
++
++FCBLAS2OBJS = \
++ cgemv.$(SUFFIX) cgeru.$(SUFFIX) cgerc.$(SUFFIX) \
++ ctrsv.$(SUFFIX) ctrmv.$(SUFFIX) \
++ csyr2.$(SUFFIX) cgbmv.$(SUFFIX) \
++ csbmv.$(SUFFIX) \
++ cspr2.$(SUFFIX) \
++ ctbsv.$(SUFFIX) ctbmv.$(SUFFIX) \
++ ctpsv.$(SUFFIX) ctpmv.$(SUFFIX) \
++ chemv.$(SUFFIX) chbmv.$(SUFFIX) \
++ cher.$(SUFFIX) cher2.$(SUFFIX) \
++ chpmv.$(SUFFIX) chpr.$(SUFFIX) chpr2.$(SUFFIX)
++
++FCBLAS3OBJS = \
++ cgemm.$(SUFFIX) csymm.$(SUFFIX) ctrmm.$(SUFFIX) \
++ ctrsm.$(SUFFIX) csyrk.$(SUFFIX) csyr2k.$(SUFFIX) \
++ chemm.$(SUFFIX) cherk.$(SUFFIX) cher2k.$(SUFFIX) \
++ comatcopy.$(SUFFIX) cimatcopy.$(SUFFIX)\
++ cgeadd.$(SUFFIX)
++
++FZBLAS1OBJS = \
++ zaxpy.$(SUFFIX) zaxpyc.$(SUFFIX) zswap.$(SUFFIX) \
++ zcopy.$(SUFFIX) zscal.$(SUFFIX) zdscal.$(SUFFIX) \
++ zdotc.$(SUFFIX) zdotu.$(SUFFIX) \
++ dzasum.$(SUFFIX) dznrm2.$(SUFFIX) \
++ dzamax.$(SUFFIX) izamax.$(SUFFIX) \
++ dzamin.$(SUFFIX) izamin.$(SUFFIX) \
++ zdrot.$(SUFFIX) zrotg.$(SUFFIX) \
++ zaxpby.$(SUFFIX)
++
++FZBLAS2OBJS = \
++ zgemv.$(SUFFIX) zgeru.$(SUFFIX) zgerc.$(SUFFIX) \
++ ztrsv.$(SUFFIX) ztrmv.$(SUFFIX) \
++ zsyr2.$(SUFFIX) zgbmv.$(SUFFIX) \
++ zsbmv.$(SUFFIX) \
++ zspr2.$(SUFFIX) \
++ ztbsv.$(SUFFIX) ztbmv.$(SUFFIX) \
++ ztpsv.$(SUFFIX) ztpmv.$(SUFFIX) \
++ zhemv.$(SUFFIX) zhbmv.$(SUFFIX) \
++ zher.$(SUFFIX) zher2.$(SUFFIX) \
++ zhpmv.$(SUFFIX) zhpr.$(SUFFIX) zhpr2.$(SUFFIX)
++
++FZBLAS3OBJS = \
++ zgemm.$(SUFFIX) zsymm.$(SUFFIX) ztrmm.$(SUFFIX) \
++ ztrsm.$(SUFFIX) zsyrk.$(SUFFIX) zsyr2k.$(SUFFIX) \
++ zhemm.$(SUFFIX) zherk.$(SUFFIX) zher2k.$(SUFFIX) \
++ zomatcopy.$(SUFFIX) zimatcopy.$(SUFFIX)\
++ zgeadd.$(SUFFIX)
++
++shared-blas-lapack: libblas.so.3 libcblas.so.3 liblapack.so.3
++
++# The list of prerequisite is created by comparing with NETLIB BLAS public API.
++# The symbol cblas_xerbla is missing here, but it does not seem to be provided
++# by libopenblas.so.0 either.
++libblas.so.3: $(FSBLAS1OBJS) $(FSBLAS2OBJS) $(FSBLAS3OBJS) $(FDBLAS1OBJS) $(FDBLAS2OBJS) $(FDBLAS3OBJS) $(FCBLAS1OBJS) $(FCBLAS2OBJS) $(FCBLAS3OBJS) $(FZBLAS1OBJS) $(FZBLAS2OBJS) $(FZBLAS3OBJS) ../kernel/lsame.o ../kernel/scabs1.o ../kernel/dcabs1.o ../driver/others/xerbla.o
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -Wl,-soname,libblas.so.3 -L.. -lopenblas $(EXTRALIB)
++
++libcblas.so.3: $(CSBLAS1OBJS) $(CSBLAS2OBJS) $(CSBLAS3OBJS) $(CDBLAS1OBJS) $(CDBLAS2OBJS) $(CDBLAS3OBJS) $(CCBLAS1OBJS) $(CCBLAS2OBJS) $(CCBLAS3OBJS) $(CZBLAS1OBJS) $(CZBLAS2OBJS) $(CZBLAS3OBJS) ../kernel/lsame.o ../kernel/scabs1.o ../kernel/dcabs1.o ../driver/others/xerbla.o
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -Wl,-soname,libcblas.so.3 -L.. -lopenblas $(EXTRALIB)
++
++liblapack.so.3: $(SLAPACKOBJS) $(DLAPACKOBJS) $(CLAPACKOBJS) $(ZLAPACKOBJS) ../kernel/lsame.o ../driver/others/xerbla.o
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ ../lapack-netlib/SRC/*.o -Wl,-soname,liblapack.so.3 -L.. -lopenblas $(EXTRALIB)
++
++clean::
++ rm -f libblas.so.3 libcblas.so.3 liblapack.so.3
diff --git a/sci-libs/openblas/metadata.xml b/sci-libs/openblas/metadata.xml
new file mode 100644
index 00000000000..a5e019212f0
--- /dev/null
+++ b/sci-libs/openblas/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci@gentoo.org</email>
+ <name>Gentoo Science Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.
+ </longdescription>
+ <use>
+ <flag name="dynamic">Build dynamic architecture detection at run time (for multi targets)</flag>
+ <flag name="pthread">Build with pthread threadding model</flag>
+ <flag name="serial">Build without multi-thraedding</flag>
+ <flag name="eselect-ldso">Enable BLAS/LAPACK runtime switching</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">xianyi/OpenBLAS</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-libs/openblas/openblas-0.3.5.ebuild b/sci-libs/openblas/openblas-0.3.5.ebuild
new file mode 100644
index 00000000000..b41803760ae
--- /dev/null
+++ b/sci-libs/openblas/openblas-0.3.5.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DESCRIPTION="Optimized BLAS library based on GotoBLAS2"
+HOMEPAGE="http://xianyi.github.com/OpenBLAS/"
+SRC_URI="https://github.com/xianyi/OpenBLAS/tarball/v${PV} -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="dynamic openmp pthread serial static-libs eselect-ldso"
+REQUIRED_USE="?? ( openmp pthread serial )"
+
+RDEPEND="
+>=app-eselect/eselect-blas-0.2
+>=app-eselect/eselect-lapack-0.2
+"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+PATCHES=( "${FILESDIR}/shared-blas-lapack.patch" )
+
+openblas_flags() {
+ local flags=()
+ use dynamic && \
+ flags+=( DYNAMIC_ARCH=1 TARGET=GENERIC NUM_THREADS=64 NO_AFFINITY=1 )
+ if use openmp; then
+ flags+=( USE_THREAD=1 USE_OPENMP=1 )
+ elif use pthread; then
+ flags+=( USE_THREAD=1 USE_OPENMP=0 )
+ else
+ flags+=( USE_THREAD=0 ) # serial
+ fi
+ flags+=( DESTDIR="${D}" PREFIX="${EPREFIX}/usr" )
+ flags+=( OPENBLAS_INCLUDE_DIR='$(PREFIX)'/include/${PN} )
+ flags+=( OPENBLAS_LIBRARY_DIR='$(PREFIX)'/$(get_libdir) )
+ echo "${flags[@]}"
+}
+
+src_unpack () {
+ default
+ find "${WORKDIR}" -maxdepth 1 -type d -name \*OpenBLAS\* && \
+ mv "${WORKDIR}"/*OpenBLAS* "${S}" || die
+}
+
+src_compile () {
+ emake $(openblas_flags)
+ emake -Cinterface shared-blas-lapack $(openblas_flags)
+}
+
+src_install () {
+ emake install $(openblas_flags)
+
+ if use eselect-ldso; then
+ dodir /usr/$(get_libdir)/blas/openblas/
+ insinto /usr/$(get_libdir)/blas/openblas/
+ doins interface/libblas.so.3
+ dosym libblas.so.3 usr/$(get_libdir)/blas/openblas/libblas.so
+ doins interface/libcblas.so.3
+ dosym libcblas.so.3 usr/$(get_libdir)/blas/openblas/libcblas.so
+
+ dodir /usr/$(get_libdir)/lapack/openblas/
+ insinto /usr/$(get_libdir)/lapack/openblas/
+ doins interface/liblapack.so.3
+ dosym liblapack.so.3 usr/$(get_libdir)/lapack/openblas/liblapack.so
+ fi
+}
+
+pkg_postinst () {
+ if use eselect-ldso; then
+ eselect blas add $(get_libdir) \
+ "${EROOT}"/usr/$(get_libdir)/blas/openblas openblas
+ eselect lapack add $(get_libdir) \
+ "${EROOT}"/usr/$(get_libdir)/lapack/openblas openblas
+ fi
+}
+
+pkg_postrm () {
+ if use eselect-ldso; then
+ eselect blas validate
+ eselect lapack validate
+ fi
+}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sci-libs/openblas/, sci-libs/openblas/files/
@ 2020-06-11 23:26 Michael Orlitzky
0 siblings, 0 replies; 6+ messages in thread
From: Michael Orlitzky @ 2020-06-11 23:26 UTC (permalink / raw
To: gentoo-commits
commit: 6926ff3a439ed76c74d1493cbe28ed3ddda5d952
Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 11 22:39:32 2020 +0000
Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Thu Jun 11 23:25:13 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6926ff3a
sci-libs/openblas: don't clobber FFLAGS while building lapack.
Nothing's ever easy, and bug 726474 is turning out to be no exception.
The problem goes deeper than I originally thought; this commit adds a
patch that prevents "rare and hard to reproduce crashes" when the user
has custom FFLAGS set. A new revision was made to force rebuilds in
case some user has mis-compiled the package.
https://bugs.gentoo.org/726474
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>
sci-libs/openblas/files/dont-clobber-fflags.patch | 31 ++++++++++++++++++++++
...nblas-0.3.9.ebuild => openblas-0.3.9-r1.ebuild} | 5 +++-
2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/sci-libs/openblas/files/dont-clobber-fflags.patch b/sci-libs/openblas/files/dont-clobber-fflags.patch
new file mode 100644
index 00000000000..21bbec4b1b3
--- /dev/null
+++ b/sci-libs/openblas/files/dont-clobber-fflags.patch
@@ -0,0 +1,31 @@
+From 05c96dad9b26cc1f00831661dc55139dcc9d5680 Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Thu, 11 Jun 2020 18:32:17 -0400
+Subject: [PATCH 1/1] Makefile: don't clobber fortran flags while building
+ lapack.
+
+When a user has the FFLAGS environment variable set, it clobbers the
+flags used to compile lapack. This can lead to "rare and hard to
+reproduce crashes" or test failures, as we have observed in Gentoo.
+
+Issue: https://github.com/xianyi/OpenBLAS/issues/2657
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index a22e16ba..2bae565e 100644
+--- a/Makefile
++++ b/Makefile
+@@ -248,7 +248,7 @@ prof_lapack : lapack_prebuild
+ lapack_prebuild :
+ ifeq ($(NOFORTRAN), $(filter 0,$(NOFORTRAN)))
+ -@echo "FC = $(FC)" > $(NETLIB_LAPACK_DIR)/make.inc
+- -@echo "FFLAGS = $(LAPACK_FFLAGS)" >> $(NETLIB_LAPACK_DIR)/make.inc
++ -@echo "override FFLAGS = $(LAPACK_FFLAGS)" >> $(NETLIB_LAPACK_DIR)/make.inc
+ -@echo "POPTS = $(LAPACK_FPFLAGS)" >> $(NETLIB_LAPACK_DIR)/make.inc
+ -@echo "FFLAGS_NOOPT = -O0 $(LAPACK_NOOPT)" >> $(NETLIB_LAPACK_DIR)/make.inc
+ -@echo "PNOOPT = $(LAPACK_FPFLAGS) -O0" >> $(NETLIB_LAPACK_DIR)/make.inc
+--
+2.26.2
+
diff --git a/sci-libs/openblas/openblas-0.3.9.ebuild b/sci-libs/openblas/openblas-0.3.9-r1.ebuild
similarity index 97%
rename from sci-libs/openblas/openblas-0.3.9.ebuild
rename to sci-libs/openblas/openblas-0.3.9-r1.ebuild
index 6427d994b30..c47011a3fa6 100644
--- a/sci-libs/openblas/openblas-0.3.9.ebuild
+++ b/sci-libs/openblas/openblas-0.3.9-r1.ebuild
@@ -22,7 +22,10 @@ RDEPEND="
DEPEND="virtual/pkgconfig"
-PATCHES=( "${FILESDIR}/shared-blas-lapack.patch" )
+PATCHES=(
+ "${FILESDIR}/shared-blas-lapack.patch"
+ "${FILESDIR}/dont-clobber-fflags.patch"
+)
pkg_setup() {
fortran-2_pkg_setup
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sci-libs/openblas/, sci-libs/openblas/files/
@ 2020-11-08 0:56 Sam James
0 siblings, 0 replies; 6+ messages in thread
From: Sam James @ 2020-11-08 0:56 UTC (permalink / raw
To: gentoo-commits
commit: 59a6f386a6aed06fde78eb6fdc48f31a0de520ca
Author: Aisha Tammy <gentoo <AT> aisha <DOT> cc>
AuthorDate: Sat Nov 7 11:24:41 2020 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Nov 8 00:56:12 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=59a6f386
sci-libs/openblas: fix libcblas soname
Closes: https://bugs.gentoo.org/753437
Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Aisha Tammy <gentoo <AT> aisha.cc>
Closes: https://github.com/gentoo/gentoo/pull/18171
Signed-off-by: Sam James <sam <AT> gentoo.org>
sci-libs/openblas/files/openblas-0.3.12-shared-blas-lapack.patch | 2 +-
sci-libs/openblas/{openblas-0.3.12.ebuild => openblas-0.3.12-r1.ebuild} | 0
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/sci-libs/openblas/files/openblas-0.3.12-shared-blas-lapack.patch b/sci-libs/openblas/files/openblas-0.3.12-shared-blas-lapack.patch
index 68a54cf1505..55fb7d7c66c 100644
--- a/sci-libs/openblas/files/openblas-0.3.12-shared-blas-lapack.patch
+++ b/sci-libs/openblas/files/openblas-0.3.12-shared-blas-lapack.patch
@@ -23,7 +23,7 @@ index 6b247b4..1297c73 100644
+ $(CC) $(LDFLAGS) -shared -o $@ $^ -Wl,-soname,libblas.so.3 -L.. -lopenblas $(EXTRALIB)
+
+libcblas.so.3: $(CSBLAS1OBJS) $(CSBLAS2OBJS) $(CSBLAS3OBJS) $(CDBLAS1OBJS) $(CDBLAS2OBJS) $(CDBLAS3OBJS) $(CCBLAS1OBJS) $(CCBLAS2OBJS) $(CCBLAS3OBJS) $(CZBLAS1OBJS) $(CZBLAS2OBJS) $(CZBLAS3OBJS) ../kernel/lsame.o ../kernel/scabs1.o ../kernel/dcabs1.o ../driver/others/xerbla.o
-+ $(CC) $(LDFLAGS) -shared -o $@ $^ -Wl,-soname,libblas.so.3 -L.. -lopenblas $(EXTRALIB)
++ $(CC) $(LDFLAGS) -shared -o $@ $^ -Wl,-soname,libcblas.so.3 -L.. -lopenblas $(EXTRALIB)
+
+# The prerequisites must match the symbols deleted in target delete-duplicate-lapack-objects
+liblapack.so.3: $(SLAPACKOBJS) $(DLAPACKOBJS) $(CLAPACKOBJS) $(ZLAPACKOBJS) ../kernel/lsame.o ../driver/others/xerbla.o
diff --git a/sci-libs/openblas/openblas-0.3.12.ebuild b/sci-libs/openblas/openblas-0.3.12-r1.ebuild
similarity index 100%
rename from sci-libs/openblas/openblas-0.3.12.ebuild
rename to sci-libs/openblas/openblas-0.3.12-r1.ebuild
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sci-libs/openblas/, sci-libs/openblas/files/
@ 2022-11-12 12:05 Michael Orlitzky
0 siblings, 0 replies; 6+ messages in thread
From: Michael Orlitzky @ 2022-11-12 12:05 UTC (permalink / raw
To: gentoo-commits
commit: 03f1689aa0d72075183bd999192a363994c41195
Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 12 11:53:59 2022 +0000
Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Sat Nov 12 12:05:19 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=03f1689a
sci-libs/openblas: add 0.3.21
I had to rebase the loongarch patch, and removed an old workaround for
FFLAGS="-fcheck=bounds" in the test suite, but other than that a
standard update.
Bug: https://bugs.gentoo.org/726474
Closes: https://bugs.gentoo.org/878883
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>
sci-libs/openblas/Manifest | 1 +
.../openblas/files/openblas-0.3.21-fix-loong.patch | 237 +++++++++++++++++++++
sci-libs/openblas/openblas-0.3.21.ebuild | 196 +++++++++++++++++
3 files changed, 434 insertions(+)
diff --git a/sci-libs/openblas/Manifest b/sci-libs/openblas/Manifest
index 7f5369e57040..95fc46d6f9d5 100644
--- a/sci-libs/openblas/Manifest
+++ b/sci-libs/openblas/Manifest
@@ -1,3 +1,4 @@
DIST openblas-0.3.18.tar.gz 12619822 BLAKE2B 38a5e7b861eb0063a4494c1cfb6f7f5723741437ecdd5cb1fb42645eb73bceb472b3a8c11eec3d0ba4f676981ac89de4ff1ee0d7ea42d1e234746f34ce8fb6b8 SHA512 df9a14026a61bdc5285636bfd7a52dce244d24fcf4a0c870ef4e58b8b50e412849828ca5aeac2a2435f635e78e60559762e8bae22ea7bc5dff2e865a96d81152
DIST openblas-0.3.19.tar.gz 12706050 BLAKE2B c29aa27faaf18e3330087f8d2ebed733f53878266d6865239dfbb1624a113f3cabc988bbfcc18a0aa5d971697bc68bb267795ef24e2d8e0e8d50f802cb817b57 SHA512 1fcbcfefb7744894b0b0c83c6071b342086ca311dc67f5c2745812d61dcc9d31ef7dd5e1215dfb2731ae7197d497dbdf8f8b26a432eb07d41a7db0983eb86a33
DIST openblas-0.3.20.tar.gz 12742441 BLAKE2B 9ae808e2a7da39e28dbe26c7feb5da3c70275f3b48bd68455c22e3b16fc1f2d10b9d84c9593acff2c837fc1514f21f2bbc0e87708075c5fe13514d0d47cf0b5a SHA512 0742d40b74b11b781021280fd627fa5798e6856b49f2ba1111a5927aac1a7823bcb8162187555f4cf3a4dd7eadf5b1f2a4685c0b5e189847b2869166d1bc7391
+DIST openblas-0.3.21.tar.gz 23729571 BLAKE2B 678bfb13ead69045e7d4d840bbcaed884d9ebedded5425cfa1f55e3d85bda31a3eb43dbbf9f07099d0d198f97ae68ef3b3b2b78aa1bd5b4999dd729dc08f7e28 SHA512 4625c8e6ccfa9120281fd714d3f6b7c3ba2265470c1be76121d6b25dc3dacb899d26e5d9a417ddc616d23909f1411495aa995ef8d8d6df8511cd5cefbabcb1c5
diff --git a/sci-libs/openblas/files/openblas-0.3.21-fix-loong.patch b/sci-libs/openblas/files/openblas-0.3.21-fix-loong.patch
new file mode 100644
index 000000000000..ed112d62380b
--- /dev/null
+++ b/sci-libs/openblas/files/openblas-0.3.21-fix-loong.patch
@@ -0,0 +1,237 @@
+https://github.com/xianyi/OpenBLAS/pull/3626
+
+From 5af7b8638b3b972bd0e25597ec07927fffd52108 Mon Sep 17 00:00:00 2001
+From: WANG Xuerui <xen0n@gentoo.org>
+Date: Fri, 13 May 2022 15:26:33 +0800
+Subject: [PATCH 1/3] Move LoongArch make rules to Makefile.loongarch64
+
+---
+ Makefile.loongarch64 | 5 +++--
+ Makefile.system | 5 -----
+ 2 files changed, 3 insertions(+), 7 deletions(-)
+
+diff --git a/Makefile.loongarch64 b/Makefile.loongarch64
+index 05ea9c679d..fced1a9462 100644
+--- a/Makefile.loongarch64
++++ b/Makefile.loongarch64
+@@ -1,3 +1,4 @@
+-ifdef BINARY64
+-else
++ifeq ($(CORE), LOONGSON3R5)
++CCOMMON_OPT += -march=loongarch64 -mabi=lp64
++FCOMMON_OPT += -march=loongarch64 -mabi=lp64
+ endif
+diff --git a/Makefile.system b/Makefile.system
+index 3be5efa0c2..9c91425b0f 100644
+--- a/Makefile.system
++++ b/Makefile.system
+@@ -895,11 +895,6 @@ ifeq ($(OSNAME), AIX)
+ BINARY_DEFINED = 1
+ endif
+
+-ifeq ($(ARCH), loongarch64)
+-CCOMMON_OPT += -march=loongarch64 -mabi=lp64
+-FCOMMON_OPT += -march=loongarch64 -mabi=lp64
+-endif
+-
+ endif
+
+ ifndef BINARY_DEFINED
+
+From 869061c783d60ba0b799fab643952c493b57fb0a Mon Sep 17 00:00:00 2001
+From: WANG Xuerui <xen0n@gentoo.org>
+Date: Fri, 13 May 2022 15:53:22 +0800
+Subject: [PATCH 2/3] Probe for old-world LASX flavor on LoongArch and use
+ generic DGEMM kernel otherwise
+
+See: https://bugs.gentoo.org/844013
+---
+ Makefile.system | 1 +
+ c_check | 27 ++++++++++++++++++++++++++-
+ kernel/loongarch64/KERNEL.LOONGSON3R5 | 5 +++++
+ 3 files changed, 32 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.system b/Makefile.system
+index 9c91425b0f..b86aafbddb 100644
+--- a/Makefile.system
++++ b/Makefile.system
+@@ -1702,6 +1702,7 @@ export TARGET_CORE
+ export NO_AVX512
+ export NO_AVX2
+ export BUILD_BFLOAT16
++export NO_LASX
+
+ export SBGEMM_UNROLL_M
+ export SBGEMM_UNROLL_N
+diff --git a/c_check b/c_check
+index 01d4f4a7cf..a37e91f82c 100755
+--- a/c_check
++++ b/c_check
+@@ -112,7 +112,7 @@ case "$architecture" in
+ defined=1
+ ;;
+ arm|arm64) defined=1 ;;
+- zarch|e2k|alpha|ia64|riscv64|loonarch64)
++ zarch|e2k|alpha|ia64|riscv64|loongarch64)
+ defined=1
+ BINARY=64
+ ;;
+@@ -240,6 +240,29 @@ if [ "$architecture" = "riscv64" ]; then
+ rm -rf "$tmpd"
+ fi
+
++no_lasx=0
++if [ "$architecture" = "loongarch64" ]; then
++ tmpd=`mktemp -d`
++ tmpf="$tmpd/a.c"
++ # Old-world assembly flavor: LASX registers named "$xrNN", different
++ # from the ISA manual which suggests "$xNN". This is the flavor we
++ # currently support.
++ #
++ # As the LASX ISA manual is not out yet, we cannot predict what the
++ # new-world flavor would look like, so do not probe flavor for now.
++ # The compiler flags are also unsuitable for new-world gcc.
++ code='"xvld $xr0, $a0, 0\n"'
++ printf "int main(void){ __asm__ volatile(%s); }\n" "$code" >> "$tmpf"
++ args=" -march=loongarch64 -mabi=lp64 -mlasx -c -o $tmpf.o $tmpf"
++ no_lasx=0
++ {
++ $compiler_name $flags $args >/dev/null 2>&1
++ } || {
++ no_lasx=1
++ }
++ rm -rf "$tmpd"
++fi
++
+ c11_atomics=0
+ case "$data" in
+ *HAVE_C11*)
+@@ -350,6 +373,7 @@ done
+
+ [ "$makefile" = "-" ] && {
+ [ "$no_rv64gv" -eq 1 ] && printf "NO_RV64GV=1\n"
++ [ "$no_lasx" -eq 1 ] && printf "NO_LASX=1\n"
+ [ "$no_avx512" -eq 1 ] && printf "NO_AVX512=1\n"
+ [ "$no_avx2" -eq 1 ] && printf "NO_AVX2=1\n"
+ [ "$oldgcc" -eq 1 ] && printf "OLDGCC=1\n"
+@@ -380,6 +404,7 @@ done
+ printf "MSA_FLAGS=%s\n" "$msa_flags"
+ }
+ [ "$no_rv64gv" -eq 1 ] && printf "NO_RV64GV=1\n"
++ [ "$no_lasx" -eq 1 ] && printf "NO_LASX=1\n"
+ [ "$no_avx512" -eq 1 ] && printf "NO_AVX512=1\n"
+ [ "$no_avx2" -eq 1 ] && printf "NO_AVX2=1\n"
+ [ "$oldgcc" -eq 1 ] && printf "OLDGCC=1\n"
+diff --git a/kernel/loongarch64/KERNEL.LOONGSON3R5 b/kernel/loongarch64/KERNEL.LOONGSON3R5
+index cda3590402..79b57d1e4d 100644
+--- a/kernel/loongarch64/KERNEL.LOONGSON3R5
++++ b/kernel/loongarch64/KERNEL.LOONGSON3R5
+@@ -1,3 +1,7 @@
++ifeq ($(NO_LASX), 1)
++# No LASX support in compiler, unable to consume the optimized version
++# leave out DGEMMKERNEL to pull in the generic version
++else
+ DGEMMKERNEL = dgemm_kernel_16x4.S
+ DGEMMINCOPY = dgemm_ncopy_16.S
+ DGEMMITCOPY = dgemm_tcopy_16.S
+@@ -7,6 +11,7 @@ DGEMMINCOPYOBJ = dgemm_incopy$(TSUFFIX).$(SUFFIX)
+ DGEMMITCOPYOBJ = dgemm_itcopy$(TSUFFIX).$(SUFFIX)
+ DGEMMONCOPYOBJ = dgemm_oncopy$(TSUFFIX).$(SUFFIX)
+ DGEMMOTCOPYOBJ = dgemm_otcopy$(TSUFFIX).$(SUFFIX)
++endif
+
+ DTRSMKERNEL_LN = ../generic/trsm_kernel_LN.c
+ DTRSMKERNEL_LT = ../generic/trsm_kernel_LT.c
+
+From 699c57d3767c9a5a5a69262a4b70a1f80e0bb2e2 Mon Sep 17 00:00:00 2001
+From: WANG Xuerui <xen0n@gentoo.org>
+Date: Fri, 13 May 2022 16:23:46 +0800
+Subject: [PATCH 3/3] Fix ABI CFLAGS setting on new-world LoongArch
+
+See: https://bugs.gentoo.org/844013
+---
+ Makefile.loongarch64 | 13 +++++++++++--
+ Makefile.system | 1 +
+ c_check | 14 ++++++++++++++
+ 3 files changed, 26 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.loongarch64 b/Makefile.loongarch64
+index fced1a9462..d6cbe848cd 100644
+--- a/Makefile.loongarch64
++++ b/Makefile.loongarch64
+@@ -1,4 +1,13 @@
+ ifeq ($(CORE), LOONGSON3R5)
+-CCOMMON_OPT += -march=loongarch64 -mabi=lp64
+-FCOMMON_OPT += -march=loongarch64 -mabi=lp64
++CCOMMON_OPT += -march=loongarch64
++FCOMMON_OPT += -march=loongarch64
++
++ifeq ($(LOONGARCH_CC_FLAVOR), NEW)
++CCOMMON_OPT += -mabi=lp64d
++FCOMMON_OPT += -mabi=lp64d
++endif
++ifeq ($(LOONGARCH_CC_FLAVOR), OLD)
++CCOMMON_OPT += -mabi=lp64
++FCOMMON_OPT += -mabi=lp64
++endif
+ endif
+diff --git a/Makefile.system b/Makefile.system
+index b86aafbddb..4360a861cb 100644
+--- a/Makefile.system
++++ b/Makefile.system
+@@ -1702,6 +1702,7 @@ export TARGET_CORE
+ export NO_AVX512
+ export NO_AVX2
+ export BUILD_BFLOAT16
++export LOONGARCH_CC_FLAVOR
+ export NO_LASX
+
+ export SBGEMM_UNROLL_M
+diff --git a/c_check b/c_check
+index a37e91f82c..573f0e52fd 100755
+--- a/c_check
++++ b/c_check
+@@ -240,8 +240,19 @@ if [ "$architecture" = "riscv64" ]; then
+ rm -rf "$tmpd"
+ fi
+
++loongarch_cc_flavor=""
+ no_lasx=0
+ if [ "$architecture" = "loongarch64" ]; then
++ # Currently there are only 2 flavors: new-world and old-world.
++ # They differ in ABI names accepted, so check it to avoid creating temp
++ # files.
++ loongarch_cc_flavor="NEW"
++ {
++ $compiler_name -mabi=lp64d -E -o - /dev/null >/dev/null 2>&1
++ } || {
++ loongarch_cc_flavor="OLD"
++ }
++
+ tmpd=`mktemp -d`
+ tmpf="$tmpd/a.c"
+ # Old-world assembly flavor: LASX registers named "$xrNN", different
+@@ -260,6 +271,7 @@ if [ "$architecture" = "loongarch64" ]; then
+ } || {
+ no_lasx=1
+ }
++
+ rm -rf "$tmpd"
+ fi
+
+@@ -377,6 +389,7 @@ done
+ [ "$no_avx512" -eq 1 ] && printf "NO_AVX512=1\n"
+ [ "$no_avx2" -eq 1 ] && printf "NO_AVX2=1\n"
+ [ "$oldgcc" -eq 1 ] && printf "OLDGCC=1\n"
++ [ -n "$loongarch_cc_flavor" ] && printf "LOONGARCH_CC_FLAVOR=%s\n" "$loongarch_cc_flavor"
+ exit 0
+ }
+
+@@ -408,6 +421,7 @@ done
+ [ "$no_avx512" -eq 1 ] && printf "NO_AVX512=1\n"
+ [ "$no_avx2" -eq 1 ] && printf "NO_AVX2=1\n"
+ [ "$oldgcc" -eq 1 ] && printf "OLDGCC=1\n"
++ [ -n "$loongarch_cc_flavor" ] && printf "LOONGARCH_CC_FLAVOR=%s\n" "$loongarch_cc_flavor"
+ } >> "$makefile"
+
+ os=`echo "$os" | tr '[[:lower:]]' '[[:upper:]]'/ `
diff --git a/sci-libs/openblas/openblas-0.3.21.ebuild b/sci-libs/openblas/openblas-0.3.21.ebuild
new file mode 100644
index 000000000000..8684438c1a7a
--- /dev/null
+++ b/sci-libs/openblas/openblas-0.3.21.ebuild
@@ -0,0 +1,196 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit fortran-2 toolchain-funcs
+
+DESCRIPTION="Optimized BLAS library based on GotoBLAS2"
+HOMEPAGE="https://github.com/xianyi/OpenBLAS"
+SRC_URI="https://github.com/xianyi/OpenBLAS/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}"/OpenBLAS-${PV}
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~riscv ~x86 ~amd64-linux ~x86-linux ~x64-macos"
+IUSE="dynamic eselect-ldso index-64bit openmp pthread relapack test"
+REQUIRED_USE="?? ( openmp pthread )"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ eselect-ldso? (
+ >=app-eselect/eselect-blas-0.2
+ >=app-eselect/eselect-lapack-0.2
+ )
+"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-0.3.12-shared-blas-lapack.patch"
+ "${FILESDIR}/${PN}-0.3.21-fix-loong.patch"
+)
+
+pkg_pretend() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+
+ elog "This software has a massive number of options that"
+ elog "are configurable and it is *impossible* for all of"
+ elog "those to fit inside any manageable ebuild."
+ elog "The Gentoo provided package has enough to build"
+ elog "a fully optimized library for your targeted CPU."
+ elog "You can set the CPU target using the environment"
+ elog "variable - OPENBLAS_TARGET or it will be detected"
+ elog "automatically from the target toolchain (supports"
+ elog "cross compilation toolchains)."
+ elog "You can control the maximum number of threads"
+ elog "using OPENBLAS_NTHREAD, default=64 and number of "
+ elog "parallel calls to allow before further calls wait"
+ elog "using OPENBLAS_NPARALLEL, default=8."
+}
+
+pkg_setup() {
+ fortran-2_pkg_setup
+
+ # List of most configurable options - Makefile.rule
+
+ # https://github.com/xianyi/OpenBLAS/pull/2663
+ tc-export CC FC LD AR AS RANLIB
+
+ # HOSTCC is used for scripting
+ export HOSTCC="$(tc-getBUILD_CC)"
+
+ # threading options
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+ USE_THREAD=0
+ if use openmp; then
+ USE_THREAD=1; USE_OPENMP=1;
+ elif use pthread; then
+ USE_THREAD=1; USE_OPENMP=0;
+ fi
+ export USE_THREAD USE_OPENMP
+
+ # disable submake with -j and default optimization flags
+ # in Makefile.system
+ # Makefile.rule says to not modify COMMON_OPT/FCOMMON_OPT...
+ export MAKE_NB_JOBS=-1 \
+ COMMON_OPT=" " \
+ FCOMMON_OPT=" "
+
+ # Target CPU ARCH options
+ # generally detected automatically from cross toolchain
+ use dynamic && \
+ export DYNAMIC_ARCH=1 \
+ NO_AFFINITY=1 \
+ TARGET=GENERIC
+
+ export NUM_PARALLEL=${OPENBLAS_NPARALLEL:-8} \
+ NUM_THREADS=${OPENBLAS_NTHREAD:-64}
+
+ # setting OPENBLAS_TARGET to override auto detection
+ # in case the toolchain is not enough to detect
+ # https://github.com/xianyi/OpenBLAS/blob/develop/TargetList.txt
+ if ! use dynamic && [[ ! -z "${OPENBLAS_TARGET}" ]] ; then
+ export TARGET="${OPENBLAS_TARGET}"
+ fi
+
+ export NO_STATIC=1
+
+ BUILD_RELAPACK=1
+ if ! use relapack; then
+ BUILD_RELAPACK=0
+ fi
+
+ export PREFIX="${EPREFIX}/usr" BUILD_RELAPACK
+}
+
+src_prepare() {
+ default
+
+ # Don't build the tests as part of "make all". We'll do
+ # it explicitly later if the test phase is enabled.
+ sed -e "/^all ::/s/tests //" -i Makefile || die
+
+ # if 64bit-index is needed, create second library
+ # with LIBPREFIX=libopenblas64
+ if use index-64bit; then
+ cp -aL "${S}" "${S}-index-64bit" || die
+ fi
+}
+
+src_compile() {
+ default
+ cd interface || die
+ emake shared-blas-lapack
+
+ if use index-64bit; then
+ emake -C"${S}-index-64bit" \
+ INTERFACE64=1 \
+ LIBPREFIX=libopenblas64
+ fi
+}
+
+src_test() {
+ emake tests
+}
+
+src_install() {
+ emake install DESTDIR="${D}" \
+ OPENBLAS_INCLUDE_DIR='$(PREFIX)'/include/${PN} \
+ OPENBLAS_LIBRARY_DIR='$(PREFIX)'/$(get_libdir)
+
+ dodoc GotoBLAS_*.txt *.md Changelog.txt
+
+ if use index-64bit; then
+ dolib.so "${S}-index-64bit"/libopenblas64*.so*
+ fi
+
+ if use eselect-ldso; then
+ insinto /usr/$(get_libdir)/blas/openblas/
+ doins interface/libblas.so.3
+ dosym libblas.so.3 usr/$(get_libdir)/blas/openblas/libblas.so
+ doins interface/libcblas.so.3
+ dosym libcblas.so.3 usr/$(get_libdir)/blas/openblas/libcblas.so
+
+ insinto /usr/$(get_libdir)/lapack/openblas/
+ doins interface/liblapack.so.3
+ dosym liblapack.so.3 usr/$(get_libdir)/lapack/openblas/liblapack.so
+ doins interface/liblapacke.so.3
+ dosym liblapacke.so.3 usr/$(get_libdir)/lapack/openblas/liblapacke.so
+ fi
+}
+
+pkg_postinst() {
+ use eselect-ldso || return
+ local libdir=$(get_libdir) me="openblas"
+
+ # check blas
+ eselect blas add ${libdir} "${EROOT}"/usr/${libdir}/blas/${me} ${me}
+ local current_blas=$(eselect blas show ${libdir} | cut -d' ' -f2)
+ if [[ ${current_blas} == "${me}" || -z ${current_blas} ]]; then
+ eselect blas set ${libdir} ${me}
+ elog "Current eselect: BLAS/CBLAS ($libdir) -> [${current_blas}]."
+ else
+ elog "Current eselect: BLAS/CBLAS ($libdir) -> [${current_blas}]."
+ elog "To use blas [${me}] implementation, you have to issue (as root):"
+ elog "\t eselect blas set ${libdir} ${me}"
+ fi
+
+ # check lapack
+ eselect lapack add ${libdir} "${EROOT}"/usr/${libdir}/lapack/${me} ${me}
+ local current_lapack=$(eselect lapack show ${libdir} | cut -d' ' -f2)
+ if [[ ${current_lapack} == "${me}" || -z ${current_lapack} ]]; then
+ eselect lapack set ${libdir} ${me}
+ elog "Current eselect: LAPACK ($libdir) -> [${current_lapack}]."
+ else
+ elog "Current eselect: LAPACK ($libdir) -> [${current_lapack}]."
+ elog "To use lapack [${me}] implementation, you have to issue (as root):"
+ elog "\t eselect lapack set ${libdir} ${me}"
+ fi
+}
+
+pkg_postrm() {
+ if use eselect-ldso; then
+ eselect blas validate
+ eselect lapack validate
+ fi
+}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sci-libs/openblas/, sci-libs/openblas/files/
@ 2022-11-22 23:42 Sam James
0 siblings, 0 replies; 6+ messages in thread
From: Sam James @ 2022-11-22 23:42 UTC (permalink / raw
To: gentoo-commits
commit: 8cc06c76d23108166460e051d7ac5d20ab0b9666
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 22 23:41:25 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Nov 22 23:41:25 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8cc06c76
sci-libs/openblas: fix build w/ clang 16
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../openblas/files/openblas-0.3.21-clang16.patch | 581 +++++++++++++++++++++
sci-libs/openblas/openblas-0.3.21-r1.ebuild | 197 +++++++
2 files changed, 778 insertions(+)
diff --git a/sci-libs/openblas/files/openblas-0.3.21-clang16.patch b/sci-libs/openblas/files/openblas-0.3.21-clang16.patch
new file mode 100644
index 000000000000..051966b0a870
--- /dev/null
+++ b/sci-libs/openblas/files/openblas-0.3.21-clang16.patch
@@ -0,0 +1,581 @@
+https://github.com/xianyi/OpenBLAS/commit/f703846ad9400a8ea175cb8dd43e18c152aeab93
+https://github.com/xianyi/OpenBLAS/commit/515cf269291bec0d43651fe7bf99a71fb074a0ad
+https://github.com/xianyi/OpenBLAS/commit/91110f92d218492d0efbdc1fdf34277ca45f4b36
+https://github.com/xianyi/OpenBLAS/commit/9402df5604e69f86f58953e3883f33f98c930baf
+https://github.com/xianyi/OpenBLAS/commit/101a2c77c3f3610933f450cefca3e312edab2186
+https://src.fedoraproject.org/rpms/openblas/c/5f27d51cebe1c1bb6598d38326ece8dc0ac71ec7?branch=rawhide
+
+From f703846ad9400a8ea175cb8dd43e18c152aeab93 Mon Sep 17 00:00:00 2001
+From: Martin Kroeker <martin@ruby.chemie.uni-freiburg.de>
+Date: Sat, 13 Aug 2022 11:38:27 +0200
+Subject: [PATCH] Add function prototypes
+
+--- a/exports/gensymbol
++++ b/exports/gensymbol
+@@ -4000,6 +4000,22 @@ case "$p1" in
+ no_underscore_objs="$no_underscore_objs $misc_common_objs"
+
+ printf 'int main(void){\n'
++ for obj in $underscore_objs; do
++ [ "$obj" != "xerbla" ] && printf 'extern void %s%s%s%s();\n' \
++ "$symbolprefix" "$obj" "$bu" "$symbolsuffix"
++ done
++
++ for obj in $need_2underscore_objs; do
++ printf 'extern void %s%s%s%s%s();\n' \
++ "$symbolprefix" "$obj" "$bu" "$bu" "$symbolsuffix"
++ done
++
++ for obj in $no_underscore_objs; do
++ printf 'extern void %s%s%s();\n' \
++ "$symbolprefix" "$obj" "$symbolsuffix"
++ done
++
++ printf '\n'
+ for obj in $underscore_objs; do
+ [ "$obj" != "xerbla" ] && printf '%s%s%s%s();\n' \
+ "$symbolprefix" "$obj" "$bu" "$symbolsuffix"
+--- a/exports/gensymbol.pl
++++ b/exports/gensymbol.pl
+@@ -3955,6 +3955,18 @@
+ @no_underscore_objs = (@no_underscore_objs, @misc_common_objs);
+
+ print "int main(void){\n";
++ foreach $objs (@underscore_objs) {
++ print "extern void ", $symbolprefix, $objs, $bu, $symbolsuffix, "();\n" if $objs ne "xerbla";
++ }
++
++ foreach $objs (@need_2underscore_objs) {
++ print "extern void ", $symbolprefix, $objs, $bu, $bu, $symbolsuffix, "();\n";
++ }
++
++ foreach $objs (@no_underscore_objs) {
++ print "extern void ", $symbolprefix, $objs, $symbolsuffix, "();\n";
++ }
++
+ foreach $objs (@underscore_objs) {
+ print $symbolprefix, $objs, $bu, $symbolsuffix, "();\n" if $objs ne "xerbla";
+ }
+
+From 515cf269291bec0d43651fe7bf99a71fb074a0ad Mon Sep 17 00:00:00 2001
+From: Martin Kroeker <martin@ruby.chemie.uni-freiburg.de>
+Date: Wed, 14 Sep 2022 11:48:36 +0200
+Subject: [PATCH] Fix pointer/integer argument mismatch in calls to pow()
+
+--- a/lapack-netlib/SRC/claed0.c
++++ b/lapack-netlib/SRC/claed0.c
+@@ -796,10 +796,10 @@ f"> */
+
+ temp = log((real) (*n)) / log(2.f);
+ lgn = (integer) temp;
+- if (pow_ii(&c__2, &lgn) < *n) {
++ if (pow_ii(c__2, lgn) < *n) {
+ ++lgn;
+ }
+- if (pow_ii(&c__2, &lgn) < *n) {
++ if (pow_ii(c__2, lgn) < *n) {
+ ++lgn;
+ }
+ iprmpt = indxq + *n + 1;
+--- a/lapack-netlib/SRC/claed7.c
++++ b/lapack-netlib/SRC/claed7.c
+@@ -864,11 +864,11 @@ f"> */
+ /* Form the z-vector which consists of the last row of Q_1 and the */
+ /* first row of Q_2. */
+
+- ptr = pow_ii(&c__2, tlvls) + 1;
++ ptr = pow_ii(c__2, *tlvls) + 1;
+ i__1 = *curlvl - 1;
+ for (i__ = 1; i__ <= i__1; ++i__) {
+ i__2 = *tlvls - i__;
+- ptr += pow_ii(&c__2, &i__2);
++ ptr += pow_ii(c__2, i__2);
+ /* L10: */
+ }
+ curr = ptr + *curpbm;
+--- a/lapack-netlib/SRC/clalsa.c
++++ b/lapack-netlib/SRC/clalsa.c
+@@ -1051,7 +1051,7 @@ f"> */
+ /* Finally go through the left singular vector matrices of all */
+ /* the other subproblems bottom-up on the tree. */
+
+- j = pow_ii(&c__2, &nlvl);
++ j = pow_ii(c__2, nlvl);
+ sqre = 0;
+
+ for (lvl = nlvl; lvl >= 1; --lvl) {
+@@ -1065,7 +1065,7 @@ f"> */
+ ll = 1;
+ } else {
+ i__1 = lvl - 1;
+- lf = pow_ii(&c__2, &i__1);
++ lf = pow_ii(c__2, i__1);
+ ll = (lf << 1) - 1;
+ }
+ i__1 = ll;
+@@ -1110,7 +1110,7 @@ f"> */
+ ll = 1;
+ } else {
+ i__2 = lvl - 1;
+- lf = pow_ii(&c__2, &i__2);
++ lf = pow_ii(c__2, i__2);
+ ll = (lf << 1) - 1;
+ }
+ i__2 = lf;
+--- a/lapack-netlib/SRC/cstedc.c
++++ b/lapack-netlib/SRC/cstedc.c
+@@ -836,10 +836,10 @@ f"> */
+ lrwmin = *n - 1 << 1;
+ } else if (icompz == 1) {
+ lgn = (integer) (log((real) (*n)) / log(2.f));
+- if (pow_ii(&c__2, &lgn) < *n) {
++ if (pow_ii(c__2, lgn) < *n) {
+ ++lgn;
+ }
+- if (pow_ii(&c__2, &lgn) < *n) {
++ if (pow_ii(c__2, lgn) < *n) {
+ ++lgn;
+ }
+ lwmin = *n * *n;
+--- a/lapack-netlib/SRC/dlaed0.c
++++ b/lapack-netlib/SRC/dlaed0.c
+@@ -827,10 +827,10 @@ f"> */
+
+ temp = log((doublereal) (*n)) / log(2.);
+ lgn = (integer) temp;
+- if (pow_ii(&c__2, &lgn) < *n) {
++ if (pow_ii(c__2, lgn) < *n) {
+ ++lgn;
+ }
+- if (pow_ii(&c__2, &lgn) < *n) {
++ if (pow_ii(c__2, lgn) < *n) {
+ ++lgn;
+ }
+ iprmpt = indxq + *n + 1;
+--- a/lapack-netlib/SRC/dlaed7.c
++++ b/lapack-netlib/SRC/dlaed7.c
+@@ -885,11 +885,11 @@ f"> */
+ /* Form the z-vector which consists of the last row of Q_1 and the */
+ /* first row of Q_2. */
+
+- ptr = pow_ii(&c__2, tlvls) + 1;
++ ptr = pow_ii(c__2, *tlvls) + 1;
+ i__1 = *curlvl - 1;
+ for (i__ = 1; i__ <= i__1; ++i__) {
+ i__2 = *tlvls - i__;
+- ptr += pow_ii(&c__2, &i__2);
++ ptr += pow_ii(c__2, i__2);
+ /* L10: */
+ }
+ curr = ptr + *curpbm;
+--- a/lapack-netlib/SRC/dlaeda.c
++++ b/lapack-netlib/SRC/dlaeda.c
+@@ -754,7 +754,7 @@ f"> */
+ /* scheme */
+
+ i__1 = *curlvl - 1;
+- curr = ptr + *curpbm * pow_ii(&c__2, curlvl) + pow_ii(&c__2, &i__1) - 1;
++ curr = ptr + *curpbm * pow_ii(c__2, *curlvl) + pow_ii(c__2, i__1) - 1;
+
+ /* Determine size of these matrices. We add HALF to the value of */
+ /* the SQRT in case the machine underestimates one of these square */
+@@ -781,12 +781,12 @@ f"> */
+ /* rotations and permutation and then multiplying the center matrices */
+ /* against the current Z. */
+
+- ptr = pow_ii(&c__2, tlvls) + 1;
++ ptr = pow_ii(c__2, *tlvls) + 1;
+ i__1 = *curlvl - 1;
+ for (k = 1; k <= i__1; ++k) {
+ i__2 = *curlvl - k;
+ i__3 = *curlvl - k - 1;
+- curr = ptr + *curpbm * pow_ii(&c__2, &i__2) + pow_ii(&c__2, &i__3) -
++ curr = ptr + *curpbm * pow_ii(c__2, i__2) + pow_ii(c__2, i__3) -
+ 1;
+ psiz1 = prmptr[curr + 1] - prmptr[curr];
+ psiz2 = prmptr[curr + 2] - prmptr[curr + 1];
+@@ -847,7 +847,7 @@ f"> */
+ c__1);
+
+ i__2 = *tlvls - k;
+- ptr += pow_ii(&c__2, &i__2);
++ ptr += pow_ii(c__2, i__2);
+ /* L70: */
+ }
+
+--- a/lapack-netlib/SRC/dlalsa.c
++++ b/lapack-netlib/SRC/dlalsa.c
+@@ -951,7 +951,7 @@ f"> */
+ /* Finally go through the left singular vector matrices of all */
+ /* the other subproblems bottom-up on the tree. */
+
+- j = pow_ii(&c__2, &nlvl);
++ j = pow_ii(c__2, nlvl);
+ sqre = 0;
+
+ for (lvl = nlvl; lvl >= 1; --lvl) {
+@@ -965,7 +965,7 @@ f"> */
+ ll = 1;
+ } else {
+ i__1 = lvl - 1;
+- lf = pow_ii(&c__2, &i__1);
++ lf = pow_ii(c__2, i__1);
+ ll = (lf << 1) - 1;
+ }
+ i__1 = ll;
+@@ -1010,7 +1010,7 @@ f"> */
+ ll = 1;
+ } else {
+ i__2 = lvl - 1;
+- lf = pow_ii(&c__2, &i__2);
++ lf = pow_ii(c__2, i__2);
+ ll = (lf << 1) - 1;
+ }
+ i__2 = lf;
+--- a/lapack-netlib/SRC/dlasd0.c
++++ b/lapack-netlib/SRC/dlasd0.c
+@@ -824,7 +824,7 @@ f"> */
+ ll = 1;
+ } else {
+ i__1 = lvl - 1;
+- lf = pow_ii(&c__2, &i__1);
++ lf = pow_ii(c__2, i__1);
+ ll = (lf << 1) - 1;
+ }
+ i__1 = ll;
+--- a/lapack-netlib/SRC/dlasda.c
++++ b/lapack-netlib/SRC/dlasda.c
+@@ -1027,7 +1027,7 @@ f"> */
+
+ /* Now conquer each subproblem bottom-up. */
+
+- j = pow_ii(&c__2, &nlvl);
++ j = pow_ii(c__2, nlvl);
+ for (lvl = nlvl; lvl >= 1; --lvl) {
+ lvl2 = (lvl << 1) - 1;
+
+@@ -1039,7 +1039,7 @@ f"> */
+ ll = 1;
+ } else {
+ i__1 = lvl - 1;
+- lf = pow_ii(&c__2, &i__1);
++ lf = pow_ii(c__2, i__1);
+ ll = (lf << 1) - 1;
+ }
+ i__1 = ll;
+--- a/lapack-netlib/SRC/dstedc.c
++++ b/lapack-netlib/SRC/dstedc.c
+@@ -806,10 +806,10 @@ f"> */
+ lwmin = *n - 1 << 1;
+ } else {
+ lgn = (integer) (log((doublereal) (*n)) / log(2.));
+- if (pow_ii(&c__2, &lgn) < *n) {
++ if (pow_ii(c__2, lgn) < *n) {
+ ++lgn;
+ }
+- if (pow_ii(&c__2, &lgn) < *n) {
++ if (pow_ii(c__2, lgn) < *n) {
+ ++lgn;
+ }
+ if (icompz == 1) {
+--- a/lapack-netlib/SRC/slaed0.c
++++ b/lapack-netlib/SRC/slaed0.c
+@@ -823,10 +823,10 @@ f"> */
+
+ temp = log((real) (*n)) / log(2.f);
+ lgn = (integer) temp;
+- if (pow_ii(&c__2, &lgn) < *n) {
++ if (pow_ii(c__2, lgn) < *n) {
+ ++lgn;
+ }
+- if (pow_ii(&c__2, &lgn) < *n) {
++ if (pow_ii(c__2, lgn) < *n) {
+ ++lgn;
+ }
+ iprmpt = indxq + *n + 1;
+--- a/lapack-netlib/SRC/slaed7.c
++++ b/lapack-netlib/SRC/slaed7.c
+@@ -883,11 +883,11 @@ f"> */
+ /* Form the z-vector which consists of the last row of Q_1 and the */
+ /* first row of Q_2. */
+
+- ptr = pow_ii(&c__2, tlvls) + 1;
++ ptr = pow_ii(c__2, *tlvls) + 1;
+ i__1 = *curlvl - 1;
+ for (i__ = 1; i__ <= i__1; ++i__) {
+ i__2 = *tlvls - i__;
+- ptr += pow_ii(&c__2, &i__2);
++ ptr += pow_ii(c__2, i__2);
+ /* L10: */
+ }
+ curr = ptr + *curpbm;
+--- a/lapack-netlib/SRC/slaeda.c
++++ b/lapack-netlib/SRC/slaeda.c
+@@ -753,7 +753,7 @@ f"> */
+ /* scheme */
+
+ i__1 = *curlvl - 1;
+- curr = ptr + *curpbm * pow_ii(&c__2, curlvl) + pow_ii(&c__2, &i__1) - 1;
++ curr = ptr + *curpbm * pow_ii(c__2, *curlvl) + pow_ii(c__2, i__1) - 1;
+
+ /* Determine size of these matrices. We add HALF to the value of */
+ /* the SQRT in case the machine underestimates one of these square */
+@@ -779,12 +779,12 @@ f"> */
+ /* rotations and permutation and then multiplying the center matrices */
+ /* against the current Z. */
+
+- ptr = pow_ii(&c__2, tlvls) + 1;
++ ptr = pow_ii(c__2, *tlvls) + 1;
+ i__1 = *curlvl - 1;
+ for (k = 1; k <= i__1; ++k) {
+ i__2 = *curlvl - k;
+ i__3 = *curlvl - k - 1;
+- curr = ptr + *curpbm * pow_ii(&c__2, &i__2) + pow_ii(&c__2, &i__3) -
++ curr = ptr + *curpbm * pow_ii(c__2, i__2) + pow_ii(c__2, i__3) -
+ 1;
+ psiz1 = prmptr[curr + 1] - prmptr[curr];
+ psiz2 = prmptr[curr + 2] - prmptr[curr + 1];
+@@ -844,7 +844,7 @@ f"> */
+ c__1);
+
+ i__2 = *tlvls - k;
+- ptr += pow_ii(&c__2, &i__2);
++ ptr += pow_ii(c__2, i__2);
+ /* L70: */
+ }
+
+--- a/lapack-netlib/SRC/slalsa.c
++++ b/lapack-netlib/SRC/slalsa.c
+@@ -946,7 +946,7 @@ f"> */
+ /* Finally go through the left singular vector matrices of all */
+ /* the other subproblems bottom-up on the tree. */
+
+- j = pow_ii(&c__2, &nlvl);
++ j = pow_ii(c__2, nlvl);
+ sqre = 0;
+
+ for (lvl = nlvl; lvl >= 1; --lvl) {
+@@ -960,7 +960,7 @@ f"> */
+ ll = 1;
+ } else {
+ i__1 = lvl - 1;
+- lf = pow_ii(&c__2, &i__1);
++ lf = pow_ii(c__2, i__1);
+ ll = (lf << 1) - 1;
+ }
+ i__1 = ll;
+@@ -1005,7 +1005,7 @@ f"> */
+ ll = 1;
+ } else {
+ i__2 = lvl - 1;
+- lf = pow_ii(&c__2, &i__2);
++ lf = pow_ii(c__2, i__2);
+ ll = (lf << 1) - 1;
+ }
+ i__2 = lf;
+--- a/lapack-netlib/SRC/slasd0.c
++++ b/lapack-netlib/SRC/slasd0.c
+@@ -821,7 +821,7 @@ f"> */
+ ll = 1;
+ } else {
+ i__1 = lvl - 1;
+- lf = pow_ii(&c__2, &i__1);
++ lf = pow_ii(c__2, i__1);
+ ll = (lf << 1) - 1;
+ }
+ i__1 = ll;
+--- a/lapack-netlib/SRC/slasda.c
++++ b/lapack-netlib/SRC/slasda.c
+@@ -1023,7 +1023,7 @@ f"> */
+
+ /* Now conquer each subproblem bottom-up. */
+
+- j = pow_ii(&c__2, &nlvl);
++ j = pow_ii(c__2, nlvl);
+ for (lvl = nlvl; lvl >= 1; --lvl) {
+ lvl2 = (lvl << 1) - 1;
+
+@@ -1035,7 +1035,7 @@ f"> */
+ ll = 1;
+ } else {
+ i__1 = lvl - 1;
+- lf = pow_ii(&c__2, &i__1);
++ lf = pow_ii(c__2, i__1);
+ ll = (lf << 1) - 1;
+ }
+ i__1 = ll;
+--- a/lapack-netlib/SRC/sstedc.c
++++ b/lapack-netlib/SRC/sstedc.c
+@@ -804,10 +804,10 @@ f"> */
+ lwmin = *n - 1 << 1;
+ } else {
+ lgn = (integer) (log((real) (*n)) / log(2.f));
+- if (pow_ii(&c__2, &lgn) < *n) {
++ if (pow_ii(c__2, lgn) < *n) {
+ ++lgn;
+ }
+- if (pow_ii(&c__2, &lgn) < *n) {
++ if (pow_ii(c__2, lgn) < *n) {
+ ++lgn;
+ }
+ if (icompz == 1) {
+--- a/lapack-netlib/SRC/zlaed0.c
++++ b/lapack-netlib/SRC/zlaed0.c
+@@ -793,10 +793,10 @@ f"> */
+
+ temp = log((doublereal) (*n)) / log(2.);
+ lgn = (integer) temp;
+- if (pow_ii(&c__2, &lgn) < *n) {
++ if (pow_ii(c__2, lgn) < *n) {
+ ++lgn;
+ }
+- if (pow_ii(&c__2, &lgn) < *n) {
++ if (pow_ii(c__2, lgn) < *n) {
+ ++lgn;
+ }
+ iprmpt = indxq + *n + 1;
+--- a/lapack-netlib/SRC/zlaed7.c
++++ b/lapack-netlib/SRC/zlaed7.c
+@@ -864,11 +864,11 @@ f"> */
+ /* Form the z-vector which consists of the last row of Q_1 and the */
+ /* first row of Q_2. */
+
+- ptr = pow_ii(&c__2, tlvls) + 1;
++ ptr = pow_ii(c__2, *tlvls) + 1;
+ i__1 = *curlvl - 1;
+ for (i__ = 1; i__ <= i__1; ++i__) {
+ i__2 = *tlvls - i__;
+- ptr += pow_ii(&c__2, &i__2);
++ ptr += pow_ii(c__2, i__2);
+ /* L10: */
+ }
+ curr = ptr + *curpbm;
+--- a/lapack-netlib/SRC/zlalsa.c
++++ b/lapack-netlib/SRC/zlalsa.c
+@@ -1051,7 +1051,7 @@ f"> */
+ /* Finally go through the left singular vector matrices of all */
+ /* the other subproblems bottom-up on the tree. */
+
+- j = pow_ii(&c__2, &nlvl);
++ j = pow_ii(c__2, nlvl);
+ sqre = 0;
+
+ for (lvl = nlvl; lvl >= 1; --lvl) {
+@@ -1065,7 +1065,7 @@ f"> */
+ ll = 1;
+ } else {
+ i__1 = lvl - 1;
+- lf = pow_ii(&c__2, &i__1);
++ lf = pow_ii(c__2, i__1);
+ ll = (lf << 1) - 1;
+ }
+ i__1 = ll;
+@@ -1110,7 +1110,7 @@ f"> */
+ ll = 1;
+ } else {
+ i__2 = lvl - 1;
+- lf = pow_ii(&c__2, &i__2);
++ lf = pow_ii(c__2, i__2);
+ ll = (lf << 1) - 1;
+ }
+ i__2 = lf;
+--- a/lapack-netlib/SRC/zstedc.c
++++ b/lapack-netlib/SRC/zstedc.c
+@@ -836,10 +836,10 @@ f"> */
+ lrwmin = *n - 1 << 1;
+ } else if (icompz == 1) {
+ lgn = (integer) (log((doublereal) (*n)) / log(2.));
+- if (pow_ii(&c__2, &lgn) < *n) {
++ if (pow_ii(c__2, lgn) < *n) {
+ ++lgn;
+ }
+- if (pow_ii(&c__2, &lgn) < *n) {
++ if (pow_ii(c__2, lgn) < *n) {
+ ++lgn;
+ }
+ lwmin = *n * *n;
+
+From 91110f92d218492d0efbdc1fdf34277ca45f4b36 Mon Sep 17 00:00:00 2001
+From: Martin Kroeker <martin@ruby.chemie.uni-freiburg.de>
+Date: Wed, 14 Sep 2022 14:03:31 +0200
+Subject: [PATCH] fix missing return type in function declaration
+
+--- a/ctest/c_sblat1c.c
++++ b/ctest/c_sblat1c.c
+@@ -969,7 +969,7 @@ real *sfac;
+ 1.17 };
+
+ /* Local variables */
+- extern /* Subroutine */ srottest_();
++ extern /* Subroutine */ void srottest_();
+ static integer i__, k, ksize;
+ extern /* Subroutine */ int stest_(), srotmtest_();
+ static integer ki, kn;
+
+From 9402df5604e69f86f58953e3883f33f98c930baf Mon Sep 17 00:00:00 2001
+From: Martin Kroeker <martin@ruby.chemie.uni-freiburg.de>
+Date: Wed, 14 Sep 2022 21:44:34 +0200
+Subject: [PATCH] Fix missing external declaration
+
+--- a/driver/others/blas_server_omp.c
++++ b/driver/others/blas_server_omp.c
+@@ -69,6 +69,8 @@
+
+ int blas_server_avail = 0;
+
++extern int openblas_omp_adaptive_env();
++
+ static void * blas_thread_buffer[MAX_PARALLEL_NUMBER][MAX_CPU_NUMBER];
+ #ifdef HAVE_C11
+ static atomic_bool blas_buffer_inuse[MAX_PARALLEL_NUMBER];
+
+From 101a2c77c3f3610933f450cefca3e312edab2186 Mon Sep 17 00:00:00 2001
+From: Martin Kroeker <martin@ruby.chemie.uni-freiburg.de>
+Date: Thu, 15 Sep 2022 09:19:19 +0200
+Subject: [PATCH] Fix warnings
+
+--- a/kernel/x86_64/dgemm_ncopy_8_skylakex.c
++++ b/kernel/x86_64/dgemm_ncopy_8_skylakex.c
+@@ -52,18 +52,18 @@ int CNAME(BLASLONG m, BLASLONG n, FLOAT * __restrict a, BLASLONG lda, FLOAT * __
+ FLOAT ctemp05, ctemp06, ctemp07, ctemp08;
+ FLOAT ctemp09, ctemp10, ctemp11, ctemp12;
+ FLOAT ctemp13, ctemp14, ctemp15, ctemp16;
+- FLOAT ctemp17, ctemp18, ctemp19, ctemp20;
+- FLOAT ctemp21, ctemp22, ctemp23, ctemp24;
+- FLOAT ctemp25, ctemp26, ctemp27, ctemp28;
+- FLOAT ctemp29, ctemp30, ctemp31, ctemp32;
+- FLOAT ctemp33, ctemp34, ctemp35, ctemp36;
+- FLOAT ctemp37, ctemp38, ctemp39, ctemp40;
+- FLOAT ctemp41, ctemp42, ctemp43, ctemp44;
+- FLOAT ctemp45, ctemp46, ctemp47, ctemp48;
+- FLOAT ctemp49, ctemp50, ctemp51, ctemp52;
+- FLOAT ctemp53, ctemp54, ctemp55, ctemp56;
+- FLOAT ctemp57, ctemp58, ctemp59, ctemp60;
+- FLOAT ctemp61, ctemp62, ctemp63, ctemp64;
++ FLOAT ctemp17 /*, ctemp18, ctemp19, ctemp20*/ ;
++ FLOAT /*ctemp21, ctemp22,*/ ctemp23, ctemp24;
++ FLOAT ctemp25 /*, ctemp26, ctemp27, ctemp28*/ ;
++ FLOAT /*ctemp29, ctemp30,*/ ctemp31, ctemp32;
++ FLOAT ctemp33 /*, ctemp34, ctemp35, ctemp36*/ ;
++ FLOAT /*ctemp37, ctemp38,*/ ctemp39, ctemp40;
++ FLOAT ctemp41 /*, ctemp42, ctemp43, ctemp44*/ ;
++ FLOAT /*ctemp45, ctemp46,*/ ctemp47, ctemp48;
++ FLOAT ctemp49 /*, ctemp50, ctemp51, ctemp52*/ ;
++ FLOAT /*ctemp53, ctemp54,*/ ctemp55, ctemp56;
++ FLOAT ctemp57 /*, ctemp58, ctemp59, ctemp60*/ ;
++ FLOAT /*ctemp61, ctemp62,*/ ctemp63, ctemp64;
+
+
+ aoffset = a;
+--- a/kernel/x86_64/omatcopy_rt.c
++++ b/kernel/x86_64/omatcopy_rt.c
+@@ -142,7 +142,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ ,"xmm0","xmm1","xmm2","xmm3","xmm4","xmm5","xmm6","xmm7","xmm8","xmm9","xmm10","xmm11","xmm12","xmm13","xmm14","xmm15");\
+ }
+ int CNAME(BLASLONG rows, BLASLONG cols, FLOAT alpha, FLOAT *a, BLASLONG lda, FLOAT *b, BLASLONG ldb){
+- float *src, *dst, *dst_tmp, *src_base, *dst_base;
++ float *src, *dst, *dst_tmp=0, *src_base, *dst_base;
+ uint64_t src_ld_bytes = (uint64_t)lda * sizeof(float), dst_ld_bytes = (uint64_t)ldb * sizeof(float), num_rows = 0;
+ BLASLONG cols_left, rows_done; float ALPHA = alpha;
+ if(ALPHA==0.0){
+
diff --git a/sci-libs/openblas/openblas-0.3.21-r1.ebuild b/sci-libs/openblas/openblas-0.3.21-r1.ebuild
new file mode 100644
index 000000000000..f8be930b1154
--- /dev/null
+++ b/sci-libs/openblas/openblas-0.3.21-r1.ebuild
@@ -0,0 +1,197 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit fortran-2 toolchain-funcs
+
+DESCRIPTION="Optimized BLAS library based on GotoBLAS2"
+HOMEPAGE="https://github.com/xianyi/OpenBLAS"
+SRC_URI="https://github.com/xianyi/OpenBLAS/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}"/OpenBLAS-${PV}
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~riscv ~x86 ~amd64-linux ~x86-linux ~x64-macos"
+IUSE="dynamic eselect-ldso index-64bit openmp pthread relapack test"
+REQUIRED_USE="?? ( openmp pthread )"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ eselect-ldso? (
+ >=app-eselect/eselect-blas-0.2
+ >=app-eselect/eselect-lapack-0.2
+ )
+"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-0.3.12-shared-blas-lapack.patch"
+ "${FILESDIR}/${PN}-0.3.21-fix-loong.patch"
+ "${FILESDIR}/${P}-clang16.patch"
+)
+
+pkg_pretend() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+
+ elog "This software has a massive number of options that"
+ elog "are configurable and it is *impossible* for all of"
+ elog "those to fit inside any manageable ebuild."
+ elog "The Gentoo provided package has enough to build"
+ elog "a fully optimized library for your targeted CPU."
+ elog "You can set the CPU target using the environment"
+ elog "variable - OPENBLAS_TARGET or it will be detected"
+ elog "automatically from the target toolchain (supports"
+ elog "cross compilation toolchains)."
+ elog "You can control the maximum number of threads"
+ elog "using OPENBLAS_NTHREAD, default=64 and number of "
+ elog "parallel calls to allow before further calls wait"
+ elog "using OPENBLAS_NPARALLEL, default=8."
+}
+
+pkg_setup() {
+ fortran-2_pkg_setup
+
+ # List of most configurable options - Makefile.rule
+
+ # https://github.com/xianyi/OpenBLAS/pull/2663
+ tc-export CC FC LD AR AS RANLIB
+
+ # HOSTCC is used for scripting
+ export HOSTCC="$(tc-getBUILD_CC)"
+
+ # threading options
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+ USE_THREAD=0
+ if use openmp; then
+ USE_THREAD=1; USE_OPENMP=1;
+ elif use pthread; then
+ USE_THREAD=1; USE_OPENMP=0;
+ fi
+ export USE_THREAD USE_OPENMP
+
+ # disable submake with -j and default optimization flags
+ # in Makefile.system
+ # Makefile.rule says to not modify COMMON_OPT/FCOMMON_OPT...
+ export MAKE_NB_JOBS=-1 \
+ COMMON_OPT=" " \
+ FCOMMON_OPT=" "
+
+ # Target CPU ARCH options
+ # generally detected automatically from cross toolchain
+ use dynamic && \
+ export DYNAMIC_ARCH=1 \
+ NO_AFFINITY=1 \
+ TARGET=GENERIC
+
+ export NUM_PARALLEL=${OPENBLAS_NPARALLEL:-8} \
+ NUM_THREADS=${OPENBLAS_NTHREAD:-64}
+
+ # setting OPENBLAS_TARGET to override auto detection
+ # in case the toolchain is not enough to detect
+ # https://github.com/xianyi/OpenBLAS/blob/develop/TargetList.txt
+ if ! use dynamic && [[ ! -z "${OPENBLAS_TARGET}" ]] ; then
+ export TARGET="${OPENBLAS_TARGET}"
+ fi
+
+ export NO_STATIC=1
+
+ BUILD_RELAPACK=1
+ if ! use relapack; then
+ BUILD_RELAPACK=0
+ fi
+
+ export PREFIX="${EPREFIX}/usr" BUILD_RELAPACK
+}
+
+src_prepare() {
+ default
+
+ # Don't build the tests as part of "make all". We'll do
+ # it explicitly later if the test phase is enabled.
+ sed -e "/^all ::/s/tests //" -i Makefile || die
+
+ # if 64bit-index is needed, create second library
+ # with LIBPREFIX=libopenblas64
+ if use index-64bit; then
+ cp -aL "${S}" "${S}-index-64bit" || die
+ fi
+}
+
+src_compile() {
+ default
+ cd interface || die
+ emake shared-blas-lapack
+
+ if use index-64bit; then
+ emake -C"${S}-index-64bit" \
+ INTERFACE64=1 \
+ LIBPREFIX=libopenblas64
+ fi
+}
+
+src_test() {
+ emake tests
+}
+
+src_install() {
+ emake install DESTDIR="${D}" \
+ OPENBLAS_INCLUDE_DIR='$(PREFIX)'/include/${PN} \
+ OPENBLAS_LIBRARY_DIR='$(PREFIX)'/$(get_libdir)
+
+ dodoc GotoBLAS_*.txt *.md Changelog.txt
+
+ if use index-64bit; then
+ dolib.so "${S}-index-64bit"/libopenblas64*.so*
+ fi
+
+ if use eselect-ldso; then
+ insinto /usr/$(get_libdir)/blas/openblas/
+ doins interface/libblas.so.3
+ dosym libblas.so.3 usr/$(get_libdir)/blas/openblas/libblas.so
+ doins interface/libcblas.so.3
+ dosym libcblas.so.3 usr/$(get_libdir)/blas/openblas/libcblas.so
+
+ insinto /usr/$(get_libdir)/lapack/openblas/
+ doins interface/liblapack.so.3
+ dosym liblapack.so.3 usr/$(get_libdir)/lapack/openblas/liblapack.so
+ doins interface/liblapacke.so.3
+ dosym liblapacke.so.3 usr/$(get_libdir)/lapack/openblas/liblapacke.so
+ fi
+}
+
+pkg_postinst() {
+ use eselect-ldso || return
+ local libdir=$(get_libdir) me="openblas"
+
+ # check blas
+ eselect blas add ${libdir} "${EROOT}"/usr/${libdir}/blas/${me} ${me}
+ local current_blas=$(eselect blas show ${libdir} | cut -d' ' -f2)
+ if [[ ${current_blas} == "${me}" || -z ${current_blas} ]]; then
+ eselect blas set ${libdir} ${me}
+ elog "Current eselect: BLAS/CBLAS ($libdir) -> [${current_blas}]."
+ else
+ elog "Current eselect: BLAS/CBLAS ($libdir) -> [${current_blas}]."
+ elog "To use blas [${me}] implementation, you have to issue (as root):"
+ elog "\t eselect blas set ${libdir} ${me}"
+ fi
+
+ # check lapack
+ eselect lapack add ${libdir} "${EROOT}"/usr/${libdir}/lapack/${me} ${me}
+ local current_lapack=$(eselect lapack show ${libdir} | cut -d' ' -f2)
+ if [[ ${current_lapack} == "${me}" || -z ${current_lapack} ]]; then
+ eselect lapack set ${libdir} ${me}
+ elog "Current eselect: LAPACK ($libdir) -> [${current_lapack}]."
+ else
+ elog "Current eselect: LAPACK ($libdir) -> [${current_lapack}]."
+ elog "To use lapack [${me}] implementation, you have to issue (as root):"
+ elog "\t eselect lapack set ${libdir} ${me}"
+ fi
+}
+
+pkg_postrm() {
+ if use eselect-ldso; then
+ eselect blas validate
+ eselect lapack validate
+ fi
+}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sci-libs/openblas/, sci-libs/openblas/files/
@ 2024-03-04 11:38 Sam James
0 siblings, 0 replies; 6+ messages in thread
From: Sam James @ 2024-03-04 11:38 UTC (permalink / raw
To: gentoo-commits
commit: dfaceb09f2a92eb81e7e0321df45d9088d93e0c7
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 4 11:37:23 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Mar 4 11:37:23 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dfaceb09
sci-libs/openblas: drop 0.3.21-r1, 0.3.23
Signed-off-by: Sam James <sam <AT> gentoo.org>
sci-libs/openblas/Manifest | 2 -
.../files/openblas-0.3.12-shared-blas-lapack.patch | 36 --
.../openblas/files/openblas-0.3.21-clang16.patch | 581 ---------------------
.../openblas/files/openblas-0.3.21-fix-loong.patch | 237 ---------
.../files/openblas-0.3.23-parallel-make.patch | 67 ---
sci-libs/openblas/openblas-0.3.21-r1.ebuild | 197 -------
sci-libs/openblas/openblas-0.3.23.ebuild | 199 -------
7 files changed, 1319 deletions(-)
diff --git a/sci-libs/openblas/Manifest b/sci-libs/openblas/Manifest
index a2e94a5499c4..62f8bbbfc4b8 100644
--- a/sci-libs/openblas/Manifest
+++ b/sci-libs/openblas/Manifest
@@ -1,4 +1,2 @@
DIST OpenBLAS-0.3.25.tar.gz 24073168 BLAKE2B c2a173b50f6931e7782c7d429487abd4b1a4ed05aec4f08febbc5cc73b9ed5cb36c9e308bf7cb89ce116b1c25556615d2384087cf7d1b489a4784901951558bc SHA512 69bcf8082575b01ce1734fc9d33454314964a7e81ff29a7c1a764af3083ac0dc24289fd72bbe22c9583398bda7b658d6e4ab1d5036e43412745f0be3c2185b3c
DIST OpenBLAS-0.3.26.tar.gz 24404912 BLAKE2B d72f02492b3ce58c5012943ea84190cb8a8efdfe438fb4fe945a713e4abbcb77f3a0603ca266df234efe8e6d6e4bab4a7386ac02b95512281165bf7ae2f9181d SHA512 01d3a536fbfa62f276fd6b1ad0e218fb3d91f41545fc83ddc74979fa26372d8389f0baa20334badfe0adacd77bd944c50a47ac920577373fcc1d495553084373
-DIST openblas-0.3.21.tar.gz 23729571 BLAKE2B 678bfb13ead69045e7d4d840bbcaed884d9ebedded5425cfa1f55e3d85bda31a3eb43dbbf9f07099d0d198f97ae68ef3b3b2b78aa1bd5b4999dd729dc08f7e28 SHA512 4625c8e6ccfa9120281fd714d3f6b7c3ba2265470c1be76121d6b25dc3dacb899d26e5d9a417ddc616d23909f1411495aa995ef8d8d6df8511cd5cefbabcb1c5
-DIST openblas-0.3.23.tar.gz 23950794 BLAKE2B 8394e09c682bba10450248cbbe090bb81c26661eac7d238942055ae0eecce752c8a3481af905de9efe20fe635f2c4a0e06af83bb64c998ab410e4cdc56751a47 SHA512 ea64c693e57eb63cc2a88e4d6ab2d8cf9ab84ae6a15048fb12090a3570dd41053e62e99c1ff9d3e02dd67ca93233591ab41b8c017d06585d0a69222e1ad3023f
diff --git a/sci-libs/openblas/files/openblas-0.3.12-shared-blas-lapack.patch b/sci-libs/openblas/files/openblas-0.3.12-shared-blas-lapack.patch
deleted file mode 100644
index 55fb7d7c66ca..000000000000
--- a/sci-libs/openblas/files/openblas-0.3.12-shared-blas-lapack.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff --git a/interface/Makefile b/interface/Makefile
-index 6b247b4..1297c73 100644
---- a/interface/Makefile
-+++ b/interface/Makefile
-@@ -330,7 +330,7 @@ CCBLAS3OBJS = \
- cblas_chemm.$(SUFFIX) cblas_cherk.$(SUFFIX) cblas_cher2k.$(SUFFIX) \
- cblas_comatcopy.$(SUFFIX) cblas_cimatcopy.$(SUFFIX)\
- cblas_cgeadd.$(SUFFIX)
--
-+
- CXERBLAOBJ = \
- cblas_xerbla.$(SUFFIX)
-
-@@ -2310,3 +2310,22 @@ cblas_zgeadd.$(SUFFIX) cblas_zgeadd.$(PSUFFIX) : zgeadd.c
- cblas_xerbla.$(SUFFIX) cblas_xerbla.$(PSUFFIX) : xerbla.c
- $(CC) -c $(CFLAGS) -DCBLAS $< -o $(@F)
-
-+#####
-+shared-blas-lapack: libblas.so.3 libcblas.so.3 liblapack.so.3 liblapacke.so.3
-+
-+# The list of prerequisite is created by comparing with NETLIB BLAS public API.
-+libblas.so.3: $(SBLAS1OBJS) $(SBLAS2OBJS) $(SBLAS3OBJS) $(DBLAS1OBJS) $(DBLAS2OBJS) $(DBLAS3OBJS) $(CBLAS1OBJS) $(CBLAS2OBJS) $(CBLAS3OBJS) $(ZBLAS1OBJS) $(ZBLAS2OBJS) $(ZBLAS3OBJS) ../kernel/lsame.o ../kernel/scabs1.o ../kernel/dcabs1.o ../driver/others/xerbla.o
-+ $(CC) $(LDFLAGS) -shared -o $@ $^ -Wl,-soname,libblas.so.3 -L.. -lopenblas $(EXTRALIB)
-+
-+libcblas.so.3: $(CSBLAS1OBJS) $(CSBLAS2OBJS) $(CSBLAS3OBJS) $(CDBLAS1OBJS) $(CDBLAS2OBJS) $(CDBLAS3OBJS) $(CCBLAS1OBJS) $(CCBLAS2OBJS) $(CCBLAS3OBJS) $(CZBLAS1OBJS) $(CZBLAS2OBJS) $(CZBLAS3OBJS) ../kernel/lsame.o ../kernel/scabs1.o ../kernel/dcabs1.o ../driver/others/xerbla.o
-+ $(CC) $(LDFLAGS) -shared -o $@ $^ -Wl,-soname,libcblas.so.3 -L.. -lopenblas $(EXTRALIB)
-+
-+# The prerequisites must match the symbols deleted in target delete-duplicate-lapack-objects
-+liblapack.so.3: $(SLAPACKOBJS) $(DLAPACKOBJS) $(CLAPACKOBJS) $(ZLAPACKOBJS) ../kernel/lsame.o ../driver/others/xerbla.o
-+ $(CC) $(LDFLAGS) -shared -o $@ $^ ../lapack-netlib/SRC/*.o -Wl,-soname,liblapack.so.3 -L.. -lopenblas $(EXTRALIB)
-+
-+liblapacke.so.3: liblapack.so.3
-+ $(CC) $(LDFLAGS) -shared -o $@ `find ../lapack-netlib/LAPACKE -name "*.o"` -Wl,-soname,liblapacke.so.3 -L.. -lopenblas $(EXTRALIB)
-+
-+clean::
-+ rm -f libblas.so.3 libcblas.so.3 liblapack.so.3
diff --git a/sci-libs/openblas/files/openblas-0.3.21-clang16.patch b/sci-libs/openblas/files/openblas-0.3.21-clang16.patch
deleted file mode 100644
index 051966b0a870..000000000000
--- a/sci-libs/openblas/files/openblas-0.3.21-clang16.patch
+++ /dev/null
@@ -1,581 +0,0 @@
-https://github.com/xianyi/OpenBLAS/commit/f703846ad9400a8ea175cb8dd43e18c152aeab93
-https://github.com/xianyi/OpenBLAS/commit/515cf269291bec0d43651fe7bf99a71fb074a0ad
-https://github.com/xianyi/OpenBLAS/commit/91110f92d218492d0efbdc1fdf34277ca45f4b36
-https://github.com/xianyi/OpenBLAS/commit/9402df5604e69f86f58953e3883f33f98c930baf
-https://github.com/xianyi/OpenBLAS/commit/101a2c77c3f3610933f450cefca3e312edab2186
-https://src.fedoraproject.org/rpms/openblas/c/5f27d51cebe1c1bb6598d38326ece8dc0ac71ec7?branch=rawhide
-
-From f703846ad9400a8ea175cb8dd43e18c152aeab93 Mon Sep 17 00:00:00 2001
-From: Martin Kroeker <martin@ruby.chemie.uni-freiburg.de>
-Date: Sat, 13 Aug 2022 11:38:27 +0200
-Subject: [PATCH] Add function prototypes
-
---- a/exports/gensymbol
-+++ b/exports/gensymbol
-@@ -4000,6 +4000,22 @@ case "$p1" in
- no_underscore_objs="$no_underscore_objs $misc_common_objs"
-
- printf 'int main(void){\n'
-+ for obj in $underscore_objs; do
-+ [ "$obj" != "xerbla" ] && printf 'extern void %s%s%s%s();\n' \
-+ "$symbolprefix" "$obj" "$bu" "$symbolsuffix"
-+ done
-+
-+ for obj in $need_2underscore_objs; do
-+ printf 'extern void %s%s%s%s%s();\n' \
-+ "$symbolprefix" "$obj" "$bu" "$bu" "$symbolsuffix"
-+ done
-+
-+ for obj in $no_underscore_objs; do
-+ printf 'extern void %s%s%s();\n' \
-+ "$symbolprefix" "$obj" "$symbolsuffix"
-+ done
-+
-+ printf '\n'
- for obj in $underscore_objs; do
- [ "$obj" != "xerbla" ] && printf '%s%s%s%s();\n' \
- "$symbolprefix" "$obj" "$bu" "$symbolsuffix"
---- a/exports/gensymbol.pl
-+++ b/exports/gensymbol.pl
-@@ -3955,6 +3955,18 @@
- @no_underscore_objs = (@no_underscore_objs, @misc_common_objs);
-
- print "int main(void){\n";
-+ foreach $objs (@underscore_objs) {
-+ print "extern void ", $symbolprefix, $objs, $bu, $symbolsuffix, "();\n" if $objs ne "xerbla";
-+ }
-+
-+ foreach $objs (@need_2underscore_objs) {
-+ print "extern void ", $symbolprefix, $objs, $bu, $bu, $symbolsuffix, "();\n";
-+ }
-+
-+ foreach $objs (@no_underscore_objs) {
-+ print "extern void ", $symbolprefix, $objs, $symbolsuffix, "();\n";
-+ }
-+
- foreach $objs (@underscore_objs) {
- print $symbolprefix, $objs, $bu, $symbolsuffix, "();\n" if $objs ne "xerbla";
- }
-
-From 515cf269291bec0d43651fe7bf99a71fb074a0ad Mon Sep 17 00:00:00 2001
-From: Martin Kroeker <martin@ruby.chemie.uni-freiburg.de>
-Date: Wed, 14 Sep 2022 11:48:36 +0200
-Subject: [PATCH] Fix pointer/integer argument mismatch in calls to pow()
-
---- a/lapack-netlib/SRC/claed0.c
-+++ b/lapack-netlib/SRC/claed0.c
-@@ -796,10 +796,10 @@ f"> */
-
- temp = log((real) (*n)) / log(2.f);
- lgn = (integer) temp;
-- if (pow_ii(&c__2, &lgn) < *n) {
-+ if (pow_ii(c__2, lgn) < *n) {
- ++lgn;
- }
-- if (pow_ii(&c__2, &lgn) < *n) {
-+ if (pow_ii(c__2, lgn) < *n) {
- ++lgn;
- }
- iprmpt = indxq + *n + 1;
---- a/lapack-netlib/SRC/claed7.c
-+++ b/lapack-netlib/SRC/claed7.c
-@@ -864,11 +864,11 @@ f"> */
- /* Form the z-vector which consists of the last row of Q_1 and the */
- /* first row of Q_2. */
-
-- ptr = pow_ii(&c__2, tlvls) + 1;
-+ ptr = pow_ii(c__2, *tlvls) + 1;
- i__1 = *curlvl - 1;
- for (i__ = 1; i__ <= i__1; ++i__) {
- i__2 = *tlvls - i__;
-- ptr += pow_ii(&c__2, &i__2);
-+ ptr += pow_ii(c__2, i__2);
- /* L10: */
- }
- curr = ptr + *curpbm;
---- a/lapack-netlib/SRC/clalsa.c
-+++ b/lapack-netlib/SRC/clalsa.c
-@@ -1051,7 +1051,7 @@ f"> */
- /* Finally go through the left singular vector matrices of all */
- /* the other subproblems bottom-up on the tree. */
-
-- j = pow_ii(&c__2, &nlvl);
-+ j = pow_ii(c__2, nlvl);
- sqre = 0;
-
- for (lvl = nlvl; lvl >= 1; --lvl) {
-@@ -1065,7 +1065,7 @@ f"> */
- ll = 1;
- } else {
- i__1 = lvl - 1;
-- lf = pow_ii(&c__2, &i__1);
-+ lf = pow_ii(c__2, i__1);
- ll = (lf << 1) - 1;
- }
- i__1 = ll;
-@@ -1110,7 +1110,7 @@ f"> */
- ll = 1;
- } else {
- i__2 = lvl - 1;
-- lf = pow_ii(&c__2, &i__2);
-+ lf = pow_ii(c__2, i__2);
- ll = (lf << 1) - 1;
- }
- i__2 = lf;
---- a/lapack-netlib/SRC/cstedc.c
-+++ b/lapack-netlib/SRC/cstedc.c
-@@ -836,10 +836,10 @@ f"> */
- lrwmin = *n - 1 << 1;
- } else if (icompz == 1) {
- lgn = (integer) (log((real) (*n)) / log(2.f));
-- if (pow_ii(&c__2, &lgn) < *n) {
-+ if (pow_ii(c__2, lgn) < *n) {
- ++lgn;
- }
-- if (pow_ii(&c__2, &lgn) < *n) {
-+ if (pow_ii(c__2, lgn) < *n) {
- ++lgn;
- }
- lwmin = *n * *n;
---- a/lapack-netlib/SRC/dlaed0.c
-+++ b/lapack-netlib/SRC/dlaed0.c
-@@ -827,10 +827,10 @@ f"> */
-
- temp = log((doublereal) (*n)) / log(2.);
- lgn = (integer) temp;
-- if (pow_ii(&c__2, &lgn) < *n) {
-+ if (pow_ii(c__2, lgn) < *n) {
- ++lgn;
- }
-- if (pow_ii(&c__2, &lgn) < *n) {
-+ if (pow_ii(c__2, lgn) < *n) {
- ++lgn;
- }
- iprmpt = indxq + *n + 1;
---- a/lapack-netlib/SRC/dlaed7.c
-+++ b/lapack-netlib/SRC/dlaed7.c
-@@ -885,11 +885,11 @@ f"> */
- /* Form the z-vector which consists of the last row of Q_1 and the */
- /* first row of Q_2. */
-
-- ptr = pow_ii(&c__2, tlvls) + 1;
-+ ptr = pow_ii(c__2, *tlvls) + 1;
- i__1 = *curlvl - 1;
- for (i__ = 1; i__ <= i__1; ++i__) {
- i__2 = *tlvls - i__;
-- ptr += pow_ii(&c__2, &i__2);
-+ ptr += pow_ii(c__2, i__2);
- /* L10: */
- }
- curr = ptr + *curpbm;
---- a/lapack-netlib/SRC/dlaeda.c
-+++ b/lapack-netlib/SRC/dlaeda.c
-@@ -754,7 +754,7 @@ f"> */
- /* scheme */
-
- i__1 = *curlvl - 1;
-- curr = ptr + *curpbm * pow_ii(&c__2, curlvl) + pow_ii(&c__2, &i__1) - 1;
-+ curr = ptr + *curpbm * pow_ii(c__2, *curlvl) + pow_ii(c__2, i__1) - 1;
-
- /* Determine size of these matrices. We add HALF to the value of */
- /* the SQRT in case the machine underestimates one of these square */
-@@ -781,12 +781,12 @@ f"> */
- /* rotations and permutation and then multiplying the center matrices */
- /* against the current Z. */
-
-- ptr = pow_ii(&c__2, tlvls) + 1;
-+ ptr = pow_ii(c__2, *tlvls) + 1;
- i__1 = *curlvl - 1;
- for (k = 1; k <= i__1; ++k) {
- i__2 = *curlvl - k;
- i__3 = *curlvl - k - 1;
-- curr = ptr + *curpbm * pow_ii(&c__2, &i__2) + pow_ii(&c__2, &i__3) -
-+ curr = ptr + *curpbm * pow_ii(c__2, i__2) + pow_ii(c__2, i__3) -
- 1;
- psiz1 = prmptr[curr + 1] - prmptr[curr];
- psiz2 = prmptr[curr + 2] - prmptr[curr + 1];
-@@ -847,7 +847,7 @@ f"> */
- c__1);
-
- i__2 = *tlvls - k;
-- ptr += pow_ii(&c__2, &i__2);
-+ ptr += pow_ii(c__2, i__2);
- /* L70: */
- }
-
---- a/lapack-netlib/SRC/dlalsa.c
-+++ b/lapack-netlib/SRC/dlalsa.c
-@@ -951,7 +951,7 @@ f"> */
- /* Finally go through the left singular vector matrices of all */
- /* the other subproblems bottom-up on the tree. */
-
-- j = pow_ii(&c__2, &nlvl);
-+ j = pow_ii(c__2, nlvl);
- sqre = 0;
-
- for (lvl = nlvl; lvl >= 1; --lvl) {
-@@ -965,7 +965,7 @@ f"> */
- ll = 1;
- } else {
- i__1 = lvl - 1;
-- lf = pow_ii(&c__2, &i__1);
-+ lf = pow_ii(c__2, i__1);
- ll = (lf << 1) - 1;
- }
- i__1 = ll;
-@@ -1010,7 +1010,7 @@ f"> */
- ll = 1;
- } else {
- i__2 = lvl - 1;
-- lf = pow_ii(&c__2, &i__2);
-+ lf = pow_ii(c__2, i__2);
- ll = (lf << 1) - 1;
- }
- i__2 = lf;
---- a/lapack-netlib/SRC/dlasd0.c
-+++ b/lapack-netlib/SRC/dlasd0.c
-@@ -824,7 +824,7 @@ f"> */
- ll = 1;
- } else {
- i__1 = lvl - 1;
-- lf = pow_ii(&c__2, &i__1);
-+ lf = pow_ii(c__2, i__1);
- ll = (lf << 1) - 1;
- }
- i__1 = ll;
---- a/lapack-netlib/SRC/dlasda.c
-+++ b/lapack-netlib/SRC/dlasda.c
-@@ -1027,7 +1027,7 @@ f"> */
-
- /* Now conquer each subproblem bottom-up. */
-
-- j = pow_ii(&c__2, &nlvl);
-+ j = pow_ii(c__2, nlvl);
- for (lvl = nlvl; lvl >= 1; --lvl) {
- lvl2 = (lvl << 1) - 1;
-
-@@ -1039,7 +1039,7 @@ f"> */
- ll = 1;
- } else {
- i__1 = lvl - 1;
-- lf = pow_ii(&c__2, &i__1);
-+ lf = pow_ii(c__2, i__1);
- ll = (lf << 1) - 1;
- }
- i__1 = ll;
---- a/lapack-netlib/SRC/dstedc.c
-+++ b/lapack-netlib/SRC/dstedc.c
-@@ -806,10 +806,10 @@ f"> */
- lwmin = *n - 1 << 1;
- } else {
- lgn = (integer) (log((doublereal) (*n)) / log(2.));
-- if (pow_ii(&c__2, &lgn) < *n) {
-+ if (pow_ii(c__2, lgn) < *n) {
- ++lgn;
- }
-- if (pow_ii(&c__2, &lgn) < *n) {
-+ if (pow_ii(c__2, lgn) < *n) {
- ++lgn;
- }
- if (icompz == 1) {
---- a/lapack-netlib/SRC/slaed0.c
-+++ b/lapack-netlib/SRC/slaed0.c
-@@ -823,10 +823,10 @@ f"> */
-
- temp = log((real) (*n)) / log(2.f);
- lgn = (integer) temp;
-- if (pow_ii(&c__2, &lgn) < *n) {
-+ if (pow_ii(c__2, lgn) < *n) {
- ++lgn;
- }
-- if (pow_ii(&c__2, &lgn) < *n) {
-+ if (pow_ii(c__2, lgn) < *n) {
- ++lgn;
- }
- iprmpt = indxq + *n + 1;
---- a/lapack-netlib/SRC/slaed7.c
-+++ b/lapack-netlib/SRC/slaed7.c
-@@ -883,11 +883,11 @@ f"> */
- /* Form the z-vector which consists of the last row of Q_1 and the */
- /* first row of Q_2. */
-
-- ptr = pow_ii(&c__2, tlvls) + 1;
-+ ptr = pow_ii(c__2, *tlvls) + 1;
- i__1 = *curlvl - 1;
- for (i__ = 1; i__ <= i__1; ++i__) {
- i__2 = *tlvls - i__;
-- ptr += pow_ii(&c__2, &i__2);
-+ ptr += pow_ii(c__2, i__2);
- /* L10: */
- }
- curr = ptr + *curpbm;
---- a/lapack-netlib/SRC/slaeda.c
-+++ b/lapack-netlib/SRC/slaeda.c
-@@ -753,7 +753,7 @@ f"> */
- /* scheme */
-
- i__1 = *curlvl - 1;
-- curr = ptr + *curpbm * pow_ii(&c__2, curlvl) + pow_ii(&c__2, &i__1) - 1;
-+ curr = ptr + *curpbm * pow_ii(c__2, *curlvl) + pow_ii(c__2, i__1) - 1;
-
- /* Determine size of these matrices. We add HALF to the value of */
- /* the SQRT in case the machine underestimates one of these square */
-@@ -779,12 +779,12 @@ f"> */
- /* rotations and permutation and then multiplying the center matrices */
- /* against the current Z. */
-
-- ptr = pow_ii(&c__2, tlvls) + 1;
-+ ptr = pow_ii(c__2, *tlvls) + 1;
- i__1 = *curlvl - 1;
- for (k = 1; k <= i__1; ++k) {
- i__2 = *curlvl - k;
- i__3 = *curlvl - k - 1;
-- curr = ptr + *curpbm * pow_ii(&c__2, &i__2) + pow_ii(&c__2, &i__3) -
-+ curr = ptr + *curpbm * pow_ii(c__2, i__2) + pow_ii(c__2, i__3) -
- 1;
- psiz1 = prmptr[curr + 1] - prmptr[curr];
- psiz2 = prmptr[curr + 2] - prmptr[curr + 1];
-@@ -844,7 +844,7 @@ f"> */
- c__1);
-
- i__2 = *tlvls - k;
-- ptr += pow_ii(&c__2, &i__2);
-+ ptr += pow_ii(c__2, i__2);
- /* L70: */
- }
-
---- a/lapack-netlib/SRC/slalsa.c
-+++ b/lapack-netlib/SRC/slalsa.c
-@@ -946,7 +946,7 @@ f"> */
- /* Finally go through the left singular vector matrices of all */
- /* the other subproblems bottom-up on the tree. */
-
-- j = pow_ii(&c__2, &nlvl);
-+ j = pow_ii(c__2, nlvl);
- sqre = 0;
-
- for (lvl = nlvl; lvl >= 1; --lvl) {
-@@ -960,7 +960,7 @@ f"> */
- ll = 1;
- } else {
- i__1 = lvl - 1;
-- lf = pow_ii(&c__2, &i__1);
-+ lf = pow_ii(c__2, i__1);
- ll = (lf << 1) - 1;
- }
- i__1 = ll;
-@@ -1005,7 +1005,7 @@ f"> */
- ll = 1;
- } else {
- i__2 = lvl - 1;
-- lf = pow_ii(&c__2, &i__2);
-+ lf = pow_ii(c__2, i__2);
- ll = (lf << 1) - 1;
- }
- i__2 = lf;
---- a/lapack-netlib/SRC/slasd0.c
-+++ b/lapack-netlib/SRC/slasd0.c
-@@ -821,7 +821,7 @@ f"> */
- ll = 1;
- } else {
- i__1 = lvl - 1;
-- lf = pow_ii(&c__2, &i__1);
-+ lf = pow_ii(c__2, i__1);
- ll = (lf << 1) - 1;
- }
- i__1 = ll;
---- a/lapack-netlib/SRC/slasda.c
-+++ b/lapack-netlib/SRC/slasda.c
-@@ -1023,7 +1023,7 @@ f"> */
-
- /* Now conquer each subproblem bottom-up. */
-
-- j = pow_ii(&c__2, &nlvl);
-+ j = pow_ii(c__2, nlvl);
- for (lvl = nlvl; lvl >= 1; --lvl) {
- lvl2 = (lvl << 1) - 1;
-
-@@ -1035,7 +1035,7 @@ f"> */
- ll = 1;
- } else {
- i__1 = lvl - 1;
-- lf = pow_ii(&c__2, &i__1);
-+ lf = pow_ii(c__2, i__1);
- ll = (lf << 1) - 1;
- }
- i__1 = ll;
---- a/lapack-netlib/SRC/sstedc.c
-+++ b/lapack-netlib/SRC/sstedc.c
-@@ -804,10 +804,10 @@ f"> */
- lwmin = *n - 1 << 1;
- } else {
- lgn = (integer) (log((real) (*n)) / log(2.f));
-- if (pow_ii(&c__2, &lgn) < *n) {
-+ if (pow_ii(c__2, lgn) < *n) {
- ++lgn;
- }
-- if (pow_ii(&c__2, &lgn) < *n) {
-+ if (pow_ii(c__2, lgn) < *n) {
- ++lgn;
- }
- if (icompz == 1) {
---- a/lapack-netlib/SRC/zlaed0.c
-+++ b/lapack-netlib/SRC/zlaed0.c
-@@ -793,10 +793,10 @@ f"> */
-
- temp = log((doublereal) (*n)) / log(2.);
- lgn = (integer) temp;
-- if (pow_ii(&c__2, &lgn) < *n) {
-+ if (pow_ii(c__2, lgn) < *n) {
- ++lgn;
- }
-- if (pow_ii(&c__2, &lgn) < *n) {
-+ if (pow_ii(c__2, lgn) < *n) {
- ++lgn;
- }
- iprmpt = indxq + *n + 1;
---- a/lapack-netlib/SRC/zlaed7.c
-+++ b/lapack-netlib/SRC/zlaed7.c
-@@ -864,11 +864,11 @@ f"> */
- /* Form the z-vector which consists of the last row of Q_1 and the */
- /* first row of Q_2. */
-
-- ptr = pow_ii(&c__2, tlvls) + 1;
-+ ptr = pow_ii(c__2, *tlvls) + 1;
- i__1 = *curlvl - 1;
- for (i__ = 1; i__ <= i__1; ++i__) {
- i__2 = *tlvls - i__;
-- ptr += pow_ii(&c__2, &i__2);
-+ ptr += pow_ii(c__2, i__2);
- /* L10: */
- }
- curr = ptr + *curpbm;
---- a/lapack-netlib/SRC/zlalsa.c
-+++ b/lapack-netlib/SRC/zlalsa.c
-@@ -1051,7 +1051,7 @@ f"> */
- /* Finally go through the left singular vector matrices of all */
- /* the other subproblems bottom-up on the tree. */
-
-- j = pow_ii(&c__2, &nlvl);
-+ j = pow_ii(c__2, nlvl);
- sqre = 0;
-
- for (lvl = nlvl; lvl >= 1; --lvl) {
-@@ -1065,7 +1065,7 @@ f"> */
- ll = 1;
- } else {
- i__1 = lvl - 1;
-- lf = pow_ii(&c__2, &i__1);
-+ lf = pow_ii(c__2, i__1);
- ll = (lf << 1) - 1;
- }
- i__1 = ll;
-@@ -1110,7 +1110,7 @@ f"> */
- ll = 1;
- } else {
- i__2 = lvl - 1;
-- lf = pow_ii(&c__2, &i__2);
-+ lf = pow_ii(c__2, i__2);
- ll = (lf << 1) - 1;
- }
- i__2 = lf;
---- a/lapack-netlib/SRC/zstedc.c
-+++ b/lapack-netlib/SRC/zstedc.c
-@@ -836,10 +836,10 @@ f"> */
- lrwmin = *n - 1 << 1;
- } else if (icompz == 1) {
- lgn = (integer) (log((doublereal) (*n)) / log(2.));
-- if (pow_ii(&c__2, &lgn) < *n) {
-+ if (pow_ii(c__2, lgn) < *n) {
- ++lgn;
- }
-- if (pow_ii(&c__2, &lgn) < *n) {
-+ if (pow_ii(c__2, lgn) < *n) {
- ++lgn;
- }
- lwmin = *n * *n;
-
-From 91110f92d218492d0efbdc1fdf34277ca45f4b36 Mon Sep 17 00:00:00 2001
-From: Martin Kroeker <martin@ruby.chemie.uni-freiburg.de>
-Date: Wed, 14 Sep 2022 14:03:31 +0200
-Subject: [PATCH] fix missing return type in function declaration
-
---- a/ctest/c_sblat1c.c
-+++ b/ctest/c_sblat1c.c
-@@ -969,7 +969,7 @@ real *sfac;
- 1.17 };
-
- /* Local variables */
-- extern /* Subroutine */ srottest_();
-+ extern /* Subroutine */ void srottest_();
- static integer i__, k, ksize;
- extern /* Subroutine */ int stest_(), srotmtest_();
- static integer ki, kn;
-
-From 9402df5604e69f86f58953e3883f33f98c930baf Mon Sep 17 00:00:00 2001
-From: Martin Kroeker <martin@ruby.chemie.uni-freiburg.de>
-Date: Wed, 14 Sep 2022 21:44:34 +0200
-Subject: [PATCH] Fix missing external declaration
-
---- a/driver/others/blas_server_omp.c
-+++ b/driver/others/blas_server_omp.c
-@@ -69,6 +69,8 @@
-
- int blas_server_avail = 0;
-
-+extern int openblas_omp_adaptive_env();
-+
- static void * blas_thread_buffer[MAX_PARALLEL_NUMBER][MAX_CPU_NUMBER];
- #ifdef HAVE_C11
- static atomic_bool blas_buffer_inuse[MAX_PARALLEL_NUMBER];
-
-From 101a2c77c3f3610933f450cefca3e312edab2186 Mon Sep 17 00:00:00 2001
-From: Martin Kroeker <martin@ruby.chemie.uni-freiburg.de>
-Date: Thu, 15 Sep 2022 09:19:19 +0200
-Subject: [PATCH] Fix warnings
-
---- a/kernel/x86_64/dgemm_ncopy_8_skylakex.c
-+++ b/kernel/x86_64/dgemm_ncopy_8_skylakex.c
-@@ -52,18 +52,18 @@ int CNAME(BLASLONG m, BLASLONG n, FLOAT * __restrict a, BLASLONG lda, FLOAT * __
- FLOAT ctemp05, ctemp06, ctemp07, ctemp08;
- FLOAT ctemp09, ctemp10, ctemp11, ctemp12;
- FLOAT ctemp13, ctemp14, ctemp15, ctemp16;
-- FLOAT ctemp17, ctemp18, ctemp19, ctemp20;
-- FLOAT ctemp21, ctemp22, ctemp23, ctemp24;
-- FLOAT ctemp25, ctemp26, ctemp27, ctemp28;
-- FLOAT ctemp29, ctemp30, ctemp31, ctemp32;
-- FLOAT ctemp33, ctemp34, ctemp35, ctemp36;
-- FLOAT ctemp37, ctemp38, ctemp39, ctemp40;
-- FLOAT ctemp41, ctemp42, ctemp43, ctemp44;
-- FLOAT ctemp45, ctemp46, ctemp47, ctemp48;
-- FLOAT ctemp49, ctemp50, ctemp51, ctemp52;
-- FLOAT ctemp53, ctemp54, ctemp55, ctemp56;
-- FLOAT ctemp57, ctemp58, ctemp59, ctemp60;
-- FLOAT ctemp61, ctemp62, ctemp63, ctemp64;
-+ FLOAT ctemp17 /*, ctemp18, ctemp19, ctemp20*/ ;
-+ FLOAT /*ctemp21, ctemp22,*/ ctemp23, ctemp24;
-+ FLOAT ctemp25 /*, ctemp26, ctemp27, ctemp28*/ ;
-+ FLOAT /*ctemp29, ctemp30,*/ ctemp31, ctemp32;
-+ FLOAT ctemp33 /*, ctemp34, ctemp35, ctemp36*/ ;
-+ FLOAT /*ctemp37, ctemp38,*/ ctemp39, ctemp40;
-+ FLOAT ctemp41 /*, ctemp42, ctemp43, ctemp44*/ ;
-+ FLOAT /*ctemp45, ctemp46,*/ ctemp47, ctemp48;
-+ FLOAT ctemp49 /*, ctemp50, ctemp51, ctemp52*/ ;
-+ FLOAT /*ctemp53, ctemp54,*/ ctemp55, ctemp56;
-+ FLOAT ctemp57 /*, ctemp58, ctemp59, ctemp60*/ ;
-+ FLOAT /*ctemp61, ctemp62,*/ ctemp63, ctemp64;
-
-
- aoffset = a;
---- a/kernel/x86_64/omatcopy_rt.c
-+++ b/kernel/x86_64/omatcopy_rt.c
-@@ -142,7 +142,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- ,"xmm0","xmm1","xmm2","xmm3","xmm4","xmm5","xmm6","xmm7","xmm8","xmm9","xmm10","xmm11","xmm12","xmm13","xmm14","xmm15");\
- }
- int CNAME(BLASLONG rows, BLASLONG cols, FLOAT alpha, FLOAT *a, BLASLONG lda, FLOAT *b, BLASLONG ldb){
-- float *src, *dst, *dst_tmp, *src_base, *dst_base;
-+ float *src, *dst, *dst_tmp=0, *src_base, *dst_base;
- uint64_t src_ld_bytes = (uint64_t)lda * sizeof(float), dst_ld_bytes = (uint64_t)ldb * sizeof(float), num_rows = 0;
- BLASLONG cols_left, rows_done; float ALPHA = alpha;
- if(ALPHA==0.0){
-
diff --git a/sci-libs/openblas/files/openblas-0.3.21-fix-loong.patch b/sci-libs/openblas/files/openblas-0.3.21-fix-loong.patch
deleted file mode 100644
index ed112d62380b..000000000000
--- a/sci-libs/openblas/files/openblas-0.3.21-fix-loong.patch
+++ /dev/null
@@ -1,237 +0,0 @@
-https://github.com/xianyi/OpenBLAS/pull/3626
-
-From 5af7b8638b3b972bd0e25597ec07927fffd52108 Mon Sep 17 00:00:00 2001
-From: WANG Xuerui <xen0n@gentoo.org>
-Date: Fri, 13 May 2022 15:26:33 +0800
-Subject: [PATCH 1/3] Move LoongArch make rules to Makefile.loongarch64
-
----
- Makefile.loongarch64 | 5 +++--
- Makefile.system | 5 -----
- 2 files changed, 3 insertions(+), 7 deletions(-)
-
-diff --git a/Makefile.loongarch64 b/Makefile.loongarch64
-index 05ea9c679d..fced1a9462 100644
---- a/Makefile.loongarch64
-+++ b/Makefile.loongarch64
-@@ -1,3 +1,4 @@
--ifdef BINARY64
--else
-+ifeq ($(CORE), LOONGSON3R5)
-+CCOMMON_OPT += -march=loongarch64 -mabi=lp64
-+FCOMMON_OPT += -march=loongarch64 -mabi=lp64
- endif
-diff --git a/Makefile.system b/Makefile.system
-index 3be5efa0c2..9c91425b0f 100644
---- a/Makefile.system
-+++ b/Makefile.system
-@@ -895,11 +895,6 @@ ifeq ($(OSNAME), AIX)
- BINARY_DEFINED = 1
- endif
-
--ifeq ($(ARCH), loongarch64)
--CCOMMON_OPT += -march=loongarch64 -mabi=lp64
--FCOMMON_OPT += -march=loongarch64 -mabi=lp64
--endif
--
- endif
-
- ifndef BINARY_DEFINED
-
-From 869061c783d60ba0b799fab643952c493b57fb0a Mon Sep 17 00:00:00 2001
-From: WANG Xuerui <xen0n@gentoo.org>
-Date: Fri, 13 May 2022 15:53:22 +0800
-Subject: [PATCH 2/3] Probe for old-world LASX flavor on LoongArch and use
- generic DGEMM kernel otherwise
-
-See: https://bugs.gentoo.org/844013
----
- Makefile.system | 1 +
- c_check | 27 ++++++++++++++++++++++++++-
- kernel/loongarch64/KERNEL.LOONGSON3R5 | 5 +++++
- 3 files changed, 32 insertions(+), 1 deletion(-)
-
-diff --git a/Makefile.system b/Makefile.system
-index 9c91425b0f..b86aafbddb 100644
---- a/Makefile.system
-+++ b/Makefile.system
-@@ -1702,6 +1702,7 @@ export TARGET_CORE
- export NO_AVX512
- export NO_AVX2
- export BUILD_BFLOAT16
-+export NO_LASX
-
- export SBGEMM_UNROLL_M
- export SBGEMM_UNROLL_N
-diff --git a/c_check b/c_check
-index 01d4f4a7cf..a37e91f82c 100755
---- a/c_check
-+++ b/c_check
-@@ -112,7 +112,7 @@ case "$architecture" in
- defined=1
- ;;
- arm|arm64) defined=1 ;;
-- zarch|e2k|alpha|ia64|riscv64|loonarch64)
-+ zarch|e2k|alpha|ia64|riscv64|loongarch64)
- defined=1
- BINARY=64
- ;;
-@@ -240,6 +240,29 @@ if [ "$architecture" = "riscv64" ]; then
- rm -rf "$tmpd"
- fi
-
-+no_lasx=0
-+if [ "$architecture" = "loongarch64" ]; then
-+ tmpd=`mktemp -d`
-+ tmpf="$tmpd/a.c"
-+ # Old-world assembly flavor: LASX registers named "$xrNN", different
-+ # from the ISA manual which suggests "$xNN". This is the flavor we
-+ # currently support.
-+ #
-+ # As the LASX ISA manual is not out yet, we cannot predict what the
-+ # new-world flavor would look like, so do not probe flavor for now.
-+ # The compiler flags are also unsuitable for new-world gcc.
-+ code='"xvld $xr0, $a0, 0\n"'
-+ printf "int main(void){ __asm__ volatile(%s); }\n" "$code" >> "$tmpf"
-+ args=" -march=loongarch64 -mabi=lp64 -mlasx -c -o $tmpf.o $tmpf"
-+ no_lasx=0
-+ {
-+ $compiler_name $flags $args >/dev/null 2>&1
-+ } || {
-+ no_lasx=1
-+ }
-+ rm -rf "$tmpd"
-+fi
-+
- c11_atomics=0
- case "$data" in
- *HAVE_C11*)
-@@ -350,6 +373,7 @@ done
-
- [ "$makefile" = "-" ] && {
- [ "$no_rv64gv" -eq 1 ] && printf "NO_RV64GV=1\n"
-+ [ "$no_lasx" -eq 1 ] && printf "NO_LASX=1\n"
- [ "$no_avx512" -eq 1 ] && printf "NO_AVX512=1\n"
- [ "$no_avx2" -eq 1 ] && printf "NO_AVX2=1\n"
- [ "$oldgcc" -eq 1 ] && printf "OLDGCC=1\n"
-@@ -380,6 +404,7 @@ done
- printf "MSA_FLAGS=%s\n" "$msa_flags"
- }
- [ "$no_rv64gv" -eq 1 ] && printf "NO_RV64GV=1\n"
-+ [ "$no_lasx" -eq 1 ] && printf "NO_LASX=1\n"
- [ "$no_avx512" -eq 1 ] && printf "NO_AVX512=1\n"
- [ "$no_avx2" -eq 1 ] && printf "NO_AVX2=1\n"
- [ "$oldgcc" -eq 1 ] && printf "OLDGCC=1\n"
-diff --git a/kernel/loongarch64/KERNEL.LOONGSON3R5 b/kernel/loongarch64/KERNEL.LOONGSON3R5
-index cda3590402..79b57d1e4d 100644
---- a/kernel/loongarch64/KERNEL.LOONGSON3R5
-+++ b/kernel/loongarch64/KERNEL.LOONGSON3R5
-@@ -1,3 +1,7 @@
-+ifeq ($(NO_LASX), 1)
-+# No LASX support in compiler, unable to consume the optimized version
-+# leave out DGEMMKERNEL to pull in the generic version
-+else
- DGEMMKERNEL = dgemm_kernel_16x4.S
- DGEMMINCOPY = dgemm_ncopy_16.S
- DGEMMITCOPY = dgemm_tcopy_16.S
-@@ -7,6 +11,7 @@ DGEMMINCOPYOBJ = dgemm_incopy$(TSUFFIX).$(SUFFIX)
- DGEMMITCOPYOBJ = dgemm_itcopy$(TSUFFIX).$(SUFFIX)
- DGEMMONCOPYOBJ = dgemm_oncopy$(TSUFFIX).$(SUFFIX)
- DGEMMOTCOPYOBJ = dgemm_otcopy$(TSUFFIX).$(SUFFIX)
-+endif
-
- DTRSMKERNEL_LN = ../generic/trsm_kernel_LN.c
- DTRSMKERNEL_LT = ../generic/trsm_kernel_LT.c
-
-From 699c57d3767c9a5a5a69262a4b70a1f80e0bb2e2 Mon Sep 17 00:00:00 2001
-From: WANG Xuerui <xen0n@gentoo.org>
-Date: Fri, 13 May 2022 16:23:46 +0800
-Subject: [PATCH 3/3] Fix ABI CFLAGS setting on new-world LoongArch
-
-See: https://bugs.gentoo.org/844013
----
- Makefile.loongarch64 | 13 +++++++++++--
- Makefile.system | 1 +
- c_check | 14 ++++++++++++++
- 3 files changed, 26 insertions(+), 2 deletions(-)
-
-diff --git a/Makefile.loongarch64 b/Makefile.loongarch64
-index fced1a9462..d6cbe848cd 100644
---- a/Makefile.loongarch64
-+++ b/Makefile.loongarch64
-@@ -1,4 +1,13 @@
- ifeq ($(CORE), LOONGSON3R5)
--CCOMMON_OPT += -march=loongarch64 -mabi=lp64
--FCOMMON_OPT += -march=loongarch64 -mabi=lp64
-+CCOMMON_OPT += -march=loongarch64
-+FCOMMON_OPT += -march=loongarch64
-+
-+ifeq ($(LOONGARCH_CC_FLAVOR), NEW)
-+CCOMMON_OPT += -mabi=lp64d
-+FCOMMON_OPT += -mabi=lp64d
-+endif
-+ifeq ($(LOONGARCH_CC_FLAVOR), OLD)
-+CCOMMON_OPT += -mabi=lp64
-+FCOMMON_OPT += -mabi=lp64
-+endif
- endif
-diff --git a/Makefile.system b/Makefile.system
-index b86aafbddb..4360a861cb 100644
---- a/Makefile.system
-+++ b/Makefile.system
-@@ -1702,6 +1702,7 @@ export TARGET_CORE
- export NO_AVX512
- export NO_AVX2
- export BUILD_BFLOAT16
-+export LOONGARCH_CC_FLAVOR
- export NO_LASX
-
- export SBGEMM_UNROLL_M
-diff --git a/c_check b/c_check
-index a37e91f82c..573f0e52fd 100755
---- a/c_check
-+++ b/c_check
-@@ -240,8 +240,19 @@ if [ "$architecture" = "riscv64" ]; then
- rm -rf "$tmpd"
- fi
-
-+loongarch_cc_flavor=""
- no_lasx=0
- if [ "$architecture" = "loongarch64" ]; then
-+ # Currently there are only 2 flavors: new-world and old-world.
-+ # They differ in ABI names accepted, so check it to avoid creating temp
-+ # files.
-+ loongarch_cc_flavor="NEW"
-+ {
-+ $compiler_name -mabi=lp64d -E -o - /dev/null >/dev/null 2>&1
-+ } || {
-+ loongarch_cc_flavor="OLD"
-+ }
-+
- tmpd=`mktemp -d`
- tmpf="$tmpd/a.c"
- # Old-world assembly flavor: LASX registers named "$xrNN", different
-@@ -260,6 +271,7 @@ if [ "$architecture" = "loongarch64" ]; then
- } || {
- no_lasx=1
- }
-+
- rm -rf "$tmpd"
- fi
-
-@@ -377,6 +389,7 @@ done
- [ "$no_avx512" -eq 1 ] && printf "NO_AVX512=1\n"
- [ "$no_avx2" -eq 1 ] && printf "NO_AVX2=1\n"
- [ "$oldgcc" -eq 1 ] && printf "OLDGCC=1\n"
-+ [ -n "$loongarch_cc_flavor" ] && printf "LOONGARCH_CC_FLAVOR=%s\n" "$loongarch_cc_flavor"
- exit 0
- }
-
-@@ -408,6 +421,7 @@ done
- [ "$no_avx512" -eq 1 ] && printf "NO_AVX512=1\n"
- [ "$no_avx2" -eq 1 ] && printf "NO_AVX2=1\n"
- [ "$oldgcc" -eq 1 ] && printf "OLDGCC=1\n"
-+ [ -n "$loongarch_cc_flavor" ] && printf "LOONGARCH_CC_FLAVOR=%s\n" "$loongarch_cc_flavor"
- } >> "$makefile"
-
- os=`echo "$os" | tr '[[:lower:]]' '[[:upper:]]'/ `
diff --git a/sci-libs/openblas/files/openblas-0.3.23-parallel-make.patch b/sci-libs/openblas/files/openblas-0.3.23-parallel-make.patch
deleted file mode 100644
index ce0487a6b2c0..000000000000
--- a/sci-libs/openblas/files/openblas-0.3.23-parallel-make.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From 281e834566a06f1c756d262dc31e809faaf8933f Mon Sep 17 00:00:00 2001
-From: Guillaume Horel <guillaume.horel@gmail.com>
-Date: Thu, 30 Mar 2023 15:15:25 -0400
-Subject: [PATCH 1/2] do not pass -j flag to the MAKE variable
-
----
- getarch.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/getarch.c b/getarch.c
-index 937a8db68c..87384c0840 100644
---- a/getarch.c
-+++ b/getarch.c
-@@ -1930,15 +1930,15 @@ printf("ELF_VERSION=2\n");
-
- #ifdef MAKE_NB_JOBS
- #if MAKE_NB_JOBS > 0
-- printf("MAKE += -j %d\n", MAKE_NB_JOBS);
-+ printf("MAKEFLAGS += -j %d\n", MAKE_NB_JOBS);
- #else
- // Let make use parent -j argument or -j1 if there
- // is no make parent
- #endif
- #elif NO_PARALLEL_MAKE==1
-- printf("MAKE += -j 1\n");
-+ printf("MAKEFLAGS += -j 1\n");
- #else
-- printf("MAKE += -j %d\n", get_num_cores());
-+ printf("MAKEFLAGS += -j %d\n", get_num_cores());
- #endif
-
- break;
-
-From 397108fba299c87ce17957452d57469af914f516 Mon Sep 17 00:00:00 2001
-From: Guillaume Horel <guillaume.horel@gmail.com>
-Date: Fri, 31 Mar 2023 09:22:40 -0400
-Subject: [PATCH 2/2] serialize shared prerequisites
-
----
- Makefile | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 144b3400db..3c4b8948af 100644
---- a/Makefile
-+++ b/Makefile
-@@ -40,9 +40,9 @@ LAPACK_NOOPT := $(filter-out -O0 -O1 -O2 -O3 -Ofast -O -Og -Os,$(LAPACK_FFLAGS))
- SUBDIRS_ALL = $(SUBDIRS) test ctest utest exports benchmark ../laswp ../bench cpp_thread_test
-
- .PHONY : all libs netlib $(RELA) test ctest shared install
--.NOTPARALLEL : all libs $(RELA) prof lapack-test install blas-test
-+.NOTPARALLEL : shared
-
--all :: libs netlib $(RELA) tests shared
-+all :: tests
- @echo
- @echo " OpenBLAS build complete. ($(LIB_COMPONENTS))"
- @echo
-@@ -150,7 +150,7 @@ ifeq ($(OSNAME), CYGWIN_NT)
- endif
- endif
-
--tests : libs netlib $(RELA) shared
-+tests : shared
- ifeq ($(NOFORTRAN), $(filter 0,$(NOFORTRAN)))
- touch $(LIBNAME)
- ifndef NO_FBLAS
diff --git a/sci-libs/openblas/openblas-0.3.21-r1.ebuild b/sci-libs/openblas/openblas-0.3.21-r1.ebuild
deleted file mode 100644
index c5a1707e33da..000000000000
--- a/sci-libs/openblas/openblas-0.3.21-r1.ebuild
+++ /dev/null
@@ -1,197 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit fortran-2 toolchain-funcs
-
-DESCRIPTION="Optimized BLAS library based on GotoBLAS2"
-HOMEPAGE="https://github.com/xianyi/OpenBLAS"
-SRC_URI="https://github.com/xianyi/OpenBLAS/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-S="${WORKDIR}"/OpenBLAS-${PV}
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="amd64 ~arm ~arm64 ~loong ~riscv ~x86 ~amd64-linux ~x86-linux ~x64-macos"
-IUSE="dynamic eselect-ldso index-64bit openmp pthread relapack test"
-REQUIRED_USE="?? ( openmp pthread )"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
- eselect-ldso? (
- >=app-eselect/eselect-blas-0.2
- >=app-eselect/eselect-lapack-0.2
- )
-"
-BDEPEND="virtual/pkgconfig"
-
-PATCHES=(
- "${FILESDIR}/${PN}-0.3.12-shared-blas-lapack.patch"
- "${FILESDIR}/${PN}-0.3.21-fix-loong.patch"
- "${FILESDIR}/${P}-clang16.patch"
-)
-
-pkg_pretend() {
- [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
-
- elog "This software has a massive number of options that"
- elog "are configurable and it is *impossible* for all of"
- elog "those to fit inside any manageable ebuild."
- elog "The Gentoo provided package has enough to build"
- elog "a fully optimized library for your targeted CPU."
- elog "You can set the CPU target using the environment"
- elog "variable - OPENBLAS_TARGET or it will be detected"
- elog "automatically from the target toolchain (supports"
- elog "cross compilation toolchains)."
- elog "You can control the maximum number of threads"
- elog "using OPENBLAS_NTHREAD, default=64 and number of "
- elog "parallel calls to allow before further calls wait"
- elog "using OPENBLAS_NPARALLEL, default=8."
-}
-
-pkg_setup() {
- fortran-2_pkg_setup
-
- # List of most configurable options - Makefile.rule
-
- # https://github.com/xianyi/OpenBLAS/pull/2663
- tc-export CC FC LD AR AS RANLIB
-
- # HOSTCC is used for scripting
- export HOSTCC="$(tc-getBUILD_CC)"
-
- # threading options
- [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
- USE_THREAD=0
- if use openmp; then
- USE_THREAD=1; USE_OPENMP=1;
- elif use pthread; then
- USE_THREAD=1; USE_OPENMP=0;
- fi
- export USE_THREAD USE_OPENMP
-
- # disable submake with -j and default optimization flags
- # in Makefile.system
- # Makefile.rule says to not modify COMMON_OPT/FCOMMON_OPT...
- export MAKE_NB_JOBS=-1 \
- COMMON_OPT=" " \
- FCOMMON_OPT=" "
-
- # Target CPU ARCH options
- # generally detected automatically from cross toolchain
- use dynamic && \
- export DYNAMIC_ARCH=1 \
- NO_AFFINITY=1 \
- TARGET=GENERIC
-
- export NUM_PARALLEL=${OPENBLAS_NPARALLEL:-8} \
- NUM_THREADS=${OPENBLAS_NTHREAD:-64}
-
- # setting OPENBLAS_TARGET to override auto detection
- # in case the toolchain is not enough to detect
- # https://github.com/xianyi/OpenBLAS/blob/develop/TargetList.txt
- if ! use dynamic && [[ ! -z "${OPENBLAS_TARGET}" ]] ; then
- export TARGET="${OPENBLAS_TARGET}"
- fi
-
- export NO_STATIC=1
-
- BUILD_RELAPACK=1
- if ! use relapack; then
- BUILD_RELAPACK=0
- fi
-
- export PREFIX="${EPREFIX}/usr" BUILD_RELAPACK
-}
-
-src_prepare() {
- default
-
- # Don't build the tests as part of "make all". We'll do
- # it explicitly later if the test phase is enabled.
- sed -e "/^all ::/s/tests //" -i Makefile || die
-
- # if 64bit-index is needed, create second library
- # with LIBPREFIX=libopenblas64
- if use index-64bit; then
- cp -aL "${S}" "${S}-index-64bit" || die
- fi
-}
-
-src_compile() {
- default
- cd interface || die
- emake shared-blas-lapack
-
- if use index-64bit; then
- emake -C"${S}-index-64bit" \
- INTERFACE64=1 \
- LIBPREFIX=libopenblas64
- fi
-}
-
-src_test() {
- emake tests
-}
-
-src_install() {
- emake install DESTDIR="${D}" \
- OPENBLAS_INCLUDE_DIR='$(PREFIX)'/include/${PN} \
- OPENBLAS_LIBRARY_DIR='$(PREFIX)'/$(get_libdir)
-
- dodoc GotoBLAS_*.txt *.md Changelog.txt
-
- if use index-64bit; then
- dolib.so "${S}-index-64bit"/libopenblas64*.so*
- fi
-
- if use eselect-ldso; then
- insinto /usr/$(get_libdir)/blas/openblas/
- doins interface/libblas.so.3
- dosym libblas.so.3 usr/$(get_libdir)/blas/openblas/libblas.so
- doins interface/libcblas.so.3
- dosym libcblas.so.3 usr/$(get_libdir)/blas/openblas/libcblas.so
-
- insinto /usr/$(get_libdir)/lapack/openblas/
- doins interface/liblapack.so.3
- dosym liblapack.so.3 usr/$(get_libdir)/lapack/openblas/liblapack.so
- doins interface/liblapacke.so.3
- dosym liblapacke.so.3 usr/$(get_libdir)/lapack/openblas/liblapacke.so
- fi
-}
-
-pkg_postinst() {
- use eselect-ldso || return
- local libdir=$(get_libdir) me="openblas"
-
- # check blas
- eselect blas add ${libdir} "${EROOT}"/usr/${libdir}/blas/${me} ${me}
- local current_blas=$(eselect blas show ${libdir} | cut -d' ' -f2)
- if [[ ${current_blas} == "${me}" || -z ${current_blas} ]]; then
- eselect blas set ${libdir} ${me}
- elog "Current eselect: BLAS/CBLAS ($libdir) -> [${current_blas}]."
- else
- elog "Current eselect: BLAS/CBLAS ($libdir) -> [${current_blas}]."
- elog "To use blas [${me}] implementation, you have to issue (as root):"
- elog "\t eselect blas set ${libdir} ${me}"
- fi
-
- # check lapack
- eselect lapack add ${libdir} "${EROOT}"/usr/${libdir}/lapack/${me} ${me}
- local current_lapack=$(eselect lapack show ${libdir} | cut -d' ' -f2)
- if [[ ${current_lapack} == "${me}" || -z ${current_lapack} ]]; then
- eselect lapack set ${libdir} ${me}
- elog "Current eselect: LAPACK ($libdir) -> [${current_lapack}]."
- else
- elog "Current eselect: LAPACK ($libdir) -> [${current_lapack}]."
- elog "To use lapack [${me}] implementation, you have to issue (as root):"
- elog "\t eselect lapack set ${libdir} ${me}"
- fi
-}
-
-pkg_postrm() {
- if use eselect-ldso; then
- eselect blas validate
- eselect lapack validate
- fi
-}
diff --git a/sci-libs/openblas/openblas-0.3.23.ebuild b/sci-libs/openblas/openblas-0.3.23.ebuild
deleted file mode 100644
index 77e8c99cc2f2..000000000000
--- a/sci-libs/openblas/openblas-0.3.23.ebuild
+++ /dev/null
@@ -1,199 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit flag-o-matic fortran-2 toolchain-funcs
-
-DESCRIPTION="Optimized BLAS library based on GotoBLAS2"
-HOMEPAGE="https://github.com/xianyi/OpenBLAS"
-SRC_URI="https://github.com/xianyi/OpenBLAS/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-S="${WORKDIR}"/OpenBLAS-${PV}
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="amd64 ~arm ~arm64 ~loong ~riscv ~x86 ~amd64-linux ~x86-linux ~x64-macos"
-IUSE="dynamic eselect-ldso index-64bit openmp pthread relapack test"
-REQUIRED_USE="?? ( openmp pthread )"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
- eselect-ldso? (
- >=app-eselect/eselect-blas-0.2
- >=app-eselect/eselect-lapack-0.2
- )
-"
-BDEPEND="virtual/pkgconfig"
-
-PATCHES=(
- "${FILESDIR}/${PN}-0.3.23-shared-blas-lapack.patch"
- "${FILESDIR}/${PN}-0.3.21-fix-loong.patch"
- "${FILESDIR}/${PN}-0.3.23-parallel-make.patch"
-)
-
-pkg_pretend() {
- [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
-
- elog "This software has a massive number of options that"
- elog "are configurable and it is *impossible* for all of"
- elog "those to fit inside any manageable ebuild."
- elog "The Gentoo provided package has enough to build"
- elog "a fully optimized library for your targeted CPU."
- elog "You can set the CPU target using the environment"
- elog "variable - OPENBLAS_TARGET or it will be detected"
- elog "automatically from the target toolchain (supports"
- elog "cross compilation toolchains)."
- elog "You can control the maximum number of threads"
- elog "using OPENBLAS_NTHREAD, default=64 and number of "
- elog "parallel calls to allow before further calls wait"
- elog "using OPENBLAS_NPARALLEL, default=8."
-}
-
-pkg_setup() {
- fortran-2_pkg_setup
-
- # List of most configurable options - Makefile.rule
-
- # not an easy fix, https://github.com/xianyi/OpenBLAS/issues/4128
- filter-lto
-
- # https://github.com/xianyi/OpenBLAS/pull/2663
- tc-export CC FC LD AR AS RANLIB
-
- # HOSTCC is used for scripting
- export HOSTCC="$(tc-getBUILD_CC)"
-
- # threading options
- [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
- USE_THREAD=0
- if use openmp; then
- USE_THREAD=1; USE_OPENMP=1;
- elif use pthread; then
- USE_THREAD=1; USE_OPENMP=0;
- fi
- export USE_THREAD USE_OPENMP
-
- # disable submake with -j and default optimization flags
- # in Makefile.system
- # Makefile.rule says to not modify COMMON_OPT/FCOMMON_OPT...
- export MAKE_NB_JOBS=-1 \
- COMMON_OPT=" " \
- FCOMMON_OPT=" "
-
- # Target CPU ARCH options
- # generally detected automatically from cross toolchain
- use dynamic && \
- export DYNAMIC_ARCH=1 \
- NO_AFFINITY=1 \
- TARGET=GENERIC
-
- export NUM_PARALLEL=${OPENBLAS_NPARALLEL:-8} \
- NUM_THREADS=${OPENBLAS_NTHREAD:-64}
-
- # setting OPENBLAS_TARGET to override auto detection
- # in case the toolchain is not enough to detect
- # https://github.com/xianyi/OpenBLAS/blob/develop/TargetList.txt
- if ! use dynamic && [[ ! -z "${OPENBLAS_TARGET}" ]] ; then
- export TARGET="${OPENBLAS_TARGET}"
- fi
-
- export NO_STATIC=1
-
- BUILD_RELAPACK=1
- if ! use relapack; then
- BUILD_RELAPACK=0
- fi
-
- export PREFIX="${EPREFIX}/usr" BUILD_RELAPACK
-}
-
-src_prepare() {
- default
-
- # Don't build the tests as part of "make all". We'll do
- # it explicitly later if the test phase is enabled.
- sed -e "/^all ::/s/tests //" -i Makefile || die
-
- # if 64bit-index is needed, create second library
- # with LIBPREFIX=libopenblas64
- if use index-64bit; then
- cp -aL "${S}" "${S}-index-64bit" || die
- fi
-}
-
-src_compile() {
- emake shared
- use eselect-ldso && emake -C interface shared-blas-lapack
-
- if use index-64bit; then
- emake -C"${S}-index-64bit" \
- INTERFACE64=1 \
- LIBPREFIX=libopenblas64
- fi
-}
-
-src_test() {
- emake tests
-}
-
-src_install() {
- emake install DESTDIR="${D}" \
- OPENBLAS_INCLUDE_DIR='$(PREFIX)'/include/${PN} \
- OPENBLAS_LIBRARY_DIR='$(PREFIX)'/$(get_libdir)
-
- dodoc GotoBLAS_*.txt *.md Changelog.txt
-
- if use index-64bit; then
- dolib.so "${S}-index-64bit"/libopenblas64*.so*
- fi
-
- if use eselect-ldso; then
- insinto /usr/$(get_libdir)/blas/openblas/
- doins interface/libblas.so.3
- dosym libblas.so.3 usr/$(get_libdir)/blas/openblas/libblas.so
- doins interface/libcblas.so.3
- dosym libcblas.so.3 usr/$(get_libdir)/blas/openblas/libcblas.so
-
- insinto /usr/$(get_libdir)/lapack/openblas/
- doins interface/liblapack.so.3
- dosym liblapack.so.3 usr/$(get_libdir)/lapack/openblas/liblapack.so
- doins interface/liblapacke.so.3
- dosym liblapacke.so.3 usr/$(get_libdir)/lapack/openblas/liblapacke.so
- fi
-}
-
-pkg_postinst() {
- use eselect-ldso || return
- local libdir=$(get_libdir) me="openblas"
-
- # check blas
- eselect blas add ${libdir} "${EROOT}"/usr/${libdir}/blas/${me} ${me}
- local current_blas=$(eselect blas show ${libdir} | cut -d' ' -f2)
- if [[ ${current_blas} == "${me}" || -z ${current_blas} ]]; then
- eselect blas set ${libdir} ${me}
- elog "Current eselect: BLAS/CBLAS ($libdir) -> [${current_blas}]."
- else
- elog "Current eselect: BLAS/CBLAS ($libdir) -> [${current_blas}]."
- elog "To use blas [${me}] implementation, you have to issue (as root):"
- elog "\t eselect blas set ${libdir} ${me}"
- fi
-
- # check lapack
- eselect lapack add ${libdir} "${EROOT}"/usr/${libdir}/lapack/${me} ${me}
- local current_lapack=$(eselect lapack show ${libdir} | cut -d' ' -f2)
- if [[ ${current_lapack} == "${me}" || -z ${current_lapack} ]]; then
- eselect lapack set ${libdir} ${me}
- elog "Current eselect: LAPACK ($libdir) -> [${current_lapack}]."
- else
- elog "Current eselect: LAPACK ($libdir) -> [${current_lapack}]."
- elog "To use lapack [${me}] implementation, you have to issue (as root):"
- elog "\t eselect lapack set ${libdir} ${me}"
- fi
-}
-
-pkg_postrm() {
- if use eselect-ldso; then
- eselect blas validate
- eselect lapack validate
- fi
-}
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-03-04 11:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-08 0:56 [gentoo-commits] repo/gentoo:master commit in: sci-libs/openblas/, sci-libs/openblas/files/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2024-03-04 11:38 Sam James
2022-11-22 23:42 Sam James
2022-11-12 12:05 Michael Orlitzky
2020-06-11 23:26 Michael Orlitzky
2019-07-06 15:48 Benda XU
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox