Debian Codegraph @

debian/tests/xerbla-c

raw
1 #!/bin/sh
2 set -ue
3 cd $AUTOPKGTEST_TMP
4
5 DEB_HOST_MULTIARCH=$(dpkg-architecture -q DEB_HOST_MULTIARCH)
6
7 # Enforce the BLAS (resp. LAPACK) contained in package libblas3 (resp. liblapack3)
8 export LD_LIBRARY_PATH=/usr/lib/${DEB_HOST_MULTIARCH}/blas:/usr/lib/${DEB_HOST_MULTIARCH}/lapack
9
10 cat << EOF > tmp.c
11 #include <stdio.h>
12 #include <lapacke.h>
13 void LAPACKE_xerbla( const char *name, lapack_int info )
14 {
15 if( info < 0 ) {
16 printf( "OVERRIDE SUCCESSFUL override %d in %s\n", -(int) info, name );
17 }
18 }
19
20
21 int main (int argc, const char * argv[])
22 {
23 double a[5][3] = {1,1,1,2,3,4,3,5,2,4,2,5,5,4,3};
24 double b[5][2] = {-10,-3,12,14,14,12,16,16,18,16};
25 lapack_int info,m,n,lda,ldb,nrhs;
26 int i,j;
27
28 m = 5;
29 n = 9;
30 nrhs = 2;
31 lda = 3;
32 ldb = 2;
33
34 info = LAPACKE_dgels(LAPACK_ROW_MAJOR,'N',m,n,nrhs,*a,lda,*b,ldb);
35 return(info);
36 }
37 EOF
38 gcc tmp.c -llapacke
39 ./a.out 2>&1 | grep "OVERRIDE SUCCESSFUL"
40