Skip to content

Commit 6030bc4

Browse files
committed
Fixed LAPACKE integer formats for 64bit build.
1 parent 86d3707 commit 6030bc4

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

LAPACKE/example/example_DGESV_colmajor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ int main(int argc, char **argv) {
9292
/* Check for the exact singularity */
9393
if( info > 0 ) {
9494
printf( "The diagonal element of the triangular factor of A,\n" );
95-
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 );
9696
printf( "the solution could not be computed.\n" );
9797
exit( 1 );
9898
}

LAPACKE/example/example_DGESV_rowmajor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ int main(int argc, char **argv) {
8989
/* Check for the exact singularity */
9090
if( info > 0 ) {
9191
printf( "The diagonal element of the triangular factor of A,\n" );
92-
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 );
9393
printf( "the solution could not be computed.\n" );
9494
exit( 1 );
9595
}

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
}

LAPACKE/include/lapacke_config.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ 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)
@@ -51,6 +52,17 @@ extern "C" {
5152
#endif
5253
#endif
5354

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
63+
#endif
64+
#endif
65+
5466
#ifndef lapack_logical
5567
#define lapack_logical lapack_int
5668
#endif

0 commit comments

Comments
 (0)