* [gentoo-commits] repo/gentoo:master commit in: sci-libs/openblas/files/, sci-libs/openblas/
@ 2020-09-18 23:25 Sam James
0 siblings, 0 replies; 6+ messages in thread
From: Sam James @ 2020-09-18 23:25 UTC (permalink / raw
To: gentoo-commits
commit: 5bffd74cd9fafa37de16fe2e30090b80b677b575
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 18 23:19:02 2020 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Sep 18 23:25:00 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5bffd74c
sci-libs/openblas: bump to 0.3.10
Closes: https://bugs.gentoo.org/727944
Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Sam James <sam <AT> gentoo.org>
sci-libs/openblas/Manifest | 1 +
.../openblas-0.3.10-dont-clobber-fflags.patch | 26 ++++
sci-libs/openblas/openblas-0.3.10.ebuild | 143 +++++++++++++++++++++
3 files changed, 170 insertions(+)
diff --git a/sci-libs/openblas/Manifest b/sci-libs/openblas/Manifest
index 25f4e19af1a..e9163333248 100644
--- a/sci-libs/openblas/Manifest
+++ b/sci-libs/openblas/Manifest
@@ -1 +1,2 @@
+DIST openblas-0.3.10.tar.gz 12246979 BLAKE2B 507aa3f058b841f477720cff98480afda5c3e236b688fb1a12ff45ce20c42c6e84c786d62a5db7e6de6d133d40286e58777fcb51d6542b7030629d55ba12086f SHA512 64a5f983b2f6e02cdb6e0f14433498cc5daa1ccfb49246f7a2dcd38f9982fa608f2abea069fe0e35012af8c1441c43d1f6418eaccd40795f5002fed1c36ce05d
DIST openblas-0.3.9.tar.gz 12189745 BLAKE2B 3cc4c6a403d6a52845cf4ff8cef254f57587e17e3d09bfb6ed7c02ad06a6002e50b340177c73a944c2a621c12b7f494c516025751c194d019662c0b4db17f4dc SHA512 c6b8ee465f1cf53b37f21ec3ff9a28d5cafe20fec59d8c1bff5923a9e1989dfa5ae8c032a5d43988fe7722ed08c64c7957a3d30e6ae917e2e7aa2977a91e67a3
diff --git a/sci-libs/openblas/files/openblas-0.3.10-dont-clobber-fflags.patch b/sci-libs/openblas/files/openblas-0.3.10-dont-clobber-fflags.patch
new file mode 100644
index 00000000000..4890b7377ab
--- /dev/null
+++ b/sci-libs/openblas/files/openblas-0.3.10-dont-clobber-fflags.patch
@@ -0,0 +1,26 @@
+Rebased version of previous patch below.
+----
+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
+diff --git a/Makefile b/Makefile
+index e113026..dd8b655 100644
+--- a/Makefile
++++ b/Makefile
+@@ -263,7 +263,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 "FFLAGS_DRV = $(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
diff --git a/sci-libs/openblas/openblas-0.3.10.ebuild b/sci-libs/openblas/openblas-0.3.10.ebuild
new file mode 100644
index 00000000000..9d96c6fa9fd
--- /dev/null
+++ b/sci-libs/openblas/openblas-0.3.10.ebuild
@@ -0,0 +1,143 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic fortran-2 toolchain-funcs
+
+DESCRIPTION="Optimized BLAS library based on GotoBLAS2"
+HOMEPAGE="http://xianyi.github.com/OpenBLAS/"
+SRC_URI="https://github.com/xianyi/OpenBLAS/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="dynamic eselect-ldso index-64bit openmp pthread test"
+REQUIRED_USE="?? ( openmp pthread )"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ eselect-ldso? ( >=app-eselect/eselect-blas-0.2
+ !app-eselect/eselect-cblas
+ >=app-eselect/eselect-lapack-0.2 )"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}/shared-blas-lapack.patch"
+ "${FILESDIR}/${PN}-0.3.10-dont-clobber-fflags.patch"
+)
+
+pkg_setup() {
+ fortran-2_pkg_setup
+ use openmp && tc-check-openmp
+
+ # We need to filter these while building the library, and not just
+ # while building the test suite. Will hopefully get fixed upstream:
+ # https://github.com/xianyi/OpenBLAS/issues/2657
+ use test && filter-flags "-fbounds-check" "-fcheck=bounds" "-fcheck=all"
+
+ export CC=$(tc-getCC) FC=$(tc-getFC)
+
+ use dynamic && \
+ export DYNAMIC_ARCH=1 TARGET=GENERIC NUM_THREADS=64 NO_AFFINITY=1
+
+ # disable submake with -j
+ export MAKE_NB_JOBS=-1
+
+ # Set these to "nothing" to prevent the default optimization flags
+ # from being added in Makefile.system.
+ export COMMON_OPT=" " FCOMMON_OPT=" "
+
+ 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
+
+ export PREFIX="${EPREFIX}/usr"
+}
+
+src_unpack() {
+ default
+
+ mv "${WORKDIR}"/*OpenBLAS* "${S}" || die
+
+ if use index-64bit; then
+ cp -aL "${S}" "${S}-index-64bit" || die
+ fi
+}
+
+src_compile() {
+ # We have to try extra hard to override AR for now.
+ # https://github.com/xianyi/OpenBLAS/issues/2654
+ emake AR="$(tc-getAR)"
+ emake AR="$(tc-getAR)" -Cinterface 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="${ED}" OPENBLAS_INCLUDE_DIR='$(PREFIX)'/include/${PN} \
+ OPENBLAS_LIBRARY_DIR='$(PREFIX)'/$(get_libdir)
+ dodoc GotoBLAS_*.txt *.md Changelog.txt
+
+ 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
+ fi
+
+ if use index-64bit; then
+ insinto /usr/$(get_libdir)/
+ dolib.so "${S}-index-64bit"/libopenblas64*.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/files/, sci-libs/openblas/
@ 2020-10-29 20:16 Sam James
0 siblings, 0 replies; 6+ messages in thread
From: Sam James @ 2020-10-29 20:16 UTC (permalink / raw
To: gentoo-commits
commit: bb8882671371c6fe665f279a4f41fd0199d28903
Author: Aisha Tammy <gentoo <AT> aisha <DOT> cc>
AuthorDate: Wed Oct 21 21:17:02 2020 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Oct 29 20:02:59 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bb888267
sci-libs/openblas: version bump to 0.3.12
fix export of toolchain variables
fix using BUILDCC for doing local scripting work
fix building of tests on cross compile
add options to manipulate threading and parallel calls
fix up patch to latest
add building of lapacke library
add option to build relapack extension
Closes: https://bugs.gentoo.org/749921
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/17993
Signed-off-by: Sam James <sam <AT> gentoo.org>
sci-libs/openblas/Manifest | 1 +
.../files/openblas-0.3.12-shared-blas-lapack.patch | 36 ++++
sci-libs/openblas/metadata.xml | 3 +
sci-libs/openblas/openblas-0.3.12.ebuild | 196 +++++++++++++++++++++
4 files changed, 236 insertions(+)
diff --git a/sci-libs/openblas/Manifest b/sci-libs/openblas/Manifest
index e9163333248..13a601adbee 100644
--- a/sci-libs/openblas/Manifest
+++ b/sci-libs/openblas/Manifest
@@ -1,2 +1,3 @@
DIST openblas-0.3.10.tar.gz 12246979 BLAKE2B 507aa3f058b841f477720cff98480afda5c3e236b688fb1a12ff45ce20c42c6e84c786d62a5db7e6de6d133d40286e58777fcb51d6542b7030629d55ba12086f SHA512 64a5f983b2f6e02cdb6e0f14433498cc5daa1ccfb49246f7a2dcd38f9982fa608f2abea069fe0e35012af8c1441c43d1f6418eaccd40795f5002fed1c36ce05d
+DIST openblas-0.3.12.tar.gz 12325103 BLAKE2B 3d6706e59e83f87dd58b287753bf697de99e83c8a4484453f120d8f8c9c69ea5b481a143db04342a1dcb1779ce548a49618cf4941d08d636e12ed481305e8fb5 SHA512 1ff5a065c41f7e460857f8428fc77900b189f051fa8129eea9ae93237f234d387cc1c6e627c2c95636164f512d4d721d4229729f04a04e8d5f655abbf5463d98
DIST openblas-0.3.9.tar.gz 12189745 BLAKE2B 3cc4c6a403d6a52845cf4ff8cef254f57587e17e3d09bfb6ed7c02ad06a6002e50b340177c73a944c2a621c12b7f494c516025751c194d019662c0b4db17f4dc SHA512 c6b8ee465f1cf53b37f21ec3ff9a28d5cafe20fec59d8c1bff5923a9e1989dfa5ae8c032a5d43988fe7722ed08c64c7957a3d30e6ae917e2e7aa2977a91e67a3
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
new file mode 100644
index 00000000000..68a54cf1505
--- /dev/null
+++ b/sci-libs/openblas/files/openblas-0.3.12-shared-blas-lapack.patch
@@ -0,0 +1,36 @@
+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,libblas.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/metadata.xml b/sci-libs/openblas/metadata.xml
index 0661dad2eee..0f6a98c1f26 100644
--- a/sci-libs/openblas/metadata.xml
+++ b/sci-libs/openblas/metadata.xml
@@ -33,6 +33,9 @@
<flag name="pthread">
Build with pthread threading model
</flag>
+ <flag name="relapack">
+ Build the ReLAPACK extension to OpenBLAS
+ </flag>
</use>
<upstream>
<remote-id type="github">xianyi/OpenBLAS</remote-id>
diff --git a/sci-libs/openblas/openblas-0.3.12.ebuild b/sci-libs/openblas/openblas-0.3.12.ebuild
new file mode 100644
index 00000000000..b9d0d023fb5
--- /dev/null
+++ b/sci-libs/openblas/openblas-0.3.12.ebuild
@@ -0,0 +1,196 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic fortran-2 toolchain-funcs
+
+DESCRIPTION="Optimized BLAS library based on GotoBLAS2"
+HOMEPAGE="http://xianyi.github.com/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 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-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.10-dont-clobber-fflags.patch"
+)
+
+pkg_pretend() {
+ 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
+ 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
+
+ # We need to filter these while building the library, and not just
+ # while building the test suite. Will hopefully get fixed upstream:
+ # https://github.com/xianyi/OpenBLAS/issues/2657
+ use test && filter-flags "-fbounds-check" "-fcheck=bounds" "-fcheck=all"
+
+ # 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
+ # disable tests by default
+ 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
+ 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/files/, sci-libs/openblas/
@ 2022-04-27 21:18 Jakov Smolić
0 siblings, 0 replies; 6+ messages in thread
From: Jakov Smolić @ 2022-04-27 21:18 UTC (permalink / raw
To: gentoo-commits
commit: 47b90dedf06234195ea5eb701633396e0acb2687
Author: Han Gao <rabenda.cn <AT> gmail <DOT> com>
AuthorDate: Wed Apr 27 16:15:35 2022 +0000
Commit: Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
CommitDate: Wed Apr 27 21:18:24 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=47b90ded
sci-libs/openblas: fix riscv detect
Bug: https://bugs.gentoo.org/837806
Signed-off-by: Han Gao <rabenda.cn <AT> gmail.com>
Signed-off-by: Jakov Smolić <jsmolic <AT> gentoo.org>
.../openblas/files/openblas-0.3.20-fix-riscv.patch | 116 +++++++++++++++++++++
sci-libs/openblas/openblas-0.3.20.ebuild | 1 +
2 files changed, 117 insertions(+)
diff --git a/sci-libs/openblas/files/openblas-0.3.20-fix-riscv.patch b/sci-libs/openblas/files/openblas-0.3.20-fix-riscv.patch
new file mode 100644
index 000000000000..9a14180cb85d
--- /dev/null
+++ b/sci-libs/openblas/files/openblas-0.3.20-fix-riscv.patch
@@ -0,0 +1,116 @@
+Bug: https://bugs.gentoo.org/837806
+From https://github.com/xianyi/OpenBLAS/pull/3613
+
+From 3fc52ebcfb80e01f753938fd314ca07b2c085767 Mon Sep 17 00:00:00 2001
+From: Han Gao <gaohan@uniontech.com>
+Date: Wed, 27 Apr 2022 01:34:55 +0800
+Subject: [PATCH 1/2] Fix other arch build in detect.
+
+When CORE is empty, use -march=loongson3a. Fix it.
+
+Signed-off-by: Han Gao <gaohan@uniontech.com>
+---
+ Makefile.system | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.system b/Makefile.system
+index ac60eae5b6..1104893b55 100644
+--- a/Makefile.system
++++ b/Makefile.system
+@@ -847,7 +847,7 @@ CCOMMON_OPT += -mabi=32
+ BINARY_DEFINED = 1
+ endif
+
+-ifeq ($(CORE), $(filter $(CORE),LOONGSON3R3 LOONGSON3R4))
++ifneq (, $(filter $(CORE),LOONGSON3R3 LOONGSON3R4))
+ CCOMMON_OPT += -march=loongson3a
+ FCOMMON_OPT += -march=loongson3a
+ endif
+
+From 8123324c99ba69ce23b4028468313663001a76c6 Mon Sep 17 00:00:00 2001
+From: Han Gao <gaohan@uniontech.com>
+Date: Wed, 27 Apr 2022 02:29:43 +0800
+Subject: [PATCH 2/2] Fix riscv64 arch detect
+
+Signed-off-by: Han Gao <gaohan@uniontech.com>
+---
+ cpuid_riscv64.c | 18 +++++++++---------
+ getarch.c | 4 ++--
+ 2 files changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/cpuid_riscv64.c b/cpuid_riscv64.c
+index 0eb50e0018..2aa4217816 100644
+--- a/cpuid_riscv64.c
++++ b/cpuid_riscv64.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+-Copyright (c) 2011-2014, The OpenBLAS Project
++Copyright (c) 2011-2022, The OpenBLAS Project
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+@@ -13,9 +13,9 @@ modification, are permitted provided that the following conditions are
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+- 3. Neither the name of the OpenBLAS project nor the names of
+- its contributors may be used to endorse or promote products
+- derived from this software without specific prior written
++ 3. Neither the name of the OpenBLAS project nor the names of
++ its contributors may be used to endorse or promote products
++ derived from this software without specific prior written
+ permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+@@ -70,16 +70,16 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ /* or implied, of The University of Texas at Austin. */
+ /*********************************************************************/
+
+-#define CPU_UNKNOWN 0
+-#define CPU_C910V 1
++#define CPU_GENERIC 0
++#define CPU_C910V 1
+
+ static char *cpuname[] = {
+- "UNKOWN",
++ "RISCV64_GENERIC",
+ "C910V"
+ };
+
+ int detect(void){
+- return CPU_UNKNOWN;
++ return CPU_GENERIC;
+ }
+
+ char *get_corename(void){
+@@ -98,7 +98,7 @@ void get_subdirname(void){
+ }
+
+ void get_cpuconfig(void){
+- printf("#define UNKNOWN\n");
++ printf("#define %s\n", cpuname[detect()]);
+ printf("#define L1_DATA_SIZE 65536\n");
+ printf("#define L1_DATA_LINESIZE 32\n");
+ printf("#define L2_SIZE 512488\n");
+diff --git a/getarch.c b/getarch.c
+index 4af986fb3b..f4590769d9 100644
+--- a/getarch.c
++++ b/getarch.c
+@@ -1731,7 +1731,7 @@ int main(int argc, char *argv[]){
+ #ifdef FORCE
+ printf("CORE=%s\n", CORENAME);
+ #else
+-#if defined(INTEL_AMD) || defined(POWER) || defined(__mips__) || defined(__arm__) || defined(__aarch64__) || defined(ZARCH) || defined(sparc) || defined(__loongarch__)
++#if defined(INTEL_AMD) || defined(POWER) || defined(__mips__) || defined(__arm__) || defined(__aarch64__) || defined(ZARCH) || defined(sparc) || defined(__loongarch__) || defined(__riscv)
+ printf("CORE=%s\n", get_corename());
+ #endif
+ #endif
+@@ -1879,7 +1879,7 @@ printf("ELF_VERSION=2\n");
+ #ifdef FORCE
+ printf("#define CHAR_CORENAME \"%s\"\n", CORENAME);
+ #else
+-#if defined(INTEL_AMD) || defined(POWER) || defined(__mips__) || defined(__arm__) || defined(__aarch64__) || defined(ZARCH) || defined(sparc) || defined(__loongarch__)
++#if defined(INTEL_AMD) || defined(POWER) || defined(__mips__) || defined(__arm__) || defined(__aarch64__) || defined(ZARCH) || defined(sparc) || defined(__loongarch__) || defined(__riscv)
+ printf("#define CHAR_CORENAME \"%s\"\n", get_corename());
+ #endif
+ #endif
diff --git a/sci-libs/openblas/openblas-0.3.20.ebuild b/sci-libs/openblas/openblas-0.3.20.ebuild
index ed4ad9b91ed7..04d90c709e40 100644
--- a/sci-libs/openblas/openblas-0.3.20.ebuild
+++ b/sci-libs/openblas/openblas-0.3.20.ebuild
@@ -27,6 +27,7 @@ BDEPEND="virtual/pkgconfig"
PATCHES=(
"${FILESDIR}/${PN}-0.3.12-shared-blas-lapack.patch"
+ "${FILESDIR}/${PN}-0.3.20-fix-riscv.patch"
)
pkg_pretend() {
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sci-libs/openblas/files/, sci-libs/openblas/
@ 2022-05-13 12:58 WANG Xuerui
0 siblings, 0 replies; 6+ messages in thread
From: WANG Xuerui @ 2022-05-13 12:58 UTC (permalink / raw
To: gentoo-commits
commit: c3426da5b81db4d54864ea17d31074e0c60d7e35
Author: WANG Xuerui <xen0n <AT> gentoo <DOT> org>
AuthorDate: Fri May 13 12:44:07 2022 +0000
Commit: WANG Xuerui <xen0n <AT> gentoo <DOT> org>
CommitDate: Fri May 13 12:57:27 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3426da5
sci-libs/openblas: fix build on loong
Closes: https://bugs.gentoo.org/844013
Signed-off-by: WANG Xuerui <xen0n <AT> gentoo.org>
.../openblas/files/openblas-0.3.20-fix-loong.patch | 178 +++++++++++++++++++++
sci-libs/openblas/openblas-0.3.20.ebuild | 1 +
2 files changed, 179 insertions(+)
diff --git a/sci-libs/openblas/files/openblas-0.3.20-fix-loong.patch b/sci-libs/openblas/files/openblas-0.3.20-fix-loong.patch
new file mode 100644
index 000000000000..2745d26cb3a5
--- /dev/null
+++ b/sci-libs/openblas/files/openblas-0.3.20-fix-loong.patch
@@ -0,0 +1,178 @@
+https://github.com/xianyi/OpenBLAS/pull/3626, rebased on top of v0.3.20.
+
+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
+
+--- 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
+--- a/Makefile.system
++++ b/Makefile.system
+@@ -886,13 +886,6 @@ ifeq ($(OSNAME), AIX)
+ BINARY_DEFINED = 1
+ endif
+
+-ifeq ($(ARCH), loongarch64)
+-ifeq ($(CORE), LOONGSON3R5)
+-CCOMMON_OPT += -march=loongarch64 -mabi=lp64
+-FCOMMON_OPT += -march=loongarch64 -mabi=lp64
+-endif
+-endif
+-
+ endif
+
+ ifndef BINARY_DEFINED
+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
+--- a/Makefile.system
++++ b/Makefile.system
+@@ -1683,6 +1683,7 @@ export TARGET_CORE
+ export NO_AVX512
+ export NO_AVX2
+ export BUILD_BFLOAT16
++export NO_LASX
+
+ export SBGEMM_UNROLL_M
+ export SBGEMM_UNROLL_N
+--- a/c_check
++++ b/c_check
+@@ -270,6 +270,37 @@ if (($architecture eq "x86") || ($architecture eq "x86_64")) {
+ }
+ }
+
++$no_lasx = 0;
++if (($architecture eq "loongarch64")) {
++ eval "use File::Temp qw(tempfile)";
++ if ($@){
++ warn "could not load PERL module File::Temp, so could not check compiler compatibility with the LoongArch LASX extension";
++ # Assume no LASX, because currently LASX is only present in vendor
++ # toolchains, undocumented nor upstreamed.
++ $no_lasx = 1;
++ } else {
++ # 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.
++ ($fh,$tmpf) = tempfile( SUFFIX => '.c' , UNLINK => 1 );
++ $code = '"xvld $xr0, $a0, 0\n"';
++ print $fh "int main(void){ __asm__ volatile($code); }\n";
++ $args = " -march=loongarch64 -mabi=lp64 -mlasx -c -o $tmpf.o $tmpf";
++ my @cmd = ("$compiler_name $flags $args >/dev/null 2>/dev/null");
++ system(@cmd) == 0;
++ if ($? != 0) {
++ $no_lasx = 1;
++ } else {
++ $no_lasx = 0;
++ }
++ unlink("$tmpf.o");
++ }
++}
++
+ $c11_atomics = 0;
+ if ($data =~ /HAVE_C11/) {
+ eval "use File::Temp qw(tempfile)";
+@@ -393,6 +424,7 @@ print MAKEFILE "HAVE_MSA=1\n" if $have_msa eq 1;
+ print MAKEFILE "MSA_FLAGS=$msa_flags\n" if $have_msa eq 1;
+ print MAKEFILE "NO_AVX512=1\n" if $no_avx512 eq 1;
+ print MAKEFILE "NO_AVX2=1\n" if $no_avx2 eq 1;
++print MAKEFILE "NO_LASX=1\n" if $no_lasx eq 1;
+ print MAKEFILE "OLDGCC=1\n" if $oldgcc eq 1;
+
+ $os =~ tr/[a-z]/[A-Z]/;
+--- 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.o
+ DGEMMITCOPYOBJ = dgemm_itcopy.o
+ DGEMMONCOPYOBJ = dgemm_oncopy.o
+ DGEMMOTCOPYOBJ = dgemm_otcopy.o
++endif
+
+ DTRSMKERNEL_LN = ../generic/trsm_kernel_LN.c
+ DTRSMKERNEL_LT = ../generic/trsm_kernel_LT.c
+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
+--- 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
+--- a/Makefile.system
++++ b/Makefile.system
+@@ -1683,6 +1683,7 @@ export TARGET_CORE
+ export NO_AVX512
+ export NO_AVX2
+ export BUILD_BFLOAT16
++export LOONGARCH_CC_FLAVOR
+ export NO_LASX
+
+ export SBGEMM_UNROLL_M
+--- a/c_check
++++ b/c_check
+@@ -270,6 +270,21 @@ if (($architecture eq "x86") || ($architecture eq "x86_64")) {
+ }
+ }
+
++$loongarch_cc_flavor = "";
++if (($architecture eq "loongarch64")) {
++ # 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.
++ $args = " -mabi=lp64d -E -o - /dev/null";
++ my @cmd = ("$compiler_name $flags $args >/dev/null 2>/dev/null");
++ system(@cmd) == 0;
++ if ($? != 0) {
++ $loongarch_cc_flavor = "OLD";
++ } else {
++ $loongarch_cc_flavor = "NEW";
++ }
++}
++
+ $no_lasx = 0;
+ if (($architecture eq "loongarch64")) {
+ eval "use File::Temp qw(tempfile)";
+@@ -424,6 +439,7 @@ print MAKEFILE "HAVE_MSA=1\n" if $have_msa eq 1;
+ print MAKEFILE "MSA_FLAGS=$msa_flags\n" if $have_msa eq 1;
+ print MAKEFILE "NO_AVX512=1\n" if $no_avx512 eq 1;
+ print MAKEFILE "NO_AVX2=1\n" if $no_avx2 eq 1;
++print MAKEFILE "LOONGARCH_CC_FLAVOR=$loongarch_cc_flavor\n" if $architecture eq "loongarch64";
+ print MAKEFILE "NO_LASX=1\n" if $no_lasx eq 1;
+ print MAKEFILE "OLDGCC=1\n" if $oldgcc eq 1;
+
diff --git a/sci-libs/openblas/openblas-0.3.20.ebuild b/sci-libs/openblas/openblas-0.3.20.ebuild
index 5d2349e6998f..5b1ac906fd43 100644
--- a/sci-libs/openblas/openblas-0.3.20.ebuild
+++ b/sci-libs/openblas/openblas-0.3.20.ebuild
@@ -28,6 +28,7 @@ BDEPEND="virtual/pkgconfig"
PATCHES=(
"${FILESDIR}/${PN}-0.3.12-shared-blas-lapack.patch"
"${FILESDIR}/${PN}-0.3.20-fix-riscv.patch"
+ "${FILESDIR}/${PN}-0.3.20-fix-loong.patch"
)
pkg_pretend() {
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sci-libs/openblas/files/, sci-libs/openblas/
@ 2023-07-07 0:31 Michael Orlitzky
0 siblings, 0 replies; 6+ messages in thread
From: Michael Orlitzky @ 2023-07-07 0:31 UTC (permalink / raw
To: gentoo-commits
commit: 044b72e595e46ae602b22fc542b93008ec7ebad8
Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 7 00:03:49 2023 +0000
Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Fri Jul 7 00:28:46 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=044b72e5
sci-libs/openblas: add 0.3.23
All this really needed was a rebase of the shared-lib patch. The loong
arch patch still applies, albeit with fuzz. The strict-aliasing warnings
from bug 862909 also seem gone, probably as part of the underlying
lapack upgrade.
Closes: https://bugs.gentoo.org/862909
Closes: https://bugs.gentoo.org/905277
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>
sci-libs/openblas/Manifest | 1 +
.../files/openblas-0.3.23-shared-blas-lapack.patch | 40 +++++
sci-libs/openblas/openblas-0.3.23.ebuild | 196 +++++++++++++++++++++
3 files changed, 237 insertions(+)
diff --git a/sci-libs/openblas/Manifest b/sci-libs/openblas/Manifest
index 95fc46d6f9d5..7aa1f78efac0 100644
--- a/sci-libs/openblas/Manifest
+++ b/sci-libs/openblas/Manifest
@@ -2,3 +2,4 @@ DIST openblas-0.3.18.tar.gz 12619822 BLAKE2B 38a5e7b861eb0063a4494c1cfb6f7f57237
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
+DIST openblas-0.3.23.tar.gz 23950794 BLAKE2B 8394e09c682bba10450248cbbe090bb81c26661eac7d238942055ae0eecce752c8a3481af905de9efe20fe635f2c4a0e06af83bb64c998ab410e4cdc56751a47 SHA512 ea64c693e57eb63cc2a88e4d6ab2d8cf9ab84ae6a15048fb12090a3570dd41053e62e99c1ff9d3e02dd67ca93233591ab41b8c017d06585d0a69222e1ad3023f
diff --git a/sci-libs/openblas/files/openblas-0.3.23-shared-blas-lapack.patch b/sci-libs/openblas/files/openblas-0.3.23-shared-blas-lapack.patch
new file mode 100644
index 000000000000..4d200d3b3960
--- /dev/null
+++ b/sci-libs/openblas/files/openblas-0.3.23-shared-blas-lapack.patch
@@ -0,0 +1,40 @@
+From b3b59749a0df9c2375f1c99adb8552f698eba6d6 Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Thu, 6 Jul 2023 15:54:30 -0400
+Subject: [PATCH] interface/Makefile: add shared library targets.
+
+Gentoo patch for shared library support.
+---
+ interface/Makefile | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+diff --git a/interface/Makefile b/interface/Makefile
+index 2ac9663..63bcb24 100644
+--- a/interface/Makefile
++++ b/interface/Makefile
+@@ -2384,3 +2384,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
+--
+2.39.3
+
diff --git a/sci-libs/openblas/openblas-0.3.23.ebuild b/sci-libs/openblas/openblas-0.3.23.ebuild
new file mode 100644
index 000000000000..a29cc595fcae
--- /dev/null
+++ b/sci-libs/openblas/openblas-0.3.23.ebuild
@@ -0,0 +1,196 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+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.23-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/files/, sci-libs/openblas/
@ 2023-07-13 18:56 Michael Orlitzky
0 siblings, 0 replies; 6+ messages in thread
From: Michael Orlitzky @ 2023-07-13 18:56 UTC (permalink / raw
To: gentoo-commits
commit: 0bb4197bb27d2103d9cd548d43ee7bd77942f51b
Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 13 18:31:54 2023 +0000
Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Thu Jul 13 18:54:57 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0bb4197b
sci-libs/openblas: improved parallel build fix.
Bug: https://bugs.gentoo.org/910174
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>
.../files/openblas-0.3.23-parallel-make.patch | 67 ++++++++++++++++++++++
sci-libs/openblas/openblas-0.3.23.ebuild | 4 +-
2 files changed, 69 insertions(+), 2 deletions(-)
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
new file mode 100644
index 000000000000..ce0487a6b2c0
--- /dev/null
+++ b/sci-libs/openblas/files/openblas-0.3.23-parallel-make.patch
@@ -0,0 +1,67 @@
+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.23.ebuild b/sci-libs/openblas/openblas-0.3.23.ebuild
index 0324e3a62e4c..0e178b25b5a8 100644
--- a/sci-libs/openblas/openblas-0.3.23.ebuild
+++ b/sci-libs/openblas/openblas-0.3.23.ebuild
@@ -28,6 +28,7 @@ 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() {
@@ -132,8 +133,7 @@ src_compile() {
}
src_test() {
- # https://github.com/xianyi/OpenBLAS/issues/4139
- emake -j1 tests
+ emake tests
}
src_install() {
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-07-13 18:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-27 21:18 [gentoo-commits] repo/gentoo:master commit in: sci-libs/openblas/files/, sci-libs/openblas/ Jakov Smolić
-- strict thread matches above, loose matches on Subject: below --
2023-07-13 18:56 Michael Orlitzky
2023-07-07 0:31 Michael Orlitzky
2022-05-13 12:58 WANG Xuerui
2020-10-29 20:16 Sam James
2020-09-18 23:25 Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox