Patch for C++ compatibility.

This commit is contained in:
Susi Lehtola 2020-04-02 14:00:31 +02:00
parent 99cb63155f
commit 0dc13c877e
2 changed files with 81 additions and 1 deletions

View File

@ -0,0 +1,73 @@
From ee2e758278b5d82b7242f505ea694f082ef65879 Mon Sep 17 00:00:00 2001
From: Martin Kroeker <martin@ruby.chemie.uni-freiburg.de>
Date: Fri, 13 Mar 2020 20:34:13 +0100
Subject: [PATCH] Move declarations of lapack_complex_custom types outside the
extern C
fixes #2510
---
lapack-netlib/LAPACKE/include/lapack.h | 44 ++++++++++++++------------
1 file changed, 23 insertions(+), 21 deletions(-)
diff --git a/lapack-netlib/LAPACKE/include/lapack.h b/lapack-netlib/LAPACKE/include/lapack.h
index 0a6226fe4..36e53ec24 100644
--- a/lapack-netlib/LAPACKE/include/lapack.h
+++ b/lapack-netlib/LAPACKE/include/lapack.h
@@ -12,27 +12,6 @@
#include <stdlib.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*----------------------------------------------------------------------------*/
-#ifndef lapack_int
-#define lapack_int int
-#endif
-
-#ifndef lapack_logical
-#define lapack_logical lapack_int
-#endif
-
-/* f2c, hence clapack and MacOS Accelerate, returns double instead of float
- * for sdot, slange, clange, etc. */
-#if defined(LAPACK_F2C)
- typedef double lapack_float_return;
-#else
- typedef float lapack_float_return;
-#endif
-
/* Complex types are structures equivalent to the
* Fortran complex types COMPLEX(4) and COMPLEX(8).
*
@@ -88,6 +67,29 @@ extern "C" {
#endif /* LAPACK_COMPLEX_CUSTOM */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*----------------------------------------------------------------------------*/
+#ifndef lapack_int
+#define lapack_int int
+#endif
+
+#ifndef lapack_logical
+#define lapack_logical lapack_int
+#endif
+
+/* f2c, hence clapack and MacOS Accelerate, returns double instead of float
+ * for sdot, slange, clange, etc. */
+#if defined(LAPACK_F2C)
+ typedef double lapack_float_return;
+#else
+ typedef float lapack_float_return;
+#endif
+
+
/* Callback logical functions of one, two, or three arguments are used
* to select eigenvalues to sort to the top left of the Schur form.
* The value is selected if function returns TRUE (non-zero). */

View File

@ -15,7 +15,7 @@
Name: openblas
Version: 0.3.9
Release: 1%{?dist}
Release: 2%{?dist}
Summary: An optimized BLAS library based on GotoBLAS2
License: BSD
URL: https://github.com/xianyi/OpenBLAS/
@ -29,6 +29,9 @@ Patch2: openblas-0.2.15-constructor.patch
# Supply the proper flags to the test makefile
Patch3: openblas-0.3.7-tests.patch
# Fix C++ compatibility (BZ #1820131)
Patch4: https://github.com/xianyi/OpenBLAS/commit/ee2e758278b5d82b7242f505ea694f082ef65879.patch
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: gcc-gfortran
@ -241,6 +244,7 @@ cd OpenBLAS-%{version}
%patch2 -p1 -b .constructor
%endif
%patch3 -p1 -b .tests
%patch4 -p1 -b .cplusplus
# Fix source permissions
find -name \*.f -exec chmod 644 {} \;
@ -664,6 +668,9 @@ rm -rf %{buildroot}%{_libdir}/pkgconfig
%endif
%changelog
* Thu Apr 02 2020 Susi Lehtola <jussilehtola@fedoraproject.org> - 0.3.9-2
- Patch for BZ #1820131.
* Mon Mar 02 2020 Susi Lehtola <jussilehtola@fedoraproject.org> - 0.3.9-1
- Update to 0.3.9.