commit:     57e2be19d17640729372235c4c73171e069d2cca
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 11 02:29:20 2020 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Thu Jun 11 02:45:00 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=57e2be19

sci-libs/openblas: fix tests with fortran bounds checking enabled.

One OpenBLAS test fails when you enable bounds checks in your fortran
compiler via e.g. either "-fbounds-check" or "-fcheck=bounds" with
gfortran. This was reported upstream at

  https://github.com/xianyi/OpenBLAS/issues/2657

but in the meantime the easiest thing to do for *our* users is to
filter out those flags when USE=test is set. Thanks to Bernd for
reporting the problem on bug 726474.

Closes: 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/openblas-0.3.9.ebuild | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/sci-libs/openblas/openblas-0.3.9.ebuild 
b/sci-libs/openblas/openblas-0.3.9.ebuild
index 15ee8cf93ea..6427d994b30 100644
--- a/sci-libs/openblas/openblas-0.3.9.ebuild
+++ b/sci-libs/openblas/openblas-0.3.9.ebuild
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
-inherit fortran-2 toolchain-funcs
+inherit flag-o-matic fortran-2 toolchain-funcs
 
 DESCRIPTION="Optimized BLAS library based on GotoBLAS2"
 HOMEPAGE="http://xianyi.github.com/OpenBLAS/";
@@ -11,8 +11,9 @@ SRC_URI="https://github.com/xianyi/OpenBLAS/archive/v${PV} -> 
${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"
+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
@@ -26,6 +27,12 @@ PATCHES=( "${FILESDIR}/shared-blas-lapack.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"
+
        export CC=$(tc-getCC) FC=$(tc-getFC)
 
        use dynamic && \

Reply via email to