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 <[email protected]> +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
