Skip to content

Commit 26b5009

Browse files
authored
Merge pull request #3820 from martin-frbg/lapack700
Add print format macros for 64bit integer builds to LAPACKE (Reference-LAPACK PR 700)
2 parents ad95ad5 + 29dc086 commit 26b5009

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

lapack-netlib/LAPACKE/example/example_DGESV_colmajor.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@
2525
2626
LAPACKE_dgesv (col-major, high-level) Example Program Results
2727
28-
-- LAPACKE Example routine (version 3.7.0) --
28+
-- LAPACKE Example routine --
2929
-- LAPACK is a software package provided by Univ. of Tennessee, --
3030
-- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
31-
December 2016
32-
3331
*/
3432
/* Includes */
3533
#include <stdlib.h>
@@ -94,7 +92,7 @@ int main(int argc, char **argv) {
9492
/* Check for the exact singularity */
9593
if( info > 0 ) {
9694
printf( "The diagonal element of the triangular factor of A,\n" );
97-
printf( "U(%i,%i) is zero, so that A is singular;\n", info, info );
95+
printf( "U(%" LAPACK_IFMT ",%" LAPACK_IFMT ") is zero, so that A is singular;\n", info, info );
9896
printf( "the solution could not be computed.\n" );
9997
exit( 1 );
10098
}

lapack-netlib/LAPACKE/example/example_DGESV_rowmajor.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@
2525
2626
LAPACKE_dgesv (row-major, high-level) Example Program Results
2727
28-
-- LAPACKE Example routine (version 3.7.0) --
28+
-- LAPACKE Example routine --
2929
-- LAPACK is a software package provided by Univ. of Tennessee, --
3030
-- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
31-
December 2016
32-
3331
*/
3432
#include <stdlib.h>
3533
#include <stdio.h>
@@ -91,7 +89,7 @@ int main(int argc, char **argv) {
9189
/* Check for the exact singularity */
9290
if( info > 0 ) {
9391
printf( "The diagonal element of the triangular factor of A,\n" );
94-
printf( "U(%i,%i) is zero, so that A is singular;\n", info, info );
92+
printf( "U(%" LAPACK_IFMT ",%" LAPACK_IFMT ") is zero, so that A is singular;\n", info, info );
9593
printf( "the solution could not be computed.\n" );
9694
exit( 1 );
9795
}

lapack-netlib/LAPACKE/example/lapacke_example_aux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ void print_matrix_colmajor( char* desc, lapack_int m, lapack_int n, double* mat,
2828
void print_vector( char* desc, lapack_int n, lapack_int* vec ) {
2929
lapack_int j;
3030
printf( "\n %s\n", desc );
31-
for( j = 0; j < n; j++ ) printf( " %6i", vec[j] );
31+
for( j = 0; j < n; j++ ) printf( " %6" LAPACK_IFMT, vec[j] );
3232
printf( "\n" );
3333
}

lapack-netlib/LAPACKE/include/lapacke_config.h

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,29 @@ extern "C" {
4242

4343
#include <stdlib.h>
4444
#include <stdint.h>
45+
#include <inttypes.h>
4546

4647
#ifndef lapack_int
4748
#if defined(LAPACK_ILP64)
48-
#define lapack_int int64_t
49+
#define lapack_int int64_t
4950
#else
50-
#define lapack_int int32_t
51+
#define lapack_int int32_t
52+
#endif
53+
#endif
54+
55+
/*
56+
* Integer format string
57+
*/
58+
#ifndef LAPACK_IFMT
59+
#if defined(LAPACK_ILP64)
60+
#define LAPACK_IFMT PRId64
61+
#else
62+
#define LAPACK_IFMT PRId32
5163
#endif
5264
#endif
5365

5466
#ifndef lapack_logical
55-
#define lapack_logical lapack_int
67+
#define lapack_logical lapack_int
5668
#endif
5769

5870
#ifndef LAPACK_COMPLEX_CUSTOM

0 commit comments

Comments
 (0)