From da91e23c3cb3a5acd9998912990981b9df7921d9 Mon Sep 17 00:00:00 2001 From: Benda Xu Date: Sun, 4 Aug 2019 21:12:33 +0800 Subject: [PATCH] sci-libs/openblas: Allow custom CFLAGS and add fortran checks. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Drop unused USE flags. Suggested-By: Hasan ÇALIŞIR Closes: https://github.com/gentoo/gentoo/pull/12576 Package-Manager: Portage-2.3.69, Repoman-2.3.12 Signed-off-by: Benda Xu --- sci-libs/openblas/metadata.xml | 3 +-- sci-libs/openblas/openblas-0.3.6.ebuild | 29 +++++++++++++++++++------ 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/sci-libs/openblas/metadata.xml b/sci-libs/openblas/metadata.xml index 95b34d1ccda3..fa16b081f106 100644 --- a/sci-libs/openblas/metadata.xml +++ b/sci-libs/openblas/metadata.xml @@ -14,10 +14,9 @@ Build dynamic architecture detection at run time (for multi targets) - Build with pthread threadding model - Build without multi-thraedding Enable BLAS/LAPACK runtime switching Compile a separate INTERFACE64 OpenBLAS + Build with pthread threading model xianyi/OpenBLAS diff --git a/sci-libs/openblas/openblas-0.3.6.ebuild b/sci-libs/openblas/openblas-0.3.6.ebuild index 19c3b79f2584..3a91ce44fc14 100644 --- a/sci-libs/openblas/openblas-0.3.6.ebuild +++ b/sci-libs/openblas/openblas-0.3.6.ebuild @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=7 -inherit toolchain-funcs +inherit fortran-2 toolchain-funcs DESCRIPTION="Optimized BLAS library based on GotoBLAS2" HOMEPAGE="http://xianyi.github.com/OpenBLAS/" @@ -11,18 +11,28 @@ 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 index-64bit" -REQUIRED_USE="?? ( openmp pthread serial )" +IUSE="dynamic eselect-ldso index-64bit openmp pthread" +REQUIRED_USE="?? ( openmp pthread )" RDEPEND=" -eselect-ldso? ( >=app-eselect/eselect-blas-0.2 - !app-eselect/eselect-cblas - >=app-eselect/eselect-lapack-0.2 ) -" + eselect-ldso? ( >=app-eselect/eselect-blas-0.2 + !app-eselect/eselect-cblas + >=app-eselect/eselect-lapack-0.2 )" + DEPEND="virtual/pkgconfig" PATCHES=( "${FILESDIR}/shared-blas-lapack.patch" ) +src_prepare() { + default + # Set compiler and common CFLAGS. + sed \ + -e "/^#\s*CC/cCC=$(tc-getCC)" \ + -e "/^#\s*FC/cFC=$(tc-getFC)" \ + -e "/^#\s*COMMON_OPT/cCOMMON_OPT=${CFLAGS}" \ + -i "${S}"/Makefile.rule || die +} + openblas_flags() { local flags=() use dynamic && \ @@ -57,8 +67,13 @@ src_compile () { fi } +src_test() { + emake tests $(openblas_flags) +} + src_install () { emake install $(openblas_flags) + dodoc GotoBLAS_*.txt *.md Changelog.txt if use eselect-ldso; then dodir /usr/$(get_libdir)/blas/openblas/ -- 2.26.2