#include <stdio.h>
//#include <lapack/lapacke.h>
extern void dgesv_(int*m, int* n, double*A, int*k, int*IP, double*B, int*j, int*info);
#define M 2
#define N 2
int main()
{
int i, j, n=N, m=M;
int info, IPIV[N];
double A[M * N]= { 1, 2, 4, 2};
double B[M*N] = {5, 4, 2.5, 2};
dgesv_(&n, &n, A, &n, IPIV, B, &n, &info);
for(j=0; j< 2*N; j++)
{
printf("%f\t", B[j]);
}
printf("\n");
return 0;
}
gcc hello_gesv.c -o hello_gesv ../lapack-3.10.0/liblapack.a ../lapack-3.10.0/librefblas.a -lgfortran -lm
为何是这样的extern void dgesv_(int*m, int* n, double*A, int*k, int*IP, double*B, int*j, int*info);
未完待续... ...