diff --git a/Avoid-out-of-bounds-accesses-in-complex-EIG-tests.patch b/Avoid-out-of-bounds-accesses-in-complex-EIG-tests.patch new file mode 100644 index 0000000..a3ec248 --- /dev/null +++ b/Avoid-out-of-bounds-accesses-in-complex-EIG-tests.patch @@ -0,0 +1,981 @@ +From ea2a102d3827a9de90fce729c9d7f132d4c96f4f Mon Sep 17 00:00:00 2001 +From: Martin Kroeker +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 +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, diff --git a/Fix-MinGW-build-error.patch b/Fix-MinGW-build-error.patch new file mode 100644 index 0000000..701bceb --- /dev/null +++ b/Fix-MinGW-build-error.patch @@ -0,0 +1,39 @@ +From 489a2884c22e8593ec47bfe7c84ab451b0c0d3d9 Mon Sep 17 00:00:00 2001 +From: Julien Schueller +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 ); diff --git a/Fix-some-minor-inconsistencies-in-LAPACKE_czgesvdq.patch b/Fix-some-minor-inconsistencies-in-LAPACKE_czgesvdq.patch new file mode 100644 index 0000000..e24b4c4 --- /dev/null +++ b/Fix-some-minor-inconsistencies-in-LAPACKE_czgesvdq.patch @@ -0,0 +1,55 @@ +From d168b4d2ae678904fb659b3caf27bce668f544e4 Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +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; diff --git a/lapack-3.2.2.patch b/lapack-3.2.2.patch index c65531b..83939a9 100644 --- a/lapack-3.2.2.patch +++ b/lapack-3.2.2.patch @@ -1,13 +1,10 @@ Index: BLAS/SRC/Makefile =================================================================== ---- BLAS/SRC/Makefile.orig -+++ BLAS/SRC/Makefile -@@ -166,5 +166,8 @@ cleanobj: +--- 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 -+ $(FORTRAN) $(NOOPT) -c $< -o $@ + - .f.o: - $(FORTRAN) $(OPTS) -c -o $@ $< ++dcabs1.o: dcabs1.f ++ $(FC) $(FFLAGS_NOOPT) -c $< -o $@ diff --git a/lapack-3.8.0.tar.gz b/lapack-3.8.0.tar.gz deleted file mode 100644 index c296732..0000000 --- a/lapack-3.8.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:deb22cc4a6120bff72621155a9917f485f96ef8319ac074a7afbc68aab88bcf6 -size 7426094 diff --git a/lapack-3.9.0.tar.gz b/lapack-3.9.0.tar.gz new file mode 100644 index 0000000..b5c6e86 --- /dev/null +++ b/lapack-3.9.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:106087f1bb5f46afdfba7f569d0cbe23dacb9a07cd24733765a0e89dbe1ad573 +size 7534567 diff --git a/lapack-man.changes b/lapack-man.changes deleted file mode 100644 index 8e27b46..0000000 --- a/lapack-man.changes +++ /dev/null @@ -1,430 +0,0 @@ -------------------------------------------------------------------- -Fri Oct 9 21:00:30 UTC 2020 - Stefan Brüns - -- Build CBLAS from lapack package - * update baselibs.conf -- Clean up spec file: - * remove useless make cleanlib - * remove ineffective duplicated 'make ..lib' calls with deviating - opts, as the object files are not removed (fortuanately) the - existing PIC files are used for the static libraries - * remove fortran-only -std=legacy opt from CFLAGS - -------------------------------------------------------------------- -Fri Oct 9 17:28:03 UTC 2020 - Stefan Brüns - -- lapack-man: - * Build manpages from same sources as the binaries (3.8.0) instead - of old 3.5.0. - * Merge blas-man package into lapack-man package. Avoids tedious - splitting of the two. - * Use fdupes macro instead of trying to deduplicate man pages - manually. -- Cleanup lapack spec: - * Remove conditionals for obsolete distro versions - * Only use python3-base instead of python3 - * Drop old copy of lapack_testing.py as separate source - -------------------------------------------------------------------- -Fri Mar 13 14:58:33 UTC 2020 - Martin Liška - -- Add -std=legacy in order to fix boo#1166619. - -------------------------------------------------------------------- -Fri Aug 2 07:03:54 UTC 2019 - Martin Liška - -- Use FAT LTO objects in order to provide proper static library. - -------------------------------------------------------------------- -Thu Mar 29 13:11:32 UTC 2018 - badshah400@gmail.com - -- Update to version 3.8.0: - * Symmetric-indefinite Factorization: Aasen’s tridiagonalization - 2 stage. - * LAPACKE interfaces. -- Static -pic libraries are no longer built. - -------------------------------------------------------------------- -Fri Jan 12 14:29:36 UTC 2018 - rguenther@suse.com - -- Package lapack_testing.py from lapack 3.8.0 with adjusted interpreter - and adjust BuildRequires to python3. [bnc#1075766] - -------------------------------------------------------------------- -Wed May 31 21:39:51 UTC 2017 - jengelh@inai.de - -- Correct RPM groups - -------------------------------------------------------------------- -Wed May 17 22:59:46 UTC 2017 - dimstar@opensuse.org - -- Build the man pages in a separate .spec file (lapack-man). The - resulting rpm names are kept identical. This allows us to drop - doxygen out of lapack's main package buildroot, thus eliminating - a build cycle. - -------------------------------------------------------------------- -Fri May 8 20:20:52 UTC 2015 - dmitry_r@opensuse.org - -- Fix static libraries list - -------------------------------------------------------------------- -Wed Jul 16 08:39:20 UTC 2014 - idonmez@suse.com - -- Add baselibs.conf to sources - -------------------------------------------------------------------- -Mon Jul 14 16:38:58 UTC 2014 - toddrme2178@gmail.com - -- Include update-alternatives dependency in subpackages that use it - to guarantee it will be available. - -------------------------------------------------------------------- -Wed Jun 18 08:15:19 UTC 2014 - dmitry_r@opensuse.org - -- Move blas and lapack libraries to subdirectories for fixing - update-alternatives [bnc#861081] -- Add %posttrans scripts for fixing migration problems. - -------------------------------------------------------------------- -Thu Nov 21 20:52:18 UTC 2013 - burnus@net-b.de - -- Update to 3.5.0 - * Added Hermitian LDLT factorization routines with rook pivoting - algorithm - * 2-by-1 CSD to be used for tall and skinny matrix with orthonormal - columns - * New stopping criteria for balancing - * New complex division algorithm - * Various improvements -- No longer removing files due to license reasons as one file is - no longer part of Lapack and the others have been replaced by - new ones under the normal LAPACK license - -------------------------------------------------------------------- -Tue Oct 29 12:53:29 UTC 2013 - lnt-sysadmin@lists.lrz.de - -- packaged symlinks created by update-alternative as %ghost files -- removed quotes from update-alternative command to silence rpmlint warning - -------------------------------------------------------------------- -Fri Mar 15 18:53:22 UTC 2013 - dmitry_r@opensuse.org - -- Split devel packages into devel and devel-static - -------------------------------------------------------------------- -Sun Jan 13 00:04:56 UTC 2013 - scorot@free.fr - -- add update-alternative support to allow user to easily switch - between several blas and lapack libraries - -------------------------------------------------------------------- -Tue Nov 6 10:10:53 UTC 2012 - burnus@net-b.de - -- Update to 3.4.2 - * Bug fixes - -------------------------------------------------------------------- -Wed Jul 25 14:30:36 UTC 2012 - idonmez@suse.com - -- Fix bnc#772628 - -------------------------------------------------------------------- -Thu Jul 19 20:44:04 UTC 2012 - scorot@free.fr - -- update baselibs.conf - -------------------------------------------------------------------- -Sun Jul 15 18:47:19 UTC 2012 - scorot@free.fr - -- build the c interface lapacke - -------------------------------------------------------------------- -Thu May 31 13:52:43 CEST 2012 - kukuk@suse.de - -- doxygen >= 1.7 is required for building docu - -------------------------------------------------------------------- -Mon May 21 14:40:18 UTC 2012 - saschpe@suse.de - -- Change obsoletes '<=' for lapack and blas back to '<', there was a - version update in between -- Remove psfig.tex (bnc#757332) - -------------------------------------------------------------------- -Wed May 9 13:04:08 UTC 2012 - coolo@suse.com - -- fixing dependencies for devel-32bit - -------------------------------------------------------------------- -Fri May 4 13:44:58 UTC 2012 - burnus@net-b.de - -- Update to 3.4.1 - * Bug fixes - -------------------------------------------------------------------- -Mon Apr 2 11:47:20 UTC 2012 - rguenther@suse.com - -- Undo spec file obfuscation - -------------------------------------------------------------------- -Fri Mar 30 14:11:58 UTC 2012 - toddrme2178@gmail.com - -- Fixed building on openSUSE 11.4 by fixing defattr -- Made the package groups consistent: Development/Libraries/Parallel -- Cleaned up spec file formatting -- Made all requires use the new package naming - -------------------------------------------------------------------- -Wed Mar 14 12:31:13 UTC 2012 - saschpe@suse.de - -- Adhere to shared library policy, packages containing *.so or *.h - files have to be named $FOO-devel, packages containing *.a files either - have to be named $FOO-devel-static or provide this name -- Set license to 'BSD-3-Clause', according to the file LICENSE and the - description on http://www.netlib.org/lapack/ it's not public domain -- Package README and LICENSE in library packages -- Removed rpmlint filters -- Use upstream tarball URL - -------------------------------------------------------------------- -Mon Feb 13 10:48:17 UTC 2012 - coolo@suse.com - -- patch license to follow spdx.org standard - -------------------------------------------------------------------- -Wed Nov 23 14:04:54 UTC 2011 - jengelh@medozas.de - -- Remove redundant/unwanted tags/section (cf. specfile guidelines) -- Use %_smp_mflags for parallel building - -------------------------------------------------------------------- -Wed Nov 16 21:03:58 UTC 2011 - burnus@net-b.de - -- Update to 3.4.0 - * xGEQRT: QR factorization (improved interface) - * xGEQRT3: recursive QR factorization. - * xTPQRT: Communication-Avoiding QR sequential kernels. - * Bug fixes. - * Changes see http://www.netlib.org/lapack/lapack-3.4.0.html - -------------------------------------------------------------------- -Fri Sep 9 13:58:10 UTC 2011 - burnus@net-b.de - -- Run BLAS and LAPACK testsuite when building - -------------------------------------------------------------------- -Thu May 12 07:12:55 UTC 2011 - burnus@net-b.de - -- Update to 3.3.1 [bnc#654560] - * New procedures to compute the complete CS decomposition of a - partitioned unitary matrix - * Level-3 BLAS symmetric indefinite solve (xSYTRS) and symmetric - indefinite inversion (xSYTRI) - * Bug fixes - * Changes see at http://www.netlib.org/lapack/lapack-3.3.1.html - and http://www.netlib.org/lapack/lapack-3.3.0.html - -------------------------------------------------------------------- -Thu Aug 12 13:52:25 UTC 2010 - rguenther@novell.com - -- Add baselibs. [bnc#630656] - -------------------------------------------------------------------- -Thu Jul 8 14:36:20 UTC 2010 - burnus@net-b.de - -- Update to version 3.2.2 - * Bug fix release - * Changes see at http://www.netlib.org/lapack/lapack-3.2.2.html - -------------------------------------------------------------------- -Tue Feb 9 18:56:59 CET 2010 - prusnak@suse.cz - -- package man and blas-man as noarch - -------------------------------------------------------------------- -Wed Jan 13 13:15:58 CET 2010 - rguenther@suse.de - -- Drop -O3 -funroll-all-loops compiler flags, build dcabs1.f with -O0. - [bnc#569978] - -------------------------------------------------------------------- -Mon May 18 15:26:56 CEST 2009 - dominique-obs@leuenberger.net - -- Update to version 3.2.1 [bnc#504669] - * Changes see at http://www.netlib.org/lapack/lapack-3.2.1.html - -------------------------------------------------------------------- -Wed Jan 28 13:22:03 CET 2009 - rguenther@suse.de - -- Update to version 3.2.0. [bnc#456384] - * Extra Precise Iterative Refinement - * XBLAS - * Non-Negative Diagonals from Householder QR - * High Performance QR and Householder Reflections on Low-Profile Matrices - * New fast and accurate Jacobi SVD - * Routines for Rectangular Full Packed format - * Pivoted Cholesky - * Mixed precision iterative refinement - * Some new variants added for the one sided factorization - * More robust DQDS algorithm - -------------------------------------------------------------------- -Sun May 11 14:21:24 CEST 2008 - lrupp@suse.de - -- use versioned requires/obsoletes -- %run_ldconfig is deprecated -- prefix the patch with the packagename - -------------------------------------------------------------------- -Fri Apr 27 14:17:41 CEST 2007 - rguenther@suse.de - -- Update to version 3.1.1. [#265999] -- Integrates 3.1.0 errata and missing blas routines. -- Provides better gfortran SECOND integration. -- Split shared libraries into their own versioned subpackage. - -------------------------------------------------------------------- -Fri Jan 19 11:35:01 CET 2007 - rguenther@suse.de - -- Include fixes for the 3.1.0 errata. -- Add missing CSROT, DROTM, DROTMG, DSDOT, SDSDOT, SROTM, SROTMG - and ZDROT from blas distribution. [#228824] - -------------------------------------------------------------------- -Thu Dec 14 12:57:12 CET 2006 - rguenther@suse.de - -- Restore missing so symlinks. - -------------------------------------------------------------------- -Tue Nov 14 17:26:52 CET 2006 - rguenther@suse.de - -- Update to version 3.1.0. -- Rename blasman to blas-man. -- Rename lapack-manpages to lapack-man. - -------------------------------------------------------------------- -Tue Oct 31 15:48:05 CET 2006 - rguenther@suse.de - -- Trim BuildRequires. -- Build and package -fPIC static library variants. [#205310] -- Fix installing of the libblas.so symlink. -- Do not package the matrix testing setup library libtmglib. -- Do not package useless README file. - -------------------------------------------------------------------- -Wed Jan 25 21:37:18 CET 2006 - mls@suse.de - -- converted neededforbuild to BuildRequires - -------------------------------------------------------------------- -Sat Jan 14 13:26:51 CET 2006 - kukuk@suse.de - -- Add gmp-devel to nfb - -------------------------------------------------------------------- -Fri Apr 22 10:40:54 CEST 2005 - meissner@suse.de - -- fixed all other instances of -fno-f2c, and g77 -> gfortran use. - -------------------------------------------------------------------- -Thu Apr 21 17:33:58 CEST 2005 - meissner@suse.de - -- g77 -> gfortran, -fno-f2c is no more. - -------------------------------------------------------------------- -Sat Jan 29 22:25:13 CET 2005 - nashif@suse.de - -- Updated manpages (#48784) - -------------------------------------------------------------------- -Thu Jan 20 01:22:36 CET 2005 - ro@suse.de - -- remove BuildPrereq, BuildRequires is generated - -------------------------------------------------------------------- -Thu Mar 18 05:17:48 CET 2004 - nashif@suse.de - -- Fixed permission for manpages (#36340) - -------------------------------------------------------------------- -Sat Jan 10 10:04:03 CET 2004 - adrian@suse.de - -- add %run_ldconfig - -------------------------------------------------------------------- -Mon Feb 3 14:10:13 CET 2003 - meissner@suse.de - -- Use $RPM_OPT_FLAGS, so it builds on ppc64. - -------------------------------------------------------------------- -Mon Aug 26 19:26:23 CEST 2002 - nashif@suse.de - -- Fixed manpage conflict -- correct library version - -------------------------------------------------------------------- -Mon Jul 1 11:02:05 CEST 2002 - ro@suse.de - -- use -fPIC for all shared objects -- link liblapack with shared libblas (same reason) - -------------------------------------------------------------------- -Thu May 2 15:16:43 CEST 2002 - sf@suse.de - -- fixed %{_lib}-problems for x86_64 - -------------------------------------------------------------------- -Mon Sep 17 17:08:04 CEST 2001 - nashif@suse.de - -- Fixed bug #9925, adding blas to required packages. - -------------------------------------------------------------------- -Tue May 8 12:53:04 CEST 2001 - nashif@suse.de - -- Fixed bug #6803 - -------------------------------------------------------------------- -Thu Feb 8 12:12:06 CET 2001 - sf@suse.de - -- compile with '-01' for IA64 due to 'internal compiler error' in g77 - -------------------------------------------------------------------- -Mon Nov 6 06:36:15 MET 2000 - nashif@suse.de - -- Fixed bug of missing objects (#4028) - -------------------------------------------------------------------- -Sat Apr 22 01:22:23 CEST 2000 - nashif@suse.de - -- Applied new patches -- Modified group, url and files in spec - -------------------------------------------------------------------- -Mon Feb 21 13:55:15 CET 2000 - nashif@suse.de - -- Applied new patches - -------------------------------------------------------------------- -Tue Jan 18 23:22:56 CET 2000 - nashif@suse.de - -- Applied new patched -- Moved manpages to /usr/share/man - -------------------------------------------------------------------- -Thu Dec 23 19:37:04 CET 1999 - nashif@suse.de - -- Update to latest version -- Package split lapack + blas - -------------------------------------------------------------------- -Thu Oct 7 11:17:15 CEST 1999 - nashif@suse.de - - - Package split: man pages + libraries - -------------------------------------------------------------------- -Wed Sep 22 21:21:06 CEST 1999 - nashif@suse.de - - - New package: LAPACK - Linear Algebra Package (LAPACK) - diff --git a/lapack-man.spec b/lapack-man.spec index d6c82d1..c0d77ca 100644 --- a/lapack-man.spec +++ b/lapack-man.spec @@ -1,7 +1,7 @@ # # spec file for package lapack-man # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,13 +18,13 @@ Name: lapack-man %define _name lapack -Version: 3.8.0 +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: http://www.netlib.org/lapack/%{_name}-%{version}.tar.gz +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 diff --git a/lapack.changes b/lapack.changes index 8e27b46..7291b72 100644 --- a/lapack.changes +++ b/lapack.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Mon Oct 12 16:48:38 UTC 2020 - Stefan Brüns + +- Update to version 3.9.0: + * LAPACK QR-preconditioned QR SVD method - xGESVDQ routines + * LAPACK Householder Reconstruction +- Add Avoid-out-of-bounds-accesses-in-complex-EIG-tests.patch +- Rebase lapack-3.2.2.patch +- Drop -std=legacy from fortran flags: + * add Fix-MinGW-build-error.patch + * add Fix-some-minor-inconsistencies-in-LAPACKE_czgesvdq.patch +- Remove pre_checkin.sh, remove lapack-man.changes copy + ------------------------------------------------------------------- Fri Oct 9 21:00:30 UTC 2020 - Stefan Brüns diff --git a/lapack.spec b/lapack.spec index 4caccce..d19bff4 100644 --- a/lapack.spec +++ b/lapack.spec @@ -1,7 +1,7 @@ # # spec file for package lapack # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,15 +17,22 @@ Name: lapack -Version: 3.8.0 +Version: 3.9.0 Release: 0 Summary: Linear Algebra Package License: BSD-3-Clause Group: Development/Libraries/Parallel URL: http://www.netlib.org/lapack/ -Source0: http://www.netlib.org/lapack/%{name}-%{version}.tar.gz +Source0: https://github.com/Reference-LAPACK/lapack/archive/v%{version}.tar.gz#/lapack-%{version}.tar.gz Source99: baselibs.conf Patch1: lapack-3.2.2.patch +# PATCH-FIX-UPSTREAM -- https://github.com/Reference-LAPACK/lapack/commit/489a2884c22e.patch +Patch2: Fix-MinGW-build-error.patch +# 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 + BuildRequires: gcc-fortran BuildRequires: python3-base BuildRequires: update-alternatives @@ -172,7 +179,7 @@ Obsoletes: libcblas3 == 20110120 %description -n libcblas3 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. %package -n cblas-devel @@ -197,12 +204,17 @@ statically, which is highly discouraged. %prep %setup -q -%patch1 +%autopatch -p1 sed -i -e '1 s@env python@python3@' lapack_testing.py %build +# Increase stack size, required for xeigtstz, see +# https://github.com/Reference-LAPACK/lapack/issues/335 +# Remove for lapack > 3.9 +ulimit -s 16384 + %global _lto_cflags %{_lto_cflags} -ffat-lto-objects -%global optflags_f %{optflags} -std=legacy +%global optflags_f %{optflags} case "$RPM_ARCH" in i[0-9]86) PRECFLAGS="-ffloat-store" ;; *) PRECFLAGS="" ;; @@ -212,8 +224,7 @@ cp make.inc.example make.inc make cleanlib %{?_smp_mflags} make %{?_smp_mflags} blaslib \ - OPTS="%{optflags_f} -fPIC" \ - NOOPT="%{optflags_f} -O0 -fPIC" + FFLAGS="%{optflags_f} -fPIC" mkdir tmp ( cd tmp; ar x ../librefblas.a ) gfortran -shared -Wl,-soname=libblas.so.3 -o libblas.so.%{version} tmp/*.o @@ -221,8 +232,8 @@ ln -s libblas.so.%{version} libblas.so rm -rf tmp make blas_testing \ - OPTS="%{optflags_f} $PRECFLAGS" \ - NOOPT="%{optflags_f} $PRECFLAGS -O0" + FFLAGS="%{optflags_f} $PRECFLAGS" \ + FFLAGS_NOOPT="%{optflags_f} $PRECFLAGS -O0" if grep -B15 -A15 FAIL BLAS/*.out; then echo echo "blas_testing FAILED" @@ -231,21 +242,18 @@ fi mv librefblas.a libblas.a make %{?_smp_mflags} cblaslib \ - CFLAGS="%{optflags} -fPIC -DADD_ " \ - LINKER=gfortran + CFLAGS="%{optflags} -fPIC -DADD_ " mkdir tmp ( cd tmp; ar x ../libcblas.a ) gfortran -shared -Wl,-soname=libcblas.so.3 -o libcblas.so.%{version} tmp/*.o -L. -lblas ln -s libcblas.so.%{version} libcblas.so rm -rf tmp make %{?_smp_mflags} cblas_testing \ - CFLAGS="%{optflags} -fPIC" \ - LINKER=gfortran + CFLAGS="%{optflags} -fPIC" grep -B15 -A15 FAIL TESTING/*.out && false make %{?_smp_mflags} lapacklib \ - OPTS="%{optflags_f} -fPIC" \ - NOOPT="%{optflags_f} -O0 -fPIC" + FFLAGS="%{optflags_f} -fPIC" mkdir tmp ( cd tmp; ar x ../liblapack.a ) gfortran -shared -Wl,-soname=liblapack.so.3 -o liblapack.so.%{version} tmp/*.o -L. -lblas @@ -254,18 +262,16 @@ rm -rf tmp cd LAPACKE make %{?_smp_mflags} lapacke \ - CFLAGS="%{optflags} -fPIC -DADD_ -DHAVE_LAPACK_CONFIG_H -DLAPACK_COMPLEX_STRUCTURE" \ - LINKER=gfortran + CFLAGS="%{optflags} -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} tmp/*.o +gfortran -shared -Wl,-soname=liblapacke.so.3 -o liblapacke.so.%{version} tmp/*.o -L.. -llapack ln -s liblapacke.so.%{version} liblapacke.so rm -rf tmp cd .. make lapack_testing \ - OPTS="%{optflags_f} $PRECFLAGS" \ - NOOPT="%{optflags_f} $PRECFLAGS -O0" + FFLAGS="%{optflags_f} $PRECFLAGS" if grep -B15 -A15 FAIL TESTING/*.out; then echo echo "lapack_testing FAILED" diff --git a/pre_checkin.sh b/pre_checkin.sh deleted file mode 100644 index 6d2d528..0000000 --- a/pre_checkin.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -cp lapack.changes lapack-man.changes