Sync from SUSE:SLFO:Main lapack revision 8df242053cb4420992f540f02869b05f

This commit is contained in:
Adrian Schröter 2024-11-28 17:42:48 +01:00
parent 61d21ebaf4
commit 6ea75eda26
15 changed files with 439 additions and 1663 deletions

View File

@ -1,981 +0,0 @@
From ea2a102d3827a9de90fce729c9d7f132d4c96f4f Mon Sep 17 00:00:00 2001
From: Martin Kroeker <martin@ruby.chemie.uni-freiburg.de>
Date: Sat, 27 Apr 2019 23:06:12 +0200
Subject: [PATCH 1/2] Avoid out-of-bounds accesses in complex EIG tests
fixes #333
---
TESTING/EIG/chet21.f | 34 ++++++++++++++++------------------
TESTING/EIG/chpt21.f | 37 ++++++++++++++++---------------------
TESTING/EIG/zhet21.f | 34 ++++++++++++++++------------------
TESTING/EIG/zhpt21.f | 38 +++++++++++++++++---------------------
4 files changed, 65 insertions(+), 78 deletions(-)
diff --git a/TESTING/EIG/chet21.f b/TESTING/EIG/chet21.f
index e5bf027c2..5aff64904 100644
--- a/TESTING/EIG/chet21.f
+++ b/TESTING/EIG/chet21.f
@@ -29,9 +29,8 @@
*>
*> CHET21 generally checks a decomposition of the form
*>
-*> A = U S U**H
-*>
-*> where **H means conjugate transpose, A is hermitian, U is unitary, and
+*> A = U S UC>
+*> where * means conjugate transpose, A is hermitian, U is unitary, and
*> S is diagonal (if KBAND=0) or (real) symmetric tridiagonal (if
*> KBAND=1).
*>
@@ -43,19 +42,18 @@
*>
*> Specifically, if ITYPE=1, then:
*>
-*> RESULT(1) = | A - U S U**H | / ( |A| n ulp ) and
-*> RESULT(2) = | I - U U**H | / ( n ulp )
+*> RESULT(1) = | A - U S U* | / ( |A| n ulp ) *andC> RESULT(2) = | I - UU* | / ( n ulp )
*>
*> If ITYPE=2, then:
*>
-*> RESULT(1) = | A - V S V**H | / ( |A| n ulp )
+*> RESULT(1) = | A - V S V* | / ( |A| n ulp )
*>
*> If ITYPE=3, then:
*>
-*> RESULT(1) = | I - U V**H | / ( n ulp )
+*> RESULT(1) = | I - UV* | / ( n ulp )
*>
*> For ITYPE > 1, the transformation U is expressed as a product
-*> V = H(1)...H(n-2), where H(j) = I - tau(j) v(j) v(j)**H and each
+*> V = H(1)...H(n-2), where H(j) = I - tau(j) v(j) v(j)C> and each
*> vector v(j) has its first j elements 0 and the remaining n-j elements
*> stored in V(j+1:n,j).
*> \endverbatim
@@ -68,15 +66,14 @@
*> ITYPE is INTEGER
*> Specifies the type of tests to be performed.
*> 1: U expressed as a dense unitary matrix:
-*> RESULT(1) = | A - U S U**H | / ( |A| n ulp ) and
-*> RESULT(2) = | I - U U**H | / ( n ulp )
+*> RESULT(1) = | A - U S U* | / ( |A| n ulp ) *andC> RESULT(2) = | I - UU* | / ( n ulp )
*>
*> 2: U expressed as a product V of Housholder transformations:
-*> RESULT(1) = | A - V S V**H | / ( |A| n ulp )
+*> RESULT(1) = | A - V S V* | / ( |A| n ulp )
*>
*> 3: U expressed both as a dense unitary matrix and
*> as a product of Housholder transformations:
-*> RESULT(1) = | I - U V**H | / ( n ulp )
+*> RESULT(1) = | I - UV* | / ( n ulp )
*> \endverbatim
*>
*> \param[in] UPLO
@@ -174,7 +171,7 @@
*> \verbatim
*> TAU is COMPLEX array, dimension (N)
*> If ITYPE >= 2, then TAU(j) is the scalar factor of
-*> v(j) v(j)**H in the Householder transformation H(j) of
+*> v(j) v(j)* in the Householder transformation H(j) of
*> the product U = H(1)...H(n-2)
*> If ITYPE < 2, then TAU is not referenced.
*> \endverbatim
@@ -297,7 +294,7 @@ SUBROUTINE CHET21( ITYPE, UPLO, N, KBAND, A, LDA, D, E, U, LDU, V,
*
IF( ITYPE.EQ.1 ) THEN
*
-* ITYPE=1: error = A - U S U**H
+* ITYPE=1: error = A - U S U*
*
CALL CLASET( 'Full', N, N, CZERO, CZERO, WORK, N )
CALL CLACPY( CUPLO, N, N, A, LDA, WORK, N )
@@ -307,7 +304,8 @@ SUBROUTINE CHET21( ITYPE, UPLO, N, KBAND, A, LDA, D, E, U, LDU, V,
10 CONTINUE
*
IF( N.GT.1 .AND. KBAND.EQ.1 ) THEN
- DO 20 J = 1, N - 1
+CMK DO 20 J = 1, N - 1
+ DO 20 J = 2, N - 1
CALL CHER2( CUPLO, N, -CMPLX( E( J ) ), U( 1, J ), 1,
$ U( 1, J-1 ), 1, WORK, N )
20 CONTINUE
@@ -316,7 +314,7 @@ SUBROUTINE CHET21( ITYPE, UPLO, N, KBAND, A, LDA, D, E, U, LDU, V,
*
ELSE IF( ITYPE.EQ.2 ) THEN
*
-* ITYPE=2: error = V S V**H - A
+* ITYPE=2: error = V S V* - A
*
CALL CLASET( 'Full', N, N, CZERO, CZERO, WORK, N )
*
@@ -373,7 +371,7 @@ SUBROUTINE CHET21( ITYPE, UPLO, N, KBAND, A, LDA, D, E, U, LDU, V,
*
ELSE IF( ITYPE.EQ.3 ) THEN
*
-* ITYPE=3: error = U V**H - I
+* ITYPE=3: error = U V* - I
*
IF( N.LT.2 )
$ RETURN
@@ -409,7 +407,7 @@ SUBROUTINE CHET21( ITYPE, UPLO, N, KBAND, A, LDA, D, E, U, LDU, V,
*
* Do Test 2
*
-* Compute U U**H - I
+* Compute UU* - I
*
IF( ITYPE.EQ.1 ) THEN
CALL CGEMM( 'N', 'C', N, N, N, CONE, U, LDU, U, LDU, CZERO,
diff --git a/TESTING/EIG/chpt21.f b/TESTING/EIG/chpt21.f
index 458079614..e151a8bd8 100644
--- a/TESTING/EIG/chpt21.f
+++ b/TESTING/EIG/chpt21.f
@@ -29,9 +29,8 @@
*>
*> CHPT21 generally checks a decomposition of the form
*>
-*> A = U S U**H
-*>
-*> where **H means conjugate transpose, A is hermitian, U is
+*> A = U S UC>
+*> where * means conjugate transpose, A is hermitian, U is
*> unitary, and S is diagonal (if KBAND=0) or (real) symmetric
*> tridiagonal (if KBAND=1). If ITYPE=1, then U is represented as
*> a dense matrix, otherwise the U is expressed as a product of
@@ -42,16 +41,15 @@
*>
*> Specifically, if ITYPE=1, then:
*>
-*> RESULT(1) = | A - U S U**H | / ( |A| n ulp ) and
-*> RESULT(2) = | I - U U**H | / ( n ulp )
+*> RESULT(1) = | A - U S U* | / ( |A| n ulp ) *andC> RESULT(2) = | I - UU* | / ( n ulp )
*>
*> If ITYPE=2, then:
*>
-*> RESULT(1) = | A - V S V**H | / ( |A| n ulp )
+*> RESULT(1) = | A - V S V* | / ( |A| n ulp )
*>
*> If ITYPE=3, then:
*>
-*> RESULT(1) = | I - U V**H | / ( n ulp )
+*> RESULT(1) = | I - UV* | / ( n ulp )
*>
*> Packed storage means that, for example, if UPLO='U', then the columns
*> of the upper triangle of A are stored one after another, so that
@@ -72,16 +70,14 @@
*>
*> If UPLO='U', then V = H(n-1)...H(1), where
*>
-*> H(j) = I - tau(j) v(j) v(j)**H
-*>
+*> H(j) = I - tau(j) v(j) v(j)C>
*> and the first j-1 elements of v(j) are stored in V(1:j-1,j+1),
*> (i.e., VP( j*(j+1)/2 + 1 : j*(j+1)/2 + j-1 ) ),
*> the j-th element is 1, and the last n-j elements are 0.
*>
*> If UPLO='L', then V = H(1)...H(n-1), where
*>
-*> H(j) = I - tau(j) v(j) v(j)**H
-*>
+*> H(j) = I - tau(j) v(j) v(j)C>
*> and the first j elements of v(j) are 0, the (j+1)-st is 1, and the
*> (j+2)-nd through n-th elements are stored in V(j+2:n,j) (i.e.,
*> in VP( (2*n-j)*(j-1)/2 + j+2 : (2*n-j)*(j-1)/2 + n ) .)
@@ -95,15 +91,14 @@
*> ITYPE is INTEGER
*> Specifies the type of tests to be performed.
*> 1: U expressed as a dense unitary matrix:
-*> RESULT(1) = | A - U S U**H | / ( |A| n ulp ) and
-*> RESULT(2) = | I - U U**H | / ( n ulp )
+*> RESULT(1) = | A - U S U* | / ( |A| n ulp ) *andC> RESULT(2) = | I - UU* | / ( n ulp )
*>
*> 2: U expressed as a product V of Housholder transformations:
-*> RESULT(1) = | A - V S V**H | / ( |A| n ulp )
+*> RESULT(1) = | A - V S V* | / ( |A| n ulp )
*>
*> 3: U expressed both as a dense unitary matrix and
*> as a product of Housholder transformations:
-*> RESULT(1) = | I - U V**H | / ( n ulp )
+*> RESULT(1) = | I - UV* | / ( n ulp )
*> \endverbatim
*>
*> \param[in] UPLO
@@ -186,7 +181,7 @@
*> \verbatim
*> TAU is COMPLEX array, dimension (N)
*> If ITYPE >= 2, then TAU(j) is the scalar factor of
-*> v(j) v(j)**H in the Householder transformation H(j) of
+*> v(j) v(j)* in the Householder transformation H(j) of
*> the product U = H(1)...H(n-2)
*> If ITYPE < 2, then TAU is not referenced.
*> \endverbatim
@@ -318,7 +313,7 @@ SUBROUTINE CHPT21( ITYPE, UPLO, N, KBAND, AP, D, E, U, LDU, VP,
*
IF( ITYPE.EQ.1 ) THEN
*
-* ITYPE=1: error = A - U S U**H
+* ITYPE=1: error = A - U S U*
*
CALL CLASET( 'Full', N, N, CZERO, CZERO, WORK, N )
CALL CCOPY( LAP, AP, 1, WORK, 1 )
@@ -328,7 +323,7 @@ SUBROUTINE CHPT21( ITYPE, UPLO, N, KBAND, AP, D, E, U, LDU, VP,
10 CONTINUE
*
IF( N.GT.1 .AND. KBAND.EQ.1 ) THEN
- DO 20 J = 1, N - 1
+ DO 20 J = 2, N - 1
CALL CHPR2( CUPLO, N, -CMPLX( E( J ) ), U( 1, J ), 1,
$ U( 1, J-1 ), 1, WORK )
20 CONTINUE
@@ -337,7 +332,7 @@ SUBROUTINE CHPT21( ITYPE, UPLO, N, KBAND, AP, D, E, U, LDU, VP,
*
ELSE IF( ITYPE.EQ.2 ) THEN
*
-* ITYPE=2: error = V S V**H - A
+* ITYPE=2: error = V S V* - A
*
CALL CLASET( 'Full', N, N, CZERO, CZERO, WORK, N )
*
@@ -405,7 +400,7 @@ SUBROUTINE CHPT21( ITYPE, UPLO, N, KBAND, AP, D, E, U, LDU, VP,
*
ELSE IF( ITYPE.EQ.3 ) THEN
*
-* ITYPE=3: error = U V**H - I
+* ITYPE=3: error = U V* - I
*
IF( N.LT.2 )
$ RETURN
@@ -436,7 +431,7 @@ SUBROUTINE CHPT21( ITYPE, UPLO, N, KBAND, AP, D, E, U, LDU, VP,
*
* Do Test 2
*
-* Compute U U**H - I
+* Compute UU* - I
*
IF( ITYPE.EQ.1 ) THEN
CALL CGEMM( 'N', 'C', N, N, N, CONE, U, LDU, U, LDU, CZERO,
diff --git a/TESTING/EIG/zhet21.f b/TESTING/EIG/zhet21.f
index 11f94c63b..f6cb2d70a 100644
--- a/TESTING/EIG/zhet21.f
+++ b/TESTING/EIG/zhet21.f
@@ -29,9 +29,8 @@
*>
*> ZHET21 generally checks a decomposition of the form
*>
-*> A = U S U**H
-*>
-*> where **H means conjugate transpose, A is hermitian, U is unitary, and
+*> A = U S UC>
+*> where * means conjugate transpose, A is hermitian, U is unitary, and
*> S is diagonal (if KBAND=0) or (real) symmetric tridiagonal (if
*> KBAND=1).
*>
@@ -43,19 +42,18 @@
*>
*> Specifically, if ITYPE=1, then:
*>
-*> RESULT(1) = | A - U S U**H | / ( |A| n ulp ) and
-*> RESULT(2) = | I - U U**H | / ( n ulp )
+*> RESULT(1) = | A - U S U* | / ( |A| n ulp ) *andC> RESULT(2) = | I - UU* | / ( n ulp )
*>
*> If ITYPE=2, then:
*>
-*> RESULT(1) = | A - V S V**H | / ( |A| n ulp )
+*> RESULT(1) = | A - V S V* | / ( |A| n ulp )
*>
*> If ITYPE=3, then:
*>
-*> RESULT(1) = | I - U V**H | / ( n ulp )
+*> RESULT(1) = | I - UV* | / ( n ulp )
*>
*> For ITYPE > 1, the transformation U is expressed as a product
-*> V = H(1)...H(n-2), where H(j) = I - tau(j) v(j) v(j)**H and each
+*> V = H(1)...H(n-2), where H(j) = I - tau(j) v(j) v(j)C> and each
*> vector v(j) has its first j elements 0 and the remaining n-j elements
*> stored in V(j+1:n,j).
*> \endverbatim
@@ -68,15 +66,14 @@
*> ITYPE is INTEGER
*> Specifies the type of tests to be performed.
*> 1: U expressed as a dense unitary matrix:
-*> RESULT(1) = | A - U S U**H | / ( |A| n ulp ) and
-*> RESULT(2) = | I - U U**H | / ( n ulp )
+*> RESULT(1) = | A - U S U* | / ( |A| n ulp ) *andC> RESULT(2) = | I - UU* | / ( n ulp )
*>
*> 2: U expressed as a product V of Housholder transformations:
-*> RESULT(1) = | A - V S V**H | / ( |A| n ulp )
+*> RESULT(1) = | A - V S V* | / ( |A| n ulp )
*>
*> 3: U expressed both as a dense unitary matrix and
*> as a product of Housholder transformations:
-*> RESULT(1) = | I - U V**H | / ( n ulp )
+*> RESULT(1) = | I - UV* | / ( n ulp )
*> \endverbatim
*>
*> \param[in] UPLO
@@ -174,7 +171,7 @@
*> \verbatim
*> TAU is COMPLEX*16 array, dimension (N)
*> If ITYPE >= 2, then TAU(j) is the scalar factor of
-*> v(j) v(j)**H in the Householder transformation H(j) of
+*> v(j) v(j)* in the Householder transformation H(j) of
*> the product U = H(1)...H(n-2)
*> If ITYPE < 2, then TAU is not referenced.
*> \endverbatim
@@ -297,7 +294,7 @@ SUBROUTINE ZHET21( ITYPE, UPLO, N, KBAND, A, LDA, D, E, U, LDU, V,
*
IF( ITYPE.EQ.1 ) THEN
*
-* ITYPE=1: error = A - U S U**H
+* ITYPE=1: error = A - U S U*
*
CALL ZLASET( 'Full', N, N, CZERO, CZERO, WORK, N )
CALL ZLACPY( CUPLO, N, N, A, LDA, WORK, N )
@@ -307,7 +304,8 @@ SUBROUTINE ZHET21( ITYPE, UPLO, N, KBAND, A, LDA, D, E, U, LDU, V,
10 CONTINUE
*
IF( N.GT.1 .AND. KBAND.EQ.1 ) THEN
- DO 20 J = 1, N - 1
+CMK DO 20 J = 1, N - 1
+ DO 20 J = 2, N - 1
CALL ZHER2( CUPLO, N, -DCMPLX( E( J ) ), U( 1, J ), 1,
$ U( 1, J-1 ), 1, WORK, N )
20 CONTINUE
@@ -316,7 +314,7 @@ SUBROUTINE ZHET21( ITYPE, UPLO, N, KBAND, A, LDA, D, E, U, LDU, V,
*
ELSE IF( ITYPE.EQ.2 ) THEN
*
-* ITYPE=2: error = V S V**H - A
+* ITYPE=2: error = V S V* - A
*
CALL ZLASET( 'Full', N, N, CZERO, CZERO, WORK, N )
*
@@ -373,7 +371,7 @@ SUBROUTINE ZHET21( ITYPE, UPLO, N, KBAND, A, LDA, D, E, U, LDU, V,
*
ELSE IF( ITYPE.EQ.3 ) THEN
*
-* ITYPE=3: error = U V**H - I
+* ITYPE=3: error = U V* - I
*
IF( N.LT.2 )
$ RETURN
@@ -409,7 +407,7 @@ SUBROUTINE ZHET21( ITYPE, UPLO, N, KBAND, A, LDA, D, E, U, LDU, V,
*
* Do Test 2
*
-* Compute U U**H - I
+* Compute UU* - I
*
IF( ITYPE.EQ.1 ) THEN
CALL ZGEMM( 'N', 'C', N, N, N, CONE, U, LDU, U, LDU, CZERO,
diff --git a/TESTING/EIG/zhpt21.f b/TESTING/EIG/zhpt21.f
index 909ec8a02..ef9e4418d 100644
--- a/TESTING/EIG/zhpt21.f
+++ b/TESTING/EIG/zhpt21.f
@@ -29,9 +29,8 @@
*>
*> ZHPT21 generally checks a decomposition of the form
*>
-*> A = U S U**H
-*>
-*> where **H means conjugate transpose, A is hermitian, U is
+*> A = U S UC>
+*> where * means conjugate transpose, A is hermitian, U is
*> unitary, and S is diagonal (if KBAND=0) or (real) symmetric
*> tridiagonal (if KBAND=1). If ITYPE=1, then U is represented as
*> a dense matrix, otherwise the U is expressed as a product of
@@ -42,16 +41,15 @@
*>
*> Specifically, if ITYPE=1, then:
*>
-*> RESULT(1) = | A - U S U**H | / ( |A| n ulp ) and
-*> RESULT(2) = | I - U U**H | / ( n ulp )
+*> RESULT(1) = | A - U S U* | / ( |A| n ulp ) *andC> RESULT(2) = | I - UU* | / ( n ulp )
*>
*> If ITYPE=2, then:
*>
-*> RESULT(1) = | A - V S V**H | / ( |A| n ulp )
+*> RESULT(1) = | A - V S V* | / ( |A| n ulp )
*>
*> If ITYPE=3, then:
*>
-*> RESULT(1) = | I - U V**H | / ( n ulp )
+*> RESULT(1) = | I - UV* | / ( n ulp )
*>
*> Packed storage means that, for example, if UPLO='U', then the columns
*> of the upper triangle of A are stored one after another, so that
@@ -72,16 +70,14 @@
*>
*> If UPLO='U', then V = H(n-1)...H(1), where
*>
-*> H(j) = I - tau(j) v(j) v(j)**H
-*>
+*> H(j) = I - tau(j) v(j) v(j)C>
*> and the first j-1 elements of v(j) are stored in V(1:j-1,j+1),
*> (i.e., VP( j*(j+1)/2 + 1 : j*(j+1)/2 + j-1 ) ),
*> the j-th element is 1, and the last n-j elements are 0.
*>
*> If UPLO='L', then V = H(1)...H(n-1), where
*>
-*> H(j) = I - tau(j) v(j) v(j)**H
-*>
+*> H(j) = I - tau(j) v(j) v(j)C>
*> and the first j elements of v(j) are 0, the (j+1)-st is 1, and the
*> (j+2)-nd through n-th elements are stored in V(j+2:n,j) (i.e.,
*> in VP( (2*n-j)*(j-1)/2 + j+2 : (2*n-j)*(j-1)/2 + n ) .)
@@ -95,15 +91,14 @@
*> ITYPE is INTEGER
*> Specifies the type of tests to be performed.
*> 1: U expressed as a dense unitary matrix:
-*> RESULT(1) = | A - U S U**H | / ( |A| n ulp ) and
-*> RESULT(2) = | I - U U**H | / ( n ulp )
+*> RESULT(1) = | A - U S U* | / ( |A| n ulp ) *andC> RESULT(2) = | I - UU* | / ( n ulp )
*>
*> 2: U expressed as a product V of Housholder transformations:
-*> RESULT(1) = | A - V S V**H | / ( |A| n ulp )
+*> RESULT(1) = | A - V S V* | / ( |A| n ulp )
*>
*> 3: U expressed both as a dense unitary matrix and
*> as a product of Housholder transformations:
-*> RESULT(1) = | I - U V**H | / ( n ulp )
+*> RESULT(1) = | I - UV* | / ( n ulp )
*> \endverbatim
*>
*> \param[in] UPLO
@@ -186,7 +181,7 @@
*> \verbatim
*> TAU is COMPLEX*16 array, dimension (N)
*> If ITYPE >= 2, then TAU(j) is the scalar factor of
-*> v(j) v(j)**H in the Householder transformation H(j) of
+*> v(j) v(j)* in the Householder transformation H(j) of
*> the product U = H(1)...H(n-2)
*> If ITYPE < 2, then TAU is not referenced.
*> \endverbatim
@@ -318,7 +313,7 @@ SUBROUTINE ZHPT21( ITYPE, UPLO, N, KBAND, AP, D, E, U, LDU, VP,
*
IF( ITYPE.EQ.1 ) THEN
*
-* ITYPE=1: error = A - U S U**H
+* ITYPE=1: error = A - U S U*
*
CALL ZLASET( 'Full', N, N, CZERO, CZERO, WORK, N )
CALL ZCOPY( LAP, AP, 1, WORK, 1 )
@@ -328,7 +323,8 @@ SUBROUTINE ZHPT21( ITYPE, UPLO, N, KBAND, AP, D, E, U, LDU, VP,
10 CONTINUE
*
IF( N.GT.1 .AND. KBAND.EQ.1 ) THEN
- DO 20 J = 1, N - 1
+CMK DO 20 J = 1, N - 1
+ DO 20 J = 2, N - 1
CALL ZHPR2( CUPLO, N, -DCMPLX( E( J ) ), U( 1, J ), 1,
$ U( 1, J-1 ), 1, WORK )
20 CONTINUE
@@ -337,7 +333,7 @@ SUBROUTINE ZHPT21( ITYPE, UPLO, N, KBAND, AP, D, E, U, LDU, VP,
*
ELSE IF( ITYPE.EQ.2 ) THEN
*
-* ITYPE=2: error = V S V**H - A
+* ITYPE=2: error = V S V* - A
*
CALL ZLASET( 'Full', N, N, CZERO, CZERO, WORK, N )
*
@@ -405,7 +401,7 @@ SUBROUTINE ZHPT21( ITYPE, UPLO, N, KBAND, AP, D, E, U, LDU, VP,
*
ELSE IF( ITYPE.EQ.3 ) THEN
*
-* ITYPE=3: error = U V**H - I
+* ITYPE=3: error = U V* - I
*
IF( N.LT.2 )
$ RETURN
@@ -436,7 +432,7 @@ SUBROUTINE ZHPT21( ITYPE, UPLO, N, KBAND, AP, D, E, U, LDU, VP,
*
* Do Test 2
*
-* Compute U U**H - I
+* Compute UU* - I
*
IF( ITYPE.EQ.1 ) THEN
CALL ZGEMM( 'N', 'C', N, N, N, CONE, U, LDU, U, LDU, CZERO,
From d7be8c7220273c827813e9394f5e681b1e32d7a8 Mon Sep 17 00:00:00 2001
From: Martin Kroeker <martin@ruby.chemie.uni-freiburg.de>
Date: Tue, 31 Dec 2019 13:40:06 +0100
Subject: [PATCH 2/2] Rebase on 3.9.0
---
TESTING/EIG/chet21.f | 32 +++++++++++++++++---------------
TESTING/EIG/chpt21.f | 35 ++++++++++++++++++++---------------
TESTING/EIG/zhet21.f | 32 +++++++++++++++++---------------
TESTING/EIG/zhpt21.f | 36 ++++++++++++++++++++----------------
4 files changed, 74 insertions(+), 61 deletions(-)
diff --git a/TESTING/EIG/chet21.f b/TESTING/EIG/chet21.f
index 5aff64904..d5c4f1348 100644
--- a/TESTING/EIG/chet21.f
+++ b/TESTING/EIG/chet21.f
@@ -29,8 +29,9 @@
*>
*> CHET21 generally checks a decomposition of the form
*>
-*> A = U S UC>
-*> where * means conjugate transpose, A is hermitian, U is unitary, and
+*> A = U S U**H
+*>
+*> where **H means conjugate transpose, A is hermitian, U is unitary, and
*> S is diagonal (if KBAND=0) or (real) symmetric tridiagonal (if
*> KBAND=1).
*>
@@ -42,18 +43,19 @@
*>
*> Specifically, if ITYPE=1, then:
*>
-*> RESULT(1) = | A - U S U* | / ( |A| n ulp ) *andC> RESULT(2) = | I - UU* | / ( n ulp )
+*> RESULT(1) = | A - U S U**H | / ( |A| n ulp ) and
+*> RESULT(2) = | I - U U**H | / ( n ulp )
*>
*> If ITYPE=2, then:
*>
-*> RESULT(1) = | A - V S V* | / ( |A| n ulp )
+*> RESULT(1) = | A - V S V**H | / ( |A| n ulp )
*>
*> If ITYPE=3, then:
*>
-*> RESULT(1) = | I - UV* | / ( n ulp )
+*> RESULT(1) = | I - U V**H | / ( n ulp )
*>
*> For ITYPE > 1, the transformation U is expressed as a product
-*> V = H(1)...H(n-2), where H(j) = I - tau(j) v(j) v(j)C> and each
+*> V = H(1)...H(n-2), where H(j) = I - tau(j) v(j) v(j)**H and each
*> vector v(j) has its first j elements 0 and the remaining n-j elements
*> stored in V(j+1:n,j).
*> \endverbatim
@@ -66,14 +68,15 @@
*> ITYPE is INTEGER
*> Specifies the type of tests to be performed.
*> 1: U expressed as a dense unitary matrix:
-*> RESULT(1) = | A - U S U* | / ( |A| n ulp ) *andC> RESULT(2) = | I - UU* | / ( n ulp )
+*> RESULT(1) = | A - U S U**H | / ( |A| n ulp ) and
+*> RESULT(2) = | I - U U**H | / ( n ulp )
*>
*> 2: U expressed as a product V of Housholder transformations:
-*> RESULT(1) = | A - V S V* | / ( |A| n ulp )
+*> RESULT(1) = | A - V S V**H | / ( |A| n ulp )
*>
*> 3: U expressed both as a dense unitary matrix and
*> as a product of Housholder transformations:
-*> RESULT(1) = | I - UV* | / ( n ulp )
+*> RESULT(1) = | I - U V**H | / ( n ulp )
*> \endverbatim
*>
*> \param[in] UPLO
@@ -171,7 +174,7 @@
*> \verbatim
*> TAU is COMPLEX array, dimension (N)
*> If ITYPE >= 2, then TAU(j) is the scalar factor of
-*> v(j) v(j)* in the Householder transformation H(j) of
+*> v(j) v(j)**H in the Householder transformation H(j) of
*> the product U = H(1)...H(n-2)
*> If ITYPE < 2, then TAU is not referenced.
*> \endverbatim
@@ -294,7 +297,7 @@ SUBROUTINE CHET21( ITYPE, UPLO, N, KBAND, A, LDA, D, E, U, LDU, V,
*
IF( ITYPE.EQ.1 ) THEN
*
-* ITYPE=1: error = A - U S U*
+* ITYPE=1: error = A - U S U**H
*
CALL CLASET( 'Full', N, N, CZERO, CZERO, WORK, N )
CALL CLACPY( CUPLO, N, N, A, LDA, WORK, N )
@@ -304,7 +307,6 @@ SUBROUTINE CHET21( ITYPE, UPLO, N, KBAND, A, LDA, D, E, U, LDU, V,
10 CONTINUE
*
IF( N.GT.1 .AND. KBAND.EQ.1 ) THEN
-CMK DO 20 J = 1, N - 1
DO 20 J = 2, N - 1
CALL CHER2( CUPLO, N, -CMPLX( E( J ) ), U( 1, J ), 1,
$ U( 1, J-1 ), 1, WORK, N )
@@ -314,7 +316,7 @@ SUBROUTINE CHET21( ITYPE, UPLO, N, KBAND, A, LDA, D, E, U, LDU, V,
*
ELSE IF( ITYPE.EQ.2 ) THEN
*
-* ITYPE=2: error = V S V* - A
+* ITYPE=2: error = V S V**H - A
*
CALL CLASET( 'Full', N, N, CZERO, CZERO, WORK, N )
*
@@ -371,7 +373,7 @@ SUBROUTINE CHET21( ITYPE, UPLO, N, KBAND, A, LDA, D, E, U, LDU, V,
*
ELSE IF( ITYPE.EQ.3 ) THEN
*
-* ITYPE=3: error = U V* - I
+* ITYPE=3: error = U V**H - I
*
IF( N.LT.2 )
$ RETURN
@@ -407,7 +409,7 @@ SUBROUTINE CHET21( ITYPE, UPLO, N, KBAND, A, LDA, D, E, U, LDU, V,
*
* Do Test 2
*
-* Compute UU* - I
+* Compute U U**H - I
*
IF( ITYPE.EQ.1 ) THEN
CALL CGEMM( 'N', 'C', N, N, N, CONE, U, LDU, U, LDU, CZERO,
diff --git a/TESTING/EIG/chpt21.f b/TESTING/EIG/chpt21.f
index e151a8bd8..f20921bd9 100644
--- a/TESTING/EIG/chpt21.f
+++ b/TESTING/EIG/chpt21.f
@@ -29,8 +29,9 @@
*>
*> CHPT21 generally checks a decomposition of the form
*>
-*> A = U S UC>
-*> where * means conjugate transpose, A is hermitian, U is
+*> A = U S U**H
+*>
+*> where **H means conjugate transpose, A is hermitian, U is
*> unitary, and S is diagonal (if KBAND=0) or (real) symmetric
*> tridiagonal (if KBAND=1). If ITYPE=1, then U is represented as
*> a dense matrix, otherwise the U is expressed as a product of
@@ -41,15 +42,16 @@
*>
*> Specifically, if ITYPE=1, then:
*>
-*> RESULT(1) = | A - U S U* | / ( |A| n ulp ) *andC> RESULT(2) = | I - UU* | / ( n ulp )
+*> RESULT(1) = | A - U S U**H | / ( |A| n ulp ) and
+*> RESULT(2) = | I - U U**H | / ( n ulp )
*>
*> If ITYPE=2, then:
*>
-*> RESULT(1) = | A - V S V* | / ( |A| n ulp )
+*> RESULT(1) = | A - V S V**H | / ( |A| n ulp )
*>
*> If ITYPE=3, then:
*>
-*> RESULT(1) = | I - UV* | / ( n ulp )
+*> RESULT(1) = | I - U V**H | / ( n ulp )
*>
*> Packed storage means that, for example, if UPLO='U', then the columns
*> of the upper triangle of A are stored one after another, so that
@@ -70,14 +72,16 @@
*>
*> If UPLO='U', then V = H(n-1)...H(1), where
*>
-*> H(j) = I - tau(j) v(j) v(j)C>
+*> H(j) = I - tau(j) v(j) v(j)**H
+*>
*> and the first j-1 elements of v(j) are stored in V(1:j-1,j+1),
*> (i.e., VP( j*(j+1)/2 + 1 : j*(j+1)/2 + j-1 ) ),
*> the j-th element is 1, and the last n-j elements are 0.
*>
*> If UPLO='L', then V = H(1)...H(n-1), where
*>
-*> H(j) = I - tau(j) v(j) v(j)C>
+*> H(j) = I - tau(j) v(j) v(j)**H
+*>
*> and the first j elements of v(j) are 0, the (j+1)-st is 1, and the
*> (j+2)-nd through n-th elements are stored in V(j+2:n,j) (i.e.,
*> in VP( (2*n-j)*(j-1)/2 + j+2 : (2*n-j)*(j-1)/2 + n ) .)
@@ -91,14 +95,15 @@
*> ITYPE is INTEGER
*> Specifies the type of tests to be performed.
*> 1: U expressed as a dense unitary matrix:
-*> RESULT(1) = | A - U S U* | / ( |A| n ulp ) *andC> RESULT(2) = | I - UU* | / ( n ulp )
+*> RESULT(1) = | A - U S U**H | / ( |A| n ulp ) and
+*> RESULT(2) = | I - U U**H | / ( n ulp )
*>
*> 2: U expressed as a product V of Housholder transformations:
-*> RESULT(1) = | A - V S V* | / ( |A| n ulp )
+*> RESULT(1) = | A - V S V**H | / ( |A| n ulp )
*>
*> 3: U expressed both as a dense unitary matrix and
*> as a product of Housholder transformations:
-*> RESULT(1) = | I - UV* | / ( n ulp )
+*> RESULT(1) = | I - U V**H | / ( n ulp )
*> \endverbatim
*>
*> \param[in] UPLO
@@ -181,7 +186,7 @@
*> \verbatim
*> TAU is COMPLEX array, dimension (N)
*> If ITYPE >= 2, then TAU(j) is the scalar factor of
-*> v(j) v(j)* in the Householder transformation H(j) of
+*> v(j) v(j)**H in the Householder transformation H(j) of
*> the product U = H(1)...H(n-2)
*> If ITYPE < 2, then TAU is not referenced.
*> \endverbatim
@@ -313,7 +318,7 @@ SUBROUTINE CHPT21( ITYPE, UPLO, N, KBAND, AP, D, E, U, LDU, VP,
*
IF( ITYPE.EQ.1 ) THEN
*
-* ITYPE=1: error = A - U S U*
+* ITYPE=1: error = A - U S U**H
*
CALL CLASET( 'Full', N, N, CZERO, CZERO, WORK, N )
CALL CCOPY( LAP, AP, 1, WORK, 1 )
@@ -332,7 +337,7 @@ SUBROUTINE CHPT21( ITYPE, UPLO, N, KBAND, AP, D, E, U, LDU, VP,
*
ELSE IF( ITYPE.EQ.2 ) THEN
*
-* ITYPE=2: error = V S V* - A
+* ITYPE=2: error = V S V**H - A
*
CALL CLASET( 'Full', N, N, CZERO, CZERO, WORK, N )
*
@@ -400,7 +405,7 @@ SUBROUTINE CHPT21( ITYPE, UPLO, N, KBAND, AP, D, E, U, LDU, VP,
*
ELSE IF( ITYPE.EQ.3 ) THEN
*
-* ITYPE=3: error = U V* - I
+* ITYPE=3: error = U V**H - I
*
IF( N.LT.2 )
$ RETURN
@@ -431,7 +436,7 @@ SUBROUTINE CHPT21( ITYPE, UPLO, N, KBAND, AP, D, E, U, LDU, VP,
*
* Do Test 2
*
-* Compute UU* - I
+* Compute U U**H - I
*
IF( ITYPE.EQ.1 ) THEN
CALL CGEMM( 'N', 'C', N, N, N, CONE, U, LDU, U, LDU, CZERO,
diff --git a/TESTING/EIG/zhet21.f b/TESTING/EIG/zhet21.f
index f6cb2d70a..cb854a850 100644
--- a/TESTING/EIG/zhet21.f
+++ b/TESTING/EIG/zhet21.f
@@ -29,8 +29,9 @@
*>
*> ZHET21 generally checks a decomposition of the form
*>
-*> A = U S UC>
-*> where * means conjugate transpose, A is hermitian, U is unitary, and
+*> A = U S U**H
+*>
+*> where **H means conjugate transpose, A is hermitian, U is unitary, and
*> S is diagonal (if KBAND=0) or (real) symmetric tridiagonal (if
*> KBAND=1).
*>
@@ -42,18 +43,19 @@
*>
*> Specifically, if ITYPE=1, then:
*>
-*> RESULT(1) = | A - U S U* | / ( |A| n ulp ) *andC> RESULT(2) = | I - UU* | / ( n ulp )
+*> RESULT(1) = | A - U S U**H | / ( |A| n ulp ) and
+*> RESULT(2) = | I - U U**H | / ( n ulp )
*>
*> If ITYPE=2, then:
*>
-*> RESULT(1) = | A - V S V* | / ( |A| n ulp )
+*> RESULT(1) = | A - V S V**H | / ( |A| n ulp )
*>
*> If ITYPE=3, then:
*>
-*> RESULT(1) = | I - UV* | / ( n ulp )
+*> RESULT(1) = | I - U V**H | / ( n ulp )
*>
*> For ITYPE > 1, the transformation U is expressed as a product
-*> V = H(1)...H(n-2), where H(j) = I - tau(j) v(j) v(j)C> and each
+*> V = H(1)...H(n-2), where H(j) = I - tau(j) v(j) v(j)**H and each
*> vector v(j) has its first j elements 0 and the remaining n-j elements
*> stored in V(j+1:n,j).
*> \endverbatim
@@ -66,14 +68,15 @@
*> ITYPE is INTEGER
*> Specifies the type of tests to be performed.
*> 1: U expressed as a dense unitary matrix:
-*> RESULT(1) = | A - U S U* | / ( |A| n ulp ) *andC> RESULT(2) = | I - UU* | / ( n ulp )
+*> RESULT(1) = | A - U S U**H | / ( |A| n ulp ) and
+*> RESULT(2) = | I - U U**H | / ( n ulp )
*>
*> 2: U expressed as a product V of Housholder transformations:
-*> RESULT(1) = | A - V S V* | / ( |A| n ulp )
+*> RESULT(1) = | A - V S V**H | / ( |A| n ulp )
*>
*> 3: U expressed both as a dense unitary matrix and
*> as a product of Housholder transformations:
-*> RESULT(1) = | I - UV* | / ( n ulp )
+*> RESULT(1) = | I - U V**H | / ( n ulp )
*> \endverbatim
*>
*> \param[in] UPLO
@@ -171,7 +174,7 @@
*> \verbatim
*> TAU is COMPLEX*16 array, dimension (N)
*> If ITYPE >= 2, then TAU(j) is the scalar factor of
-*> v(j) v(j)* in the Householder transformation H(j) of
+*> v(j) v(j)**H in the Householder transformation H(j) of
*> the product U = H(1)...H(n-2)
*> If ITYPE < 2, then TAU is not referenced.
*> \endverbatim
@@ -294,7 +297,7 @@ SUBROUTINE ZHET21( ITYPE, UPLO, N, KBAND, A, LDA, D, E, U, LDU, V,
*
IF( ITYPE.EQ.1 ) THEN
*
-* ITYPE=1: error = A - U S U*
+* ITYPE=1: error = A - U S U**H
*
CALL ZLASET( 'Full', N, N, CZERO, CZERO, WORK, N )
CALL ZLACPY( CUPLO, N, N, A, LDA, WORK, N )
@@ -304,7 +307,6 @@ SUBROUTINE ZHET21( ITYPE, UPLO, N, KBAND, A, LDA, D, E, U, LDU, V,
10 CONTINUE
*
IF( N.GT.1 .AND. KBAND.EQ.1 ) THEN
-CMK DO 20 J = 1, N - 1
DO 20 J = 2, N - 1
CALL ZHER2( CUPLO, N, -DCMPLX( E( J ) ), U( 1, J ), 1,
$ U( 1, J-1 ), 1, WORK, N )
@@ -314,7 +316,7 @@ SUBROUTINE ZHET21( ITYPE, UPLO, N, KBAND, A, LDA, D, E, U, LDU, V,
*
ELSE IF( ITYPE.EQ.2 ) THEN
*
-* ITYPE=2: error = V S V* - A
+* ITYPE=2: error = V S V**H - A
*
CALL ZLASET( 'Full', N, N, CZERO, CZERO, WORK, N )
*
@@ -371,7 +373,7 @@ SUBROUTINE ZHET21( ITYPE, UPLO, N, KBAND, A, LDA, D, E, U, LDU, V,
*
ELSE IF( ITYPE.EQ.3 ) THEN
*
-* ITYPE=3: error = U V* - I
+* ITYPE=3: error = U V**H - I
*
IF( N.LT.2 )
$ RETURN
@@ -407,7 +409,7 @@ SUBROUTINE ZHET21( ITYPE, UPLO, N, KBAND, A, LDA, D, E, U, LDU, V,
*
* Do Test 2
*
-* Compute UU* - I
+* Compute U U**H - I
*
IF( ITYPE.EQ.1 ) THEN
CALL ZGEMM( 'N', 'C', N, N, N, CONE, U, LDU, U, LDU, CZERO,
diff --git a/TESTING/EIG/zhpt21.f b/TESTING/EIG/zhpt21.f
index ef9e4418d..825d387c7 100644
--- a/TESTING/EIG/zhpt21.f
+++ b/TESTING/EIG/zhpt21.f
@@ -29,8 +29,9 @@
*>
*> ZHPT21 generally checks a decomposition of the form
*>
-*> A = U S UC>
-*> where * means conjugate transpose, A is hermitian, U is
+*> A = U S U**H
+*>
+*> where **H means conjugate transpose, A is hermitian, U is
*> unitary, and S is diagonal (if KBAND=0) or (real) symmetric
*> tridiagonal (if KBAND=1). If ITYPE=1, then U is represented as
*> a dense matrix, otherwise the U is expressed as a product of
@@ -41,15 +42,16 @@
*>
*> Specifically, if ITYPE=1, then:
*>
-*> RESULT(1) = | A - U S U* | / ( |A| n ulp ) *andC> RESULT(2) = | I - UU* | / ( n ulp )
+*> RESULT(1) = | A - U S U**H | / ( |A| n ulp ) and
+*> RESULT(2) = | I - U U**H | / ( n ulp )
*>
*> If ITYPE=2, then:
*>
-*> RESULT(1) = | A - V S V* | / ( |A| n ulp )
+*> RESULT(1) = | A - V S V**H | / ( |A| n ulp )
*>
*> If ITYPE=3, then:
*>
-*> RESULT(1) = | I - UV* | / ( n ulp )
+*> RESULT(1) = | I - U V**H | / ( n ulp )
*>
*> Packed storage means that, for example, if UPLO='U', then the columns
*> of the upper triangle of A are stored one after another, so that
@@ -70,14 +72,16 @@
*>
*> If UPLO='U', then V = H(n-1)...H(1), where
*>
-*> H(j) = I - tau(j) v(j) v(j)C>
+*> H(j) = I - tau(j) v(j) v(j)**H
+*>
*> and the first j-1 elements of v(j) are stored in V(1:j-1,j+1),
*> (i.e., VP( j*(j+1)/2 + 1 : j*(j+1)/2 + j-1 ) ),
*> the j-th element is 1, and the last n-j elements are 0.
*>
*> If UPLO='L', then V = H(1)...H(n-1), where
*>
-*> H(j) = I - tau(j) v(j) v(j)C>
+*> H(j) = I - tau(j) v(j) v(j)**H
+*>
*> and the first j elements of v(j) are 0, the (j+1)-st is 1, and the
*> (j+2)-nd through n-th elements are stored in V(j+2:n,j) (i.e.,
*> in VP( (2*n-j)*(j-1)/2 + j+2 : (2*n-j)*(j-1)/2 + n ) .)
@@ -91,14 +95,15 @@
*> ITYPE is INTEGER
*> Specifies the type of tests to be performed.
*> 1: U expressed as a dense unitary matrix:
-*> RESULT(1) = | A - U S U* | / ( |A| n ulp ) *andC> RESULT(2) = | I - UU* | / ( n ulp )
+*> RESULT(1) = | A - U S U**H | / ( |A| n ulp ) and
+*> RESULT(2) = | I - U U**H | / ( n ulp )
*>
*> 2: U expressed as a product V of Housholder transformations:
-*> RESULT(1) = | A - V S V* | / ( |A| n ulp )
+*> RESULT(1) = | A - V S V**H | / ( |A| n ulp )
*>
*> 3: U expressed both as a dense unitary matrix and
*> as a product of Housholder transformations:
-*> RESULT(1) = | I - UV* | / ( n ulp )
+*> RESULT(1) = | I - U V**H | / ( n ulp )
*> \endverbatim
*>
*> \param[in] UPLO
@@ -181,7 +186,7 @@
*> \verbatim
*> TAU is COMPLEX*16 array, dimension (N)
*> If ITYPE >= 2, then TAU(j) is the scalar factor of
-*> v(j) v(j)* in the Householder transformation H(j) of
+*> v(j) v(j)**H in the Householder transformation H(j) of
*> the product U = H(1)...H(n-2)
*> If ITYPE < 2, then TAU is not referenced.
*> \endverbatim
@@ -313,7 +318,7 @@ SUBROUTINE ZHPT21( ITYPE, UPLO, N, KBAND, AP, D, E, U, LDU, VP,
*
IF( ITYPE.EQ.1 ) THEN
*
-* ITYPE=1: error = A - U S U*
+* ITYPE=1: error = A - U S U**H
*
CALL ZLASET( 'Full', N, N, CZERO, CZERO, WORK, N )
CALL ZCOPY( LAP, AP, 1, WORK, 1 )
@@ -323,7 +328,6 @@ SUBROUTINE ZHPT21( ITYPE, UPLO, N, KBAND, AP, D, E, U, LDU, VP,
10 CONTINUE
*
IF( N.GT.1 .AND. KBAND.EQ.1 ) THEN
-CMK DO 20 J = 1, N - 1
DO 20 J = 2, N - 1
CALL ZHPR2( CUPLO, N, -DCMPLX( E( J ) ), U( 1, J ), 1,
$ U( 1, J-1 ), 1, WORK )
@@ -333,7 +337,7 @@ SUBROUTINE ZHPT21( ITYPE, UPLO, N, KBAND, AP, D, E, U, LDU, VP,
*
ELSE IF( ITYPE.EQ.2 ) THEN
*
-* ITYPE=2: error = V S V* - A
+* ITYPE=2: error = V S V**H - A
*
CALL ZLASET( 'Full', N, N, CZERO, CZERO, WORK, N )
*
@@ -401,7 +405,7 @@ SUBROUTINE ZHPT21( ITYPE, UPLO, N, KBAND, AP, D, E, U, LDU, VP,
*
ELSE IF( ITYPE.EQ.3 ) THEN
*
-* ITYPE=3: error = U V* - I
+* ITYPE=3: error = U V**H - I
*
IF( N.LT.2 )
$ RETURN
@@ -432,7 +436,7 @@ SUBROUTINE ZHPT21( ITYPE, UPLO, N, KBAND, AP, D, E, U, LDU, VP,
*
* Do Test 2
*
-* Compute UU* - I
+* Compute U U**H - I
*
IF( ITYPE.EQ.1 ) THEN
CALL ZGEMM( 'N', 'C', N, N, N, CONE, U, LDU, U, LDU, CZERO,

View File

@ -1,39 +0,0 @@
From 489a2884c22e8593ec47bfe7c84ab451b0c0d3d9 Mon Sep 17 00:00:00 2001
From: Julien Schueller <schueller@phimeca.com>
Date: Mon, 25 Nov 2019 19:41:16 +0100
Subject: [PATCH] Fix MinGW build error
With MinGW the build fails for some LAPACKE xgesvd routines with:
lapacke_cgesvdq.c:74:5: error: aggregate value used where an integer was expected
Seems the C2INT macro is useful there.
---
LAPACKE/src/lapacke_cgesvdq.c | 2 +-
LAPACKE/src/lapacke_zgesvdq.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/LAPACKE/src/lapacke_cgesvdq.c b/LAPACKE/src/lapacke_cgesvdq.c
index 801569453..6ecd06962 100644
--- a/LAPACKE/src/lapacke_cgesvdq.c
+++ b/LAPACKE/src/lapacke_cgesvdq.c
@@ -71,7 +71,7 @@ lapack_int LAPACKE_cgesvdq( int matrix_layout, char joba, char jobp,
goto exit_level_0;
}
liwork = (lapack_int)iwork_query;
- lcwork = (lapack_int)cwork_query;
+ lcwork = LAPACK_C2INT(cwork_query);
lrwork = (lapack_int)rwork_query;
/* Allocate memory for work arrays */
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * liwork );
diff --git a/LAPACKE/src/lapacke_zgesvdq.c b/LAPACKE/src/lapacke_zgesvdq.c
index 7c205dab3..1674138fc 100644
--- a/LAPACKE/src/lapacke_zgesvdq.c
+++ b/LAPACKE/src/lapacke_zgesvdq.c
@@ -71,7 +71,7 @@ lapack_int LAPACKE_zgesvdq( int matrix_layout, char joba, char jobp,
goto exit_level_0;
}
liwork = (lapack_int)iwork_query;
- lcwork = (lapack_int)cwork_query;
+ lcwork = LAPACK_C2INT(cwork_query);
lrwork = (lapack_int)rwork_query;
/* Allocate memory for work arrays */
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * liwork );

View File

@ -1,81 +0,0 @@
From 0631b6beaed60ba118b0b027c0f8d35397bf5df0 Mon Sep 17 00:00:00 2001
From: Keno Fischer <keno@juliacomputing.com>
Date: Thu, 30 Sep 2021 03:51:23 -0400
Subject: [PATCH] Fix out of bounds read in slarrv
This was originally reported as https://github.com/JuliaLang/julia/issues/42415.
I've tracked this down to an our of bounds read on the following line:
https://github.com/Reference-LAPACK/lapack/blob/44ecb6a5ff821b1cbb39f8cc2166cb098e060b4d/SRC/slarrv.f#L423
In the crashing example, `M` is `0`, causing `slarrv` to read uninitialized
memory from the work array. I believe the `0` for `M` is correct and indeed,
the documentation above supports that `M` may be zero:
https://github.com/Reference-LAPACK/lapack/blob/44ecb6a5ff821b1cbb39f8cc2166cb098e060b4d/SRC/slarrv.f#L113-L116
I believe it may be sufficient to early-out this function as suggested
in this PR. However, I have limited context for the full routine here,
so I would appreciate a sanity check.
---
SRC/clarrv.f | 2 +-
SRC/dlarrv.f | 2 +-
SRC/slarrv.f | 2 +-
SRC/zlarrv.f | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/SRC/clarrv.f b/SRC/clarrv.f
index 1f09e4da6..42f710757 100644
--- a/SRC/clarrv.f
+++ b/SRC/clarrv.f
@@ -348,7 +348,7 @@
*
* Quick return if possible
*
- IF( N.LE.0 ) THEN
+ IF( (N.LE.0).OR.(M.LE.0) ) THEN
RETURN
END IF
*
diff --git a/SRC/dlarrv.f b/SRC/dlarrv.f
index b036c1e66..299430361 100644
--- a/SRC/dlarrv.f
+++ b/SRC/dlarrv.f
@@ -350,7 +350,7 @@
*
* Quick return if possible
*
- IF( N.LE.0 ) THEN
+ IF( (N.LE.0).OR.(M.LE.0) ) THEN
RETURN
END IF
*
diff --git a/SRC/slarrv.f b/SRC/slarrv.f
index 9d72b339a..95f94fd1b 100644
--- a/SRC/slarrv.f
+++ b/SRC/slarrv.f
@@ -350,7 +350,7 @@
*
* Quick return if possible
*
- IF( N.LE.0 ) THEN
+ IF( (N.LE.0).OR.(M.LE.0) ) THEN
RETURN
END IF
*
diff --git a/SRC/zlarrv.f b/SRC/zlarrv.f
index 51ec558f5..e4be63e0d 100644
--- a/SRC/zlarrv.f
+++ b/SRC/zlarrv.f
@@ -348,7 +348,7 @@
*
* Quick return if possible
*
- IF( N.LE.0 ) THEN
+ IF( (N.LE.0).OR.(M.LE.0) ) THEN
RETURN
END IF
*
--
2.31.1

View File

@ -1,55 +0,0 @@
From d168b4d2ae678904fb659b3caf27bce668f544e4 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <h.vetinari@gmx.com>
Date: Sun, 26 Apr 2020 00:57:37 +0200
Subject: [PATCH] Fix some minor inconsistencies in LAPACK(E)_[cz]gesvdq
For LAPACKE_cgesvdq, align datatype of `rwork` with lapacke.h and callsite
in LAPACKE_cgesvdq_work; both of the latter use `float* rwork`, so there's
no need to calculate with doubles that only get downcast anyway.
Similarly, make the signature of lapacke_zgesvdq_work consistent across
lapack.h (modified here), the fortran side and lapacke_zgesvdq_work, see:
https://github.com/Reference-LAPACK/lapack/blob/v3.9.0/LAPACKE/src/lapacke_zgesvdq_work.c#L42
https://github.com/Reference-LAPACK/lapack/blob/v3.9.0/SRC/zgesvdq.f#L422
---
LAPACKE/include/lapack.h | 2 +-
LAPACKE/src/lapacke_cgesvdq.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/LAPACKE/include/lapack.h b/LAPACKE/include/lapack.h
index 4f48b7c87..c045892df 100644
--- a/LAPACKE/include/lapack.h
+++ b/LAPACKE/include/lapack.h
@@ -2513,7 +2513,7 @@ void LAPACK_zgesvdq(
lapack_complex_double* U, lapack_int const* ldu,
lapack_complex_double* V, lapack_int const* ldv, lapack_int* numrank,
lapack_int* iwork, lapack_int const* liwork,
- lapack_complex_float* cwork, lapack_int* lcwork,
+ lapack_complex_double* cwork, lapack_int* lcwork,
double* rwork, lapack_int const* lrwork,
lapack_int* info );
diff --git a/LAPACKE/src/lapacke_cgesvdq.c b/LAPACKE/src/lapacke_cgesvdq.c
index 91458136c..c5eca535e 100644
--- a/LAPACKE/src/lapacke_cgesvdq.c
+++ b/LAPACKE/src/lapacke_cgesvdq.c
@@ -47,8 +47,8 @@ lapack_int LAPACKE_cgesvdq( int matrix_layout, char joba, char jobp,
lapack_complex_float* cwork = NULL;
lapack_complex_float cwork_query;
lapack_int lrwork = -1;
- double* rwork = NULL;
- double rwork_query;
+ float* rwork = NULL;
+ float rwork_query;
lapack_int i;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cgesvdq", -1 );
@@ -84,7 +84,7 @@ lapack_int LAPACKE_cgesvdq( int matrix_layout, char joba, char jobp,
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
- rwork = (double*)LAPACKE_malloc( sizeof(double) * lrwork );
+ rwork = (float*)LAPACKE_malloc( sizeof(float) * lrwork );
if( rwork == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;

View File

@ -1,10 +0,0 @@
--- lapack-3.9.0/TESTING/dbal.in.orig 2024-03-11 12:38:32.951363866 +0100
+++ lapack-3.9.0/TESTING/dbal.in 2024-03-11 12:38:39.239363717 +0100
@@ -209,6 +209,6 @@
0.00000000000000000000D+00 0.00000000000000000000D+00 0.00000000000000000000D+00 0.63043209914231165391D-03 0.10000000000000000000D+01 0.79310682416114036641D+03
0.00000000000000000000D+00 0.00000000000000000000D+00 0.00000000000000000000D+00 0.00000000000000000000D+00 0.12608641982846233078D-02 0.10000000000000000000D+01
- 2.494800386918399765D+291 1.582914569427869018D+175 1.004336277661868922D+59 3.186183822264904554D-58 5.053968264940243633D-175 0.40083367200179455560D-291;
+ 2.494800386918399765D+291 1.582914569427869018D+175 1.004336277661868922D+59 3.186183822264904554D-58 5.053968264940243633D-175 0.40083367200179455560D-291
0

View File

@ -1,138 +0,0 @@
From 87536aa3c8bb0af00f66088fb6ac05d87509e011 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@debian.org>
Date: Sat, 23 Nov 2019 12:22:20 +0100
Subject: [PATCH] Restore missing prototypes for deprecated LAPACK functions
Some LAPACK functions prototypes were inadvertedly dropped in 3.9.0. As a
consequence, LAPACKE has several unresolved symbols.
Closes #365
---
LAPACKE/include/lapack.h | 100 +++++++++++++++++++++++++++++++++++++++
1 file changed, 100 insertions(+)
diff --git a/LAPACKE/include/lapack.h b/LAPACKE/include/lapack.h
index 3f425325f4..5c131d8444 100644
--- a/LAPACKE/include/lapack.h
+++ b/LAPACKE/include/lapack.h
@@ -1842,6 +1842,28 @@ void LAPACK_zgeqlf(
lapack_complex_double* work, lapack_int const* lwork,
lapack_int* info );
+#define LAPACK_sgeqpf LAPACK_GLOBAL(sgeqpf,SGEQPF)
+void LAPACK_sgeqpf( lapack_int* m, lapack_int* n, float* a, lapack_int* lda,
+ lapack_int* jpvt, float* tau, float* work,
+ lapack_int *info );
+
+#define LAPACK_dgeqpf LAPACK_GLOBAL(dgeqpf,DGEQPF)
+void LAPACK_dgeqpf( lapack_int* m, lapack_int* n, double* a, lapack_int* lda,
+ lapack_int* jpvt, double* tau, double* work,
+ lapack_int *info );
+
+#define LAPACK_cgeqpf LAPACK_GLOBAL(cgeqpf,CGEQPF)
+void LAPACK_cgeqpf( lapack_int* m, lapack_int* n, lapack_complex_float* a,
+ lapack_int* lda, lapack_int* jpvt,
+ lapack_complex_float* tau, lapack_complex_float* work,
+ float* rwork, lapack_int *info );
+
+#define LAPACK_zgeqpf LAPACK_GLOBAL(zgeqpf,ZGEQPF)
+void LAPACK_zgeqpf( lapack_int* m, lapack_int* n, lapack_complex_double* a,
+ lapack_int* lda, lapack_int* jpvt,
+ lapack_complex_double* tau, lapack_complex_double* work,
+ double* rwork, lapack_int *info );
+
#define LAPACK_cgeqp3 LAPACK_GLOBAL(cgeqp3,CGEQP3)
void LAPACK_cgeqp3(
lapack_int const* m, lapack_int const* n,
@@ -3617,6 +3639,47 @@ void LAPACK_zggrqf(
lapack_complex_double* work, lapack_int const* lwork,
lapack_int* info );
+#define LAPACK_sggsvd LAPACK_GLOBAL(sggsvd,SGGSVD)
+lapack_int LAPACKE_sggsvd( int matrix_layout, char jobu, char jobv, char jobq,
+ lapack_int m, lapack_int n, lapack_int p,
+ lapack_int* k, lapack_int* l, float* a,
+ lapack_int lda, float* b, lapack_int ldb,
+ float* alpha, float* beta, float* u, lapack_int ldu,
+ float* v, lapack_int ldv, float* q, lapack_int ldq,
+ lapack_int* iwork );
+
+#define LAPACK_dggsvd LAPACK_GLOBAL(dggsvd,DGGSVD)
+lapack_int LAPACKE_dggsvd( int matrix_layout, char jobu, char jobv, char jobq,
+ lapack_int m, lapack_int n, lapack_int p,
+ lapack_int* k, lapack_int* l, double* a,
+ lapack_int lda, double* b, lapack_int ldb,
+ double* alpha, double* beta, double* u,
+ lapack_int ldu, double* v, lapack_int ldv, double* q,
+ lapack_int ldq, lapack_int* iwork );
+
+#define LAPACK_cggsvd LAPACK_GLOBAL(cggsvd,CGGSVD)
+lapack_int LAPACKE_cggsvd( int matrix_layout, char jobu, char jobv, char jobq,
+ lapack_int m, lapack_int n, lapack_int p,
+ lapack_int* k, lapack_int* l,
+ lapack_complex_float* a, lapack_int lda,
+ lapack_complex_float* b, lapack_int ldb,
+ float* alpha, float* beta, lapack_complex_float* u,
+ lapack_int ldu, lapack_complex_float* v,
+ lapack_int ldv, lapack_complex_float* q,
+ lapack_int ldq, lapack_int* iwork );
+
+#define LAPACK_zggsvd LAPACK_GLOBAL(zggsvd,ZGGSVD)
+lapack_int LAPACKE_zggsvd( int matrix_layout, char jobu, char jobv, char jobq,
+ lapack_int m, lapack_int n, lapack_int p,
+ lapack_int* k, lapack_int* l,
+ lapack_complex_double* a, lapack_int lda,
+ lapack_complex_double* b, lapack_int ldb,
+ double* alpha, double* beta,
+ lapack_complex_double* u, lapack_int ldu,
+ lapack_complex_double* v, lapack_int ldv,
+ lapack_complex_double* q, lapack_int ldq,
+ lapack_int* iwork );
+
#define LAPACK_cggsvd3 LAPACK_GLOBAL(cggsvd3,CGGSVD3)
void LAPACK_cggsvd3(
char const* jobu, char const* jobv, char const* jobq,
@@ -3679,6 +3742,43 @@ void LAPACK_zggsvd3(
lapack_int* iwork,
lapack_int* info );
+#define LAPACK_sggsvp LAPACK_GLOBAL(sggsvp,SGGSVP)
+lapack_int LAPACKE_sggsvp( int matrix_layout, char jobu, char jobv, char jobq,
+ lapack_int m, lapack_int p, lapack_int n, float* a,
+ lapack_int lda, float* b, lapack_int ldb, float tola,
+ float tolb, lapack_int* k, lapack_int* l, float* u,
+ lapack_int ldu, float* v, lapack_int ldv, float* q,
+ lapack_int ldq );
+
+#define LAPACK_dggsvp LAPACK_GLOBAL(dggsvp,DGGSVP)
+lapack_int LAPACKE_dggsvp( int matrix_layout, char jobu, char jobv, char jobq,
+ lapack_int m, lapack_int p, lapack_int n, double* a,
+ lapack_int lda, double* b, lapack_int ldb,
+ double tola, double tolb, lapack_int* k,
+ lapack_int* l, double* u, lapack_int ldu, double* v,
+ lapack_int ldv, double* q, lapack_int ldq );
+
+#define LAPACK_cggsvp LAPACK_GLOBAL(cggsvp,CGGSVP)
+lapack_int LAPACKE_cggsvp( int matrix_layout, char jobu, char jobv, char jobq,
+ lapack_int m, lapack_int p, lapack_int n,
+ lapack_complex_float* a, lapack_int lda,
+ lapack_complex_float* b, lapack_int ldb, float tola,
+ float tolb, lapack_int* k, lapack_int* l,
+ lapack_complex_float* u, lapack_int ldu,
+ lapack_complex_float* v, lapack_int ldv,
+ lapack_complex_float* q, lapack_int ldq );
+
+#define LAPACK_zggsvp LAPACK_GLOBAL(zggsvp,ZGGSVP)
+lapack_int LAPACKE_zggsvp( int matrix_layout, char jobu, char jobv, char jobq,
+ lapack_int m, lapack_int p, lapack_int n,
+ lapack_complex_double* a, lapack_int lda,
+ lapack_complex_double* b, lapack_int ldb,
+ double tola, double tolb, lapack_int* k,
+ lapack_int* l, lapack_complex_double* u,
+ lapack_int ldu, lapack_complex_double* v,
+ lapack_int ldv, lapack_complex_double* q,
+ lapack_int ldq );
+
#define LAPACK_cggsvp3 LAPACK_GLOBAL(cggsvp3,CGGSVP3)
void LAPACK_cggsvp3(
char const* jobu, char const* jobv, char const* jobq,

View File

@ -1,4 +1,4 @@
<multibuild> <multibuild>
<package>lapack-man</package> <package>static</package>
</multibuild> </multibuild>

View File

@ -1,16 +1,49 @@
liblapack3
libblas3 libblas3
-/usr/lib(64)?/libblas.so.3
requires "update-alternatives"
postin "ln -sf /etc/alternatives/libblas.so.3_<targettype> /usr/%_lib/libblas.so.3"
postin "/usr/sbin/update-alternatives --force --install /usr/%_lib/libblas.so.3 libblas.so.3_<targettype> /usr/%_lib/blas/libblas.so.3 50"
postun "/usr/sbin/update-alternatives --remove libblas.so.3_<targettype> /usr/%_lib/blas/libblas.so.3"
libcblas3 libcblas3
-/usr/lib(64)?/libcblas.so.3
requires "update-alternatives"
postin "ln -sf /etc/alternatives/libcblas.so.3_<targettype> /usr/%_lib/libcblas.so.3"
postin "/usr/sbin/update-alternatives --force --install /usr/%_lib/libcblas.so.3 libcblas.so.3_<targettype> /usr/%_lib/blas/libcblas.so.3 50"
postun "/usr/sbin/update-alternatives --remove libcblas.so.3_<targettype> /usr/%_lib/blas/libcblas.so.3"
liblapack3
-/usr/lib(64)?/liblapack.so.3
requires "update-alternatives"
postin "ln -sf /etc/alternatives/liblapack.so.3_<targettype> /usr/%_lib/liblapack.so.3"
postin "/usr/sbin/update-alternatives --force --install /usr/%_lib/liblapack.so.3 liblapack.so.3_<targettype> /usr/%_lib/lapack/liblapack.so.3 50"
postun "/usr/sbin/update-alternatives --remove liblapack.so.3_<targettype> /usr/%_lib/lapack/liblapack.so.3"
liblapacke3 liblapacke3
lapack-devel -/usr/lib(64)?/liblapacke.so.3
requires -lapack-<targettype> requires "update-alternatives"
requires "liblapack3-<targettype> = <version>" postin "ln -sf /etc/alternatives/liblapacke.so.3_<targettype> /usr/%_lib/liblapacke.so.3"
postin "/usr/sbin/update-alternatives --force --install /usr/%_lib/liblapacke.so.3 liblapacke.so.3_<targettype> /usr/%_lib/lapack/liblapacke.so.3 50"
postun "/usr/sbin/update-alternatives --remove liblapacke.so.3_<targettype> /usr/%_lib/lapack/liblapacke.so.3"
# Do not package pkgconfig files for devel packages as they lead to "choice"
# issues between -devel and -32bit-devel when using pkgconfig(FOO) based deps
blas-devel blas-devel
requires -blas-<targettype> -/usr/lib(64)?/pkgconfig/blas.pc
requires "blas-devel-<targettype> = <version>"
requires "libblas3-<targettype> = <version>" requires "libblas3-<targettype> = <version>"
cblas-devel cblas-devel
requires -cblas-<targettype> -/usr/lib(64)?/pkgconfig/cblas.pc
requires "blas-devel-<targettype> = <version>"
requires "libcblas3-<targettype> = <version>" requires "libcblas3-<targettype> = <version>"
lapack-devel
-/usr/lib(64)?/pkgconfig/lapack.pc
requires "blas-devel-<targettype> = <version>"
requires "liblapack3-<targettype> = <version>"
lapacke-devel lapacke-devel
requires -lapacke-<targettype> -/usr/lib(64)?/pkgconfig/lapacke.pc
requires "lapack-devel-<targettype> = <version>"
requires "liblapacke3-<targettype> = <version>" requires "liblapacke3-<targettype> = <version>"

13
fix-lapack-testing.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git a/lapack_testing.py b/lapack_testing.py
index ae59926b88..96fbeb2a68 100755
--- a/lapack_testing.py
+++ b/lapack_testing.py
@@ -136,7 +136,7 @@ def run_summary_test( f, cmdline, short_summary):
for line in pipe.readlines():
f.write(str(line))
words_in_line=line.split()
- if (line.find("run")!=-1):
+ if (line.find("run)")!=-1):
# print line
whereisrun=words_in_line.index("run)")
nb_test_run+=int(words_in_line[whereisrun-2])

BIN
lapack-3.12.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,10 +0,0 @@
Index: BLAS/SRC/Makefile
===================================================================
--- a/BLAS/SRC/Makefile.orig
+++ b/BLAS/SRC/Makefile
@@ -170,2 +170,5 @@ cleanobj:
cleanlib:
#rm -f $(BLASLIB) # May point to a system lib, e.g. -lblas
+
+dcabs1.o: dcabs1.f
+ $(FC) $(FFLAGS_NOOPT) -c $< -o $@

BIN
lapack-3.9.0.tar.gz (Stored with Git LFS)

Binary file not shown.

View File

@ -1,66 +0,0 @@
#
# spec file for package lapack-man
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: lapack-man
%define _name lapack
Version: 3.9.0
Release: 0
Summary: Manpages for LAPACK and BLAS
License: BSD-3-Clause
Group: Documentation/Other
URL: http://www.netlib.org/lapack/
Source0: https://github.com/Reference-LAPACK/lapack/archive/v%{version}.tar.gz#/lapack-%{version}.tar.gz
BuildRequires: doxygen >= 1.7
BuildRequires: fdupes
# Merged blas-man into lapack-man with 3.8.0 update
Provides: blas-man = %{version}
Obsoletes: blas-man < %{version}
BuildArch: noarch
%description
The lapack-man package contains documentation for LAPACK
(Linear Algebra PACKage) and BLAS (Basic Linear Algebra
Subprograms) routines, in the form of man pages.
%prep
%setup -q -n %{_name}-%{version}
%build
cp make.inc.example make.inc
make man %{?_smp_mflags}
# Remove some intermediate files
rm -f DOCS/man/man3/_*_.3
rm -f DOCS/man/man3/{BLAS_,}SRC_xerbla{_array,}.f.3
# rename conflicting man pages
pushd DOCS/man/man3
mv MAX.3 lapack-MAX.3
mv MIN.3 lapack-MIN.3
popd
%install
install -d %{buildroot}%{_mandir}/man3
install -m 0644 DOCS/man/man3/*.3 %{buildroot}%{_mandir}/man3/
%fdupes %{buildroot}/%{_mandir}/man3/
%files
%doc %{_mandir}/man3/*.3%{?ext_man}
%changelog

View File

@ -1,3 +1,52 @@
-------------------------------------------------------------------
Mon Nov 4 16:48:42 UTC 2024 - Guillaume GARDET <guillaume.gardet@opensuse.org>
- Fix previous commit for static build on aarch64
- Run %fdupes on man folder as suggested by rpmlint
-------------------------------------------------------------------
Mon Nov 4 09:42:18 UTC 2024 - Guillaume GARDET <guillaume.gardet@opensuse.org>
- Add -ffp-contract=off flag for aarch64 to avoid precision issues
https://github.com/scipy/scipy/issues/21475#issuecomment-2454203196
-------------------------------------------------------------------
Thu Jul 4 11:54:08 UTC 2024 - Daniel Garcia <daniel.garcia@suse.com>
- Add fix-lapack-testing.patch to fix tests
gh#Reference-LAPACK/lapack@5b0687f429cf
-------------------------------------------------------------------
Fri Jun 14 03:09:33 UTC 2024 - Atri Bhattacharya <badshah400@gmail.com>
- Rename isnan man file to avoid conflict with libm's isnan (from
package man-pages).
-------------------------------------------------------------------
Sat May 4 20:55:24 UTC 2024 - Atri Bhattacharya <badshah400@gmail.com>
- Update to version 3.12.0 (boo#1223783):
* Long list of changes, see
<https://netlib.org/lapack/lapack-3.12.0.html>.
- Drop all upstreamed or otherwise fixed patches:
* lapack-3.2.2.patch
* Fix-MinGW-build-error.patch
* Fix-some-minor-inconsistencies-in-LAPACKE_czgesvdq.patch
* Avoid-out-of-bounds-accesses-in-complex-EIG-tests.patch
* Fix-out-of-bounds-read.patch
* Restore_missing_deprecated_prototypes.patch
* Fix-testing-input.patch
- Use cmake for configure and ninja for build.
- Package pkgconf and cmake scripts for -devel pkgs.
- Drop multibuild flavour for man files.
- Add multibuild flavour for static libs (also used to build man
files).
- Build man files using doxygen instead of using pre-built files.
- Explicitly symlink library to relocated shared libs in
baselibs.conf (boo#1207563).
- Recommend lapack-man package from
{blas,lapack,lapacke,cblas}-devel packages.
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Mar 11 11:42:31 UTC 2024 - Richard Biener <rguenther@suse.com> Mon Mar 11 11:42:31 UTC 2024 - Richard Biener <rguenther@suse.com>

View File

@ -16,40 +16,51 @@
# #
%global flavor @BUILD_FLAVOR@%{nil}
%global pname lapack
%if "%{flavor}" == "static"
%define psuffix -static
%bcond_with shared
# Generate man files for the static flavour to avoid additional deps/build time
# for main flavour
%bcond_without man
%else
%define psuffix %{nil}
%bcond_without shared
%bcond_with man
%endif
%define __builder ninja
%define so_ver 3
%bcond_without tmg %bcond_without tmg
%if 0%{?suse_version} > 1500 # For Leap 15.X, we do not need arch dependent symlink names because no baselibs are generated
%if 0%{?suse_version} >= 1500
%define a_x _%{_arch} %define a_x _%{_arch}
%endif %endif
Name: %{pname}%{?psuffix}
Name: lapack Version: 3.12.0
Version: 3.9.0
Release: 0 Release: 0
Summary: Linear Algebra Package Summary: Linear Algebra PACKage
License: BSD-3-Clause License: BSD-3-Clause
Group: Development/Libraries/Parallel
URL: https://www.netlib.org/lapack/ URL: https://www.netlib.org/lapack/
Source0: https://github.com/Reference-LAPACK/lapack/archive/v%{version}.tar.gz#/lapack-%{version}.tar.gz Source0: https://github.com/Reference-LAPACK/lapack/archive/v%{version}.tar.gz#/%{pname}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM fix-lapack-testing.patch gh#Reference-LAPACK/lapack@5b0687f429cf
Patch1: fix-lapack-testing.patch
Source98: lapack.rpmlintrc Source98: lapack.rpmlintrc
Source99: baselibs.conf Source99: baselibs.conf
Patch1: lapack-3.2.2.patch BuildRequires: cmake
# PATCH-FIX-UPSTREAM -- https://github.com/Reference-LAPACK/lapack/commit/489a2884c22e.patch BuildRequires: fdupes
Patch2: Fix-MinGW-build-error.patch BuildRequires: gcc-c++
# PATCH-FIX-UPSTREAM -- https://github.com/Reference-LAPACK/lapack/commit/d168b4d2ae67.patch
Patch3: Fix-some-minor-inconsistencies-in-LAPACKE_czgesvdq.patch
# PATCH-FIX-UPSTREAM -- https://github.com/Reference-LAPACK/lapack/commit/ea2a102d3827.patch
Patch4: Avoid-out-of-bounds-accesses-in-complex-EIG-tests.patch
# PATCH-FIX-UPSTREAM -- https://github.com/Reference-LAPACK/lapack/commit/38f3eeee3108b18158409ca2a100e6fe03754781
Patch5: Fix-out-of-bounds-read.patch
# PATCH-FIX-UPSTREAM
Patch6: https://github.com/Reference-LAPACK/lapack/commit/87536aa3c8bb.patch#/Restore_missing_deprecated_prototypes.patch
# PATCH-FIX-UPSTREAM -- https://github.com/Reference-LAPACK/lapack/commit/64e8a7500d817869e5fcde35afd39af8bc7a8086
Patch7: Fix-testing-input.patch
BuildRequires: gcc-fortran BuildRequires: gcc-fortran
BuildRequires: ninja
BuildRequires: python-rpm-macros
BuildRequires: python3-base BuildRequires: python3-base
BuildRequires: update-alternatives # SECTION Requirements for MAN files
Requires(pre): update-alternatives %if %{with man}
BuildRequires: doxygen
BuildRequires: graphviz
%endif
# /SECTION
%description %description
LAPACK provides routines for solving systems of simultaneous linear LAPACK provides routines for solving systems of simultaneous linear
@ -62,12 +73,14 @@ matrices are handled, but not general sparse matrices. In all areas,
similar functionality is provided for real and complex matrices, in similar functionality is provided for real and complex matrices, in
both single and double precision. both single and double precision.
%package -n liblapack3
Summary: LAPACK Shared Library
Group: Development/Libraries/Parallel
Requires(pre): update-alternatives
%description -n liblapack3 # LAPACK
%package -n liblapack%{so_ver}
Summary: Linear Algebra PACKage: Shared Library
Requires(post): update-alternatives
Requires(postun): update-alternatives
%description -n liblapack%{so_ver}
LAPACK provides routines for solving systems of simultaneous linear LAPACK provides routines for solving systems of simultaneous linear
equations, least-squares solutions of linear systems of equations, equations, least-squares solutions of linear systems of equations,
eigenvalue problems, and singular value problems. The associated matrix eigenvalue problems, and singular value problems. The associated matrix
@ -78,55 +91,62 @@ matrices are handled, but not general sparse matrices. In all areas,
similar functionality is provided for real and complex matrices, in similar functionality is provided for real and complex matrices, in
both single and double precision. both single and double precision.
%package -n libblas3 This package provides the shared library for LAPACK.
Summary: BLAS Shared Library
Group: Development/Libraries/Parallel
Requires(pre): update-alternatives
%description -n libblas3 %package -n %{pname}-devel
Summary: Linear Algebra PACKage: headers and source files for development
Requires: blas-devel = %{version}
Requires: liblapack%{so_ver} = %{version}
Recommends: lapack-man = %{version}
Provides: lapack = %{version}
Obsoletes: lapack < %{version}
%description -n %{pname}-devel
LAPACK provides routines for solving systems of simultaneous linear
equations, least-squares solutions of linear systems of equations,
eigenvalue problems, and singular value problems. The associated matrix
factorizations (LU, Cholesky, QR, SVD, Schur, generalized Schur) are
also provided, as are related computations such as reordering of the
Schur factorizations and estimating condition numbers. Dense and banded
matrices are handled, but not general sparse matrices. In all areas,
similar functionality is provided for real and complex matrices, in
both single and double precision.
%package -n %{pname}-devel-static
Summary: Linear Algebra PACKage - static libraries
Requires: lapack-devel = %{version}
%description -n %{pname}-devel-static
LAPACK provides routines for solving systems of simultaneous linear
equations, least-squares solutions of linear systems of equations,
eigenvalue problems, and singular value problems. The associated matrix
factorizations (LU, Cholesky, QR, SVD, Schur, generalized Schur) are
also provided, as are related computations such as reordering of the
Schur factorizations and estimating condition numbers. Dense and banded
matrices are handled, but not general sparse matrices. In all areas,
similar functionality is provided for real and complex matrices, in
both single and double precision.
This package provides the static library for LAPACK.
# BLAS
%package -n libblas%{so_ver}
Summary: Basic Linear Algebra Subprograms: Shared Library
Requires(post): update-alternatives
Requires(postun): update-alternatives
%description -n libblas%{so_ver}
BLAS (Basic Linear Algebra Subprograms) is a standard library for BLAS (Basic Linear Algebra Subprograms) is a standard library for
numerical algebra. BLAS provides a number of basic algorithms for numerical algebra. BLAS provides a number of basic algorithms for
linear algebra. linear algebra.
%package devel This package provides the shared library for BLAS.
Summary: Linear Algebra Package
Group: Development/Libraries/Parallel
Requires: blas-devel = %{version}
Requires: liblapack3 = %{version}
Provides: lapack = %{version}
Obsoletes: lapack < %{version}
%description devel
LAPACK provides routines for solving systems of simultaneous linear
equations, least-squares solutions of linear systems of equations,
eigenvalue problems, and singular value problems. The associated matrix
factorizations (LU, Cholesky, QR, SVD, Schur, generalized Schur) are
also provided, as are related computations such as reordering of the
Schur factorizations and estimating condition numbers. Dense and banded
matrices are handled, but not general sparse matrices. In all areas,
similar functionality is provided for real and complex matrices, in
both single and double precision.
%package devel-static
Summary: Linear Algebra Package - static libraries
Group: Development/Libraries/Parallel
Requires: lapack-devel = %{version}
%description devel-static
LAPACK provides routines for solving systems of simultaneous linear
equations, least-squares solutions of linear systems of equations,
eigenvalue problems, and singular value problems. The associated matrix
factorizations (LU, Cholesky, QR, SVD, Schur, generalized Schur) are
also provided, as are related computations such as reordering of the
Schur factorizations and estimating condition numbers. Dense and banded
matrices are handled, but not general sparse matrices. In all areas,
similar functionality is provided for real and complex matrices, in
both single and double precision.
%package -n blas-devel %package -n blas-devel
Summary: Basic Linear Algebra Subprograms Summary: Basic Linear Algebra Subprograms: headers and sources for development
Group: Development/Libraries/Parallel Requires: libblas%{so_ver} = %{version}
Requires: libblas3 = %{version} Recommends: lapack-man = %{version}
Provides: blas = %{version} Provides: blas = %{version}
Obsoletes: blas < %{version} Obsoletes: blas < %{version}
@ -138,8 +158,7 @@ and built with gfortran. BLAS manual pages are available in the
blas-man package. blas-man package.
%package -n blas-devel-static %package -n blas-devel-static
Summary: Basic Linear Algebra Subprograms Summary: Basic Linear Algebra Subprograms: static library
Group: Development/Libraries/Parallel
Requires: blas-devel = %{version} Requires: blas-devel = %{version}
%description -n blas-devel-static %description -n blas-devel-static
@ -149,299 +168,341 @@ linear algebra. BLAS is fast and well-tested, was written in FORTRAN 77
and built with gfortran. BLAS manual pages are available in the and built with gfortran. BLAS manual pages are available in the
blas-man package. blas-man package.
%package -n liblapacke3 This package provides the static library for BLAS.
Summary: LAPACKE development files
Group: Development/Libraries/C and C++
Requires(pre): update-alternatives
%description -n liblapacke3
# LAPACKE
%package -n liblapacke%{so_ver}
Summary: Native C Interface to LAPACK: shared library
Requires(post): update-alternatives
Requires(postun): update-alternatives
%description -n liblapacke%{so_ver}
This library provides a native C interface to LAPACK routines available This library provides a native C interface to LAPACK routines available
at www.netlib.org/lapack to facilitate usage of LAPACK functionality at www.netlib.org/lapack to facilitate usage of LAPACK functionality
for C programmers. for C programmers.
This implementation introduces:
- row-major and column-major matrix layout controlled by the first function
parameter;
- an implementation with working arrays (middle-level interface) as well as
without working arrays (high-level interface);
- input scalars passed by value;
- error code as a return value instead of the INFO parameter.
%package -n lapacke-devel %package -n lapacke-devel
Summary: LAPACKE development files Summary: Native C Interface to LAPACK: headers and sources for development
Group: Development/Libraries/C and C++ Requires: liblapacke%{so_ver} = %{version}
Requires: liblapacke3 = %{version} Recommends: lapack-man = %{version}
Provides: lapacke = %{version} Provides: lapacke = %{version}
%description -n lapacke-devel %description -n lapacke-devel
LAPACKE headers and development files. LAPACKE provides a native C interface to LAPACK routines available
at www.netlib.org/lapack to facilitate usage of LAPACK functionality
for C programmers.
This package provides LAPACKE headers and development files.
%package -n lapacke-devel-static %package -n lapacke-devel-static
Summary: LAPACKE static libraries Summary: Native C Interface to LAPACK: static library
Group: Development/Libraries/C and C++
Requires: lapacke-devel = %{version} Requires: lapacke-devel = %{version}
%description -n lapacke-devel-static %description -n lapacke-devel-static
LAPACKE development files - static libraries. LAPACKE provides a native C interface to LAPACK routines available
at www.netlib.org/lapack to facilitate usage of LAPACK functionality
for C programmers.
%package -n libcblas3 This package provides the static library for LAPACKE.
Summary: CBLAS Shared Library
Group: Development/Libraries/C and C++
Requires(pre): update-alternatives
# Only version ever packaged separately
Obsoletes: libcblas3 == 20110120
%description -n libcblas3
# CBLAS
%package -n libcblas%{so_ver}
Summary: Native C interface to BLAS: Shared Library
Requires(post): update-alternatives
Requires(postun): update-alternatives
%description -n libcblas%{so_ver}
This library provides a native C interface to BLAS routines available This library provides a native C interface to BLAS routines available
at www.netlib.org/blas to facilitate usage of BLAS functionality at www.netlib.org/blas to facilitate usage of BLAS functionality
for C programmers. for C programmers.
%package -n cblas-devel %package -n cblas-devel
Summary: CBLAS development files Summary: Native C interface to BLAS: headers and sources for development
Group: Development/Libraries/C and C++ Requires: libcblas%{so_ver} = %{version}
Requires: libcblas3 = %{version} Recommends: lapack-man = %{version}
Provides: cblas = %{version} Provides: cblas = %{version}
%description -n cblas-devel %description -n cblas-devel
cblas headers and development files. This library provides a native C interface to BLAS routines available
at www.netlib.org/blas to facilitate usage of BLAS functionality
for C programmers.
This package provides the cblas headers and development files.
%package -n cblas-devel-static %package -n cblas-devel-static
Summary: CBLAS - static libraries Summary: Native C interface to BLAS: static library
Group: Development/Libraries/C and C++
Requires: cblas-devel = %{version} Requires: cblas-devel = %{version}
%description -n cblas-devel-static %description -n cblas-devel-static
The cblas-devel-static package contains the CBLAS static libraries This library provides a native C interface to BLAS routines available
for -static linking. You do not need these, unless you link at www.netlib.org/blas to facilitate usage of BLAS functionality
statically, which is highly discouraged. for C programmers.
This package contains the CBLAS static libraries.
# TMGLIB
%package -n libtmglib%{so_ver}
Summary: Test Matrix Generator Library: shared library
%description -n libtmglib%{so_ver}
This package provides the shared library for tmglib, the Test Matrix Generator
Library.
%package -n tmglib-devel
Summary: Test Matrix Generator Library: headers and sources for development
Requires: libtmglib%{so_ver} = %{version}
%description -n tmglib-devel
This package provides the headers and sources needed to develop against tmglib,
the Test Matrix Generator Library.
%package -n tmglib-devel-static
Summary: Test Matrix Generator Library: static library
Requires: tmglib-devel
%description -n tmglib-devel-static
This package provides the headers and sources needed to develop against the
tmglib as a static library.
# MAN Pages
%package -n lapack-man
Summary: Man pages for BLAS, CBLAS, and LAPACK
%description -n lapack-man
This package provides the man pages for BLAS, CBLAS, and LAPACK.
%prep
%autosetup -p1 -n %{pname}-%{version}
sed -i -E '1{s@#!/usr/bin/env python[0-9]*@#!%{_bindir}/python%{python3_version}@}' lapack_testing.py
%build
%ifarch %{ix86} %ifarch %{ix86}
%if 0%{?sle_version:%sle_version} >= 150000 %if 0%{?sle_version:%sle_version} >= 150000
%global precflags "-mfpmath=sse" %global precflags "-mfpmath=sse"
%global test_precflags %precflags %global test_precflags %{precflags}
%else %else
%global test_precflags "-ffloat-store" %global test_precflags "-ffloat-store"
%endif %endif
%endif %endif
%prep %if %{without shared}
%setup -q
%autopatch -p1
sed -i -e '1 s@env python@python3@' lapack_testing.py
%build
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects %global _lto_cflags %{_lto_cflags} -ffat-lto-objects
%endif
%ifarch aarch64
# https://github.com/scipy/scipy/issues/21475#issuecomment-2454203196
%global optflags %{optflags} "-ffp-contract=off" %{_lto_cflags}
%endif
%global optflags_f %{optflags} %global optflags_f %{optflags}
cp make.inc.example make.inc %cmake \
# for ABI compatibility we need to build the deprecated interfaces -DBUILD_SHARED_LIBS=%{?with_shared:ON}%{!?with_shared:OFF} \
echo 'BUILD_DEPRECATED = Yes' >> make.inc -DBLAS++=OFF \
%{?with_tmg:echo 'LAPACKE_WITH_TMG = Yes' >> make.inc} -DLAPACK++=OFF \
-DCBLAS=ON \
-DLAPACKE=ON \
-DLAPACKE_WITH_TMG=%{?with_tmglib:ON}%{!?with_tmglib:OFF} \
-DBUILD_DEPRECATED=ON \
-DBUILD_MAN_DOCUMENTATION=%{?with_man:ON}%{!?with_man:OFF} \
-DBUILD_TESTING=ON \
%{nil}
%cmake_build
%make_build cleanlib %if %{with man}
%make_build blaslib \ doxygen Doxyfile.man
FFLAGS="%{optflags_f} %{?precflags} -fPIC" %endif
mkdir tmp
( cd tmp; ar x ../librefblas.a )
gfortran -shared -Wl,-soname=libblas.so.3 -o libblas.so.%{version} -Wl,--no-undefined tmp/*.o
ln -s libblas.so.%{version} libblas.so
rm -rf tmp
%make_build cblaslib \
CFLAGS="%{optflags} %{?precflags} -fPIC -DADD_ "
mkdir tmp
( cd tmp; ar x ../libcblas.a )
gfortran -shared -Wl,-soname=libcblas.so.3 -o libcblas.so.%{version} -Wl,--no-undefined tmp/*.o -L. -lblas
ln -s libcblas.so.%{version} libcblas.so
rm -rf tmp
# May need to be included in liblapack
%make_build -C TESTING/MATGEN FFLAGS="%{optflags_f} %{?test_precflags} %{?with_tmg:-fPIC}"
%make_build lapacklib \
FFLAGS="%{optflags_f} %{?precflags} -fPIC"
mkdir tmp
( cd tmp; ar x ../liblapack.a; %{?with_tmg: ar x ../libtmglib.a; ar cr ../liblapack.a *.o; ranlib ../liblapack.a })
gfortran -shared -Wl,-soname=liblapack.so.3 -o liblapack.so.%{version} -Wl,--no-undefined tmp/*.o -L. -lblas
ln -s liblapack.so.%{version} liblapack.so
rm -rf tmp
make %{?_smp_mflags} lapackelib \
CFLAGS="%{optflags} %{?precflags} -fPIC -DADD_ -DHAVE_LAPACK_CONFIG_H -DLAPACK_COMPLEX_STRUCTURE"
mkdir tmp
( cd tmp; ar x ../liblapacke.a )
gfortran -shared -Wl,-soname=liblapacke.so.3 -o liblapacke.so.%{version} -Wl,--no-undefined tmp/*.o -L. -llapack
ln -s liblapacke.so.%{version} liblapacke.so
rm -rf tmp
# Build test binaries - blas
%make_build -C BLAS/TESTING FFLAGS="%{optflags_f} %{?test_precflags}"
# Build test binaries - cblas
%make_build -C CBLAS/testing FFLAGS="%{optflags_f} %{?test_precflags}"
# Build test binaries - lapack
%make_build -C TESTING/LIN FFLAGS="%{optflags_f} %{?test_precflags}"
%make_build -C TESTING/EIG FFLAGS="%{optflags_f} %{?test_precflags}"
%check
# Increase stack size, required for xeigtstz, see
# https://github.com/Reference-LAPACK/lapack/issues/335
# Remove for lapack > 3.9
ulimit -s 16384
%make_build blas_testing FFLAGS="%{optflags_f} %{?test_precflags}"
if grep -B15 -A15 FAIL BLAS/TESTING/*.out; then
echo
echo "blas_testing FAILED"
false
fi
%make_build cblas_testing CFLAGS="%{optflags} -fPIC"
grep -B15 -A15 FAIL CBLAS/testing/*.out && false
%make_build lapack_testing FFLAGS="%{optflags_f} %{?test_precflags}"
if grep -B15 -A15 FAIL TESTING/*.out; then
echo
echo "lapack_testing FAILED"
false
fi
%install %install
install -d %{buildroot}/%{_libdir} %cmake_install
install -d %{buildroot}/%{_sysconfdir}/alternatives
install -d %{buildroot}/%{_includedir}
## BLAS
install -d %{buildroot}/%{_libdir}/blas
install -m 644 librefblas.a %{buildroot}/%{_libdir}/libblas.a
install -m 755 libblas.so.%{version} %{buildroot}/%{_libdir}/blas
ln -s libblas.so.%{version} %{buildroot}/%{_libdir}/blas/libblas.so.3
ln -s blas/libblas.so.%{version} %{buildroot}/%{_libdir}/libblas.so
ln -s %{_sysconfdir}/alternatives/libblas.so.3%{?a_x} %{buildroot}/%{_libdir}/libblas.so.3
## CBLAS
install -m 644 CBLAS/include/*.h %{buildroot}/%{_includedir}
install -m 644 libcblas.a %{buildroot}/%{_libdir}
install -m 755 libcblas.so.%{version} %{buildroot}/%{_libdir}/blas
ln -s libcblas.so.%{version} %{buildroot}/%{_libdir}/blas/libcblas.so.3
ln -s blas/libcblas.so.%{version} %{buildroot}/%{_libdir}/libcblas.so
ln -s %{_sysconfdir}/alternatives/libcblas.so.3%{?a_x} %{buildroot}/%{_libdir}/libcblas.so.3
## LAPACK
install -d %{buildroot}/%{_libdir}/lapack
install -m 644 liblapack.a %{buildroot}/%{_libdir}
install -m 755 liblapack.so.%{version} %{buildroot}/%{_libdir}/lapack
ln -s liblapack.so.%{version} %{buildroot}/%{_libdir}/lapack/liblapack.so.3
ln -s lapack/liblapack.so.%{version} %{buildroot}/%{_libdir}/liblapack.so
ln -s %{_sysconfdir}/alternatives/liblapack.so.3%{?a_x} %{buildroot}/%{_libdir}/liblapack.so.3
## LAPACKE
install -m 644 LAPACKE/include/*.h %{buildroot}/%{_includedir}
install -m 644 liblapacke.a %{buildroot}/%{_libdir}
install -m 755 liblapacke.so.%{version} %{buildroot}/%{_libdir}/lapack
ln -s liblapacke.so.%{version} %{buildroot}/%{_libdir}/lapack/liblapacke.so.3
ln -s lapack/liblapacke.so.%{version} %{buildroot}/%{_libdir}/liblapacke.so
ln -s %{_sysconfdir}/alternatives/liblapacke.so.3%{?a_x} %{buildroot}/%{_libdir}/liblapacke.so.3
%post -n libblas3 %if %{with shared}
# Prepare for update-alternatives
install -d %{buildroot}%{_sysconfdir}/alternatives
install -d %{buildroot}%{_libdir}/{lapack,blas}
mv %{buildroot}%{_libdir}/liblapack{,e}.so.* %{buildroot}%{_libdir}/lapack/
mv %{buildroot}%{_libdir}/lib{,c}blas.so.* %{buildroot}%{_libdir}/blas/
# Create the symlinks
for t in blas cblas lapack lapacke
do
ln -s %{_sysconfdir}/alternatives/lib${t}.so.%{so_ver}%{?a_x} %{buildroot}%{_libdir}/lib${t}.so.%{so_ver}
done
%else
# Remove headers and script files for static flavour to avoid file conflicts
rm -fr %{buildroot}%{_includedir}/*.h \
%{buildroot}%{_libdir}/cmake \
%{buildroot}%{_libdir}/pkgconfig
%endif
%if %{with man}
# Delete weirdly named man files
rm %{__builddir}/DOCS/man/man3/_*_.3
# Rename isnan to avoid conflict with libm's isnan man file (package man-pages)
mv %{__builddir}/DOCS/man/man3/isnan{,-lapack}.3
# Install man pages
mkdir -p %{buildroot}%{_mandir}
cp -r %{__builddir}/DOCS/man/man3 %{buildroot}%{_mandir}/
%fdupes -s %{buildroot}/%{_mandir}
%endif
%check
%ctest
%if %{with shared}
%ldconfig_scriptlets -n libtmglib%{so_ver}
# BLAS
%post -n libblas%{so_ver}
%{_sbindir}/update-alternatives --install \ %{_sbindir}/update-alternatives --install \
%{_libdir}/libblas.so.3 libblas.so.3%{?a_x} %{_libdir}/blas/libblas.so.3 50 %{_libdir}/libblas.so.%{so_ver} libblas.so.%{so_ver}%{?a_x} %{_libdir}/blas/libblas.so.%{so_ver} 50
/sbin/ldconfig /sbin/ldconfig
%postun -n libblas3 %postun -n libblas%{so_ver}
/sbin/ldconfig /sbin/ldconfig
if [ ! %{_libdir}/blas/libblas.so.3 ] ; then if [ ! %{_libdir}/blas/libblas.so.%{so_ver} ] ; then
%{_sbindir}/update-alternatives --remove libblas.so.3%{?a_x} %{_libdir}/blas/libblas.so.3 %{_sbindir}/update-alternatives --remove libblas.so.%{so_ver}%{?a_x} %{_libdir}/blas/libblas.so.%{so_ver}
fi fi
# /BLAS
%post -n liblapack3 # LAPACK
%post -n liblapack%{so_ver}
%{_sbindir}/update-alternatives --install \ %{_sbindir}/update-alternatives --install \
%{_libdir}/liblapack.so.3 liblapack.so.3%{?a_x} %{_libdir}/lapack/liblapack.so.3 50 %{_libdir}/liblapack.so.%{so_ver} liblapack.so.%{so_ver}%{?a_x} %{_libdir}/lapack/liblapack.so.%{so_ver} 50
/sbin/ldconfig /sbin/ldconfig
%postun -n liblapack3 %postun -n liblapack%{so_ver}
/sbin/ldconfig /sbin/ldconfig
if [ ! -f %{_libdir}/lapack/liblapack.so.3 ] ; then if [ ! -f %{_libdir}/lapack/liblapack.so.%{so_ver} ] ; then
%{_sbindir}/update-alternatives --remove liblapack.so.3%{?a_x} %{_libdir}/lapack/liblapack.so.3 %{_sbindir}/update-alternatives --remove liblapack.so.%{so_ver}%{?a_x} %{_libdir}/lapack/liblapack.so.%{so_ver}
fi fi
# /LAPACK
%post -n libcblas3 # CBLAS
%post -n libcblas%{so_ver}
%{_sbindir}/update-alternatives --install \ %{_sbindir}/update-alternatives --install \
%{_libdir}/libcblas.so.3 libcblas.so.3%{?a_x} %{_libdir}/blas/libcblas.so.3 50 %{_libdir}/libcblas.so.%{so_ver} libcblas.so.%{so_ver}%{?a_x} %{_libdir}/blas/libcblas.so.%{so_ver} 50
/sbin/ldconfig /sbin/ldconfig
%postun -n libcblas3 %postun -n libcblas%{so_ver}
/sbin/ldconfig /sbin/ldconfig
if [ ! -f %{_libdir}/blas/libcblas.so.3 ] ; then if [ ! -f %{_libdir}/blas/libcblas.so.%{so_ver} ] ; then
%{_sbindir}/update-alternatives --remove libcblas.so.3%{?a_x} %{_libdir}/blas/libcblas.so.3 %{_sbindir}/update-alternatives --remove libcblas.so.%{so_ver}%{?a_x} %{_libdir}/blas/libcblas.so.%{so_ver}
fi fi
# /CBLAS
%post -n liblapacke3 # LAPACKE
%post -n liblapacke%{so_ver}
%{_sbindir}/update-alternatives --install \ %{_sbindir}/update-alternatives --install \
%{_libdir}/liblapacke.so.3 liblapacke.so.3%{?a_x} %{_libdir}/lapack/liblapacke.so.3 50 %{_libdir}/liblapacke.so.%{so_ver} liblapacke.so.%{so_ver}%{?a_x} %{_libdir}/lapack/liblapacke.so.%{so_ver} 50
/sbin/ldconfig /sbin/ldconfig
%postun -n liblapacke3 %postun -n liblapacke%{so_ver}
/sbin/ldconfig /sbin/ldconfig
if [ ! -f %{_libdir}/lapack/liblapacke.so.3 ] ; then if [ ! -f %{_libdir}/lapack/liblapacke.so.%{so_ver} ] ; then
%{_sbindir}/update-alternatives --remove liblapacke.so.3%{?a_x} %{_libdir}/lapack/liblapacke.so.3 %{_sbindir}/update-alternatives --remove liblapacke.so.%{so_ver}%{?a_x} %{_libdir}/lapack/liblapacke.so.%{so_ver}
fi fi
# /LAPACKE
%endif
%files -n liblapack3 # SECTION main vs static flavour packages
%if %{with shared}
%files -n liblapack%{so_ver}
%doc README.md %doc README.md
%license LICENSE %license LICENSE
%dir %{_libdir}/lapack %dir %{_libdir}/lapack
%{_libdir}/lapack/liblapack.so.%{version} %{_libdir}/lapack/liblapack.so.*
%{_libdir}/lapack/liblapack.so.3 %ghost %{_libdir}/liblapack.so.%{so_ver}
%ghost %{_libdir}/liblapack.so.3 %ghost %{_sysconfdir}/alternatives/liblapack.so.%{so_ver}%{?a_x}
%ghost %{_sysconfdir}/alternatives/liblapack.so.3%{?a_x}
%files -n libblas3 %files -n libblas%{so_ver}
%doc README.md %doc README.md
%license LICENSE %license LICENSE
%dir %{_libdir}/blas %dir %{_libdir}/blas
%{_libdir}/blas/libblas.so.%{version} %{_libdir}/blas/libblas.so.*
%{_libdir}/blas/libblas.so.3 %ghost %{_libdir}/libblas.so.%{so_ver}
%ghost %{_libdir}/libblas.so.3 %ghost %{_sysconfdir}/alternatives/libblas.so.%{so_ver}%{?a_x}
%ghost %{_sysconfdir}/alternatives/libblas.so.3%{?a_x}
%files devel %files -n liblapacke%{so_ver}
%dir %{_libdir}/lapack
%{_libdir}/lapack/liblapacke.so.*
%ghost %{_libdir}/liblapacke.so.%{so_ver}
%ghost %{_sysconfdir}/alternatives/liblapacke.so.%{so_ver}%{?a_x}
%files -n libcblas%{so_ver}
%doc README.md
%license LICENSE
%dir %{_libdir}/blas
%{_libdir}/blas/libcblas.so.*
%ghost %{_libdir}/libcblas.so.%{so_ver}
%ghost %{_sysconfdir}/alternatives/libcblas.so.%{so_ver}%{?a_x}
%files -n libtmglib%{so_ver}
%license LICENSE
%{_libdir}/libtmglib.so.%{so_ver}*
%files -n tmglib-devel
%license LICENSE
%{_libdir}/libtmglib.so
%files -n %{pname}-devel
%{_libdir}/liblapack.so %{_libdir}/liblapack.so
%{_includedir}/lapack.h
%files devel-static %{_libdir}/cmake/lapack-%{version}/
%{_libdir}/liblapack.a %{_libdir}/pkgconfig/lapack.pc
%files -n blas-devel %files -n blas-devel
%{_libdir}/libblas.so %{_libdir}/libblas.so
%{_libdir}/pkgconfig/blas.pc
%files -n blas-devel-static
%{_libdir}/libblas.a
%files -n liblapacke3
%{_libdir}/lapack/liblapacke.so.%{version}
%{_libdir}/lapack/liblapacke.so.3
%ghost %{_libdir}/liblapacke.so.3
%ghost %{_sysconfdir}/alternatives/liblapacke.so.3%{?a_x}
%files -n lapacke-devel %files -n lapacke-devel
%doc LAPACKE/README %doc LAPACKE/README
%license LAPACKE/LICENSE %license LAPACKE/LICENSE
%{_libdir}/liblapacke.so %{_libdir}/liblapacke.so
%{_includedir}/lapack*.h %{_includedir}/lapacke*.h
%{_libdir}/cmake/lapacke-%{version}/
%files -n lapacke-devel-static %{_libdir}/pkgconfig/lapacke.pc
%{_libdir}/liblapacke.a
%files -n libcblas3
%doc README.md
%license LICENSE
%dir %{_libdir}/blas
%{_libdir}/blas/libcblas.so.%{version}
%{_libdir}/blas/libcblas.so.3
%ghost %{_libdir}/libcblas.so.3
%ghost %{_sysconfdir}/alternatives/libcblas.so.3%{?a_x}
%files -n cblas-devel %files -n cblas-devel
%doc CBLAS/README %doc CBLAS/README
%{_libdir}/libcblas.so %{_libdir}/libcblas.so
%{_includedir}/cblas*.h %{_includedir}/cblas*.h
%{_libdir}/cmake/cblas-%{version}/
%{_libdir}/pkgconfig/cblas.pc
# End of packages built for main flavour
%else
# Start of static flavour
%files -n %{pname}-devel-static
%license LICENSE
%{_libdir}/liblapack.a
%files -n cblas-devel-static %files -n cblas-devel-static
%license LICENSE
%{_libdir}/libcblas.a %{_libdir}/libcblas.a
%files -n blas-devel-static
%license LICENSE
%{_libdir}/libblas.a
%files -n lapacke-devel-static
%license LICENSE
%{_libdir}/liblapacke.a
%files -n tmglib-devel-static
%license LICENSE
%{_libdir}/libtmglib.a
%endif
# /SECTION main vs static flavour pkgs
%if %{with man}
%files -n lapack-man
%{_mandir}/man3/*.3%{?ext_man}
%endif
%changelog %changelog