- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to link and run some simple code with BLAS and LAPACK libraries built with CVF 6.5. It links fine in VC++.NET, but I get a "runtime error" message before I reach main().
The same code runs fine with VC++6.0.
Does anyone know what's wrong?
Thanks,
Erin
===========
extern "C" void __stdcall
DAXPY(int *n, double* a, double* x, int* incx, double* y, int* incy);
extern "C" void __stdcall
DGETRF(int* m, int* n, double* A, int* lda, int* ipiv, int* info);
int
main()
{
double a, *x, *y;
int n, inc;
inc = 1;
n = 3;
a = 2.0;
x = new double;
y = new double;
x[0] = 2.0; x[1] = -1.0; x[2] = 1.0;
y[0] = 5.0; y[1] = 2.0; y[2] = -3.0;
DAXPY(&n, &a, x, &inc, y, &inc);
double *A = new double[n*n];
A[0] = 1.0; A[3] = 5.0; A[6] = -2.0;
A[1] = -1.0; A[4] = 9.0; A[7] = 3.0;
A[2] = -7.0; A[5] = 2.0; A[8] = 10.0;
int *ipiv = new int[3];
int info = 0;
DGETRF(&n, &n, A, &n, ipiv, &info);
delete [] x;
delete [] y;
delete [] A;
delete [] ipiv;
return 0;
}
The same code runs fine with VC++6.0.
Does anyone know what's wrong?
Thanks,
Erin
===========
extern "C" void __stdcall
DAXPY(int *n, double* a, double* x, int* incx, double* y, int* incy);
extern "C" void __stdcall
DGETRF(int* m, int* n, double* A, int* lda, int* ipiv, int* info);
int
main()
{
double a, *x, *y;
int n, inc;
inc = 1;
n = 3;
a = 2.0;
x = new double
y = new double
x[0] = 2.0; x[1] = -1.0; x[2] = 1.0;
y[0] = 5.0; y[1] = 2.0; y[2] = -3.0;
DAXPY(&n, &a, x, &inc, y, &inc);
double *A = new double[n*n];
A[0] = 1.0; A[3] = 5.0; A[6] = -2.0;
A[1] = -1.0; A[4] = 9.0; A[7] = 3.0;
A[2] = -7.0; A[5] = 2.0; A[8] = 10.0;
int *ipiv = new int[3];
int info = 0;
DGETRF(&n, &n, A, &n, ipiv, &info);
delete [] x;
delete [] y;
delete [] A;
delete [] ipiv;
return 0;
}
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Where do your BLAS and LAPACK routines come from?
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Its actually linking with LAPACK that causes problems. Linking with BLAS alone works. The LAPACK library was built in CVF 6.5 from LAPACK 3.0 Fotran files from www.netlib.org.
Right now I'm going to experiment with breaking the library up into smaller pieces.
Right now I'm going to experiment with breaking the library up into smaller pieces.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've reduced the problem to a small size. I downloaded only the files I need for DGETRF.F from netlib. I put together a .NET project and a CVF 6.5 project. These files are attached. The only settings to change is the location of the Fortran libs in the .NET project.
This still produces the same runtime error before main() is reached.
Erin
This still produces the same runtime error before main() is reached.
Erin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Erin,
I tried your example using CVF 6.6A and VC.NET. It worked fine. No run-time errors.
Steve
I tried your example using CVF 6.6A and VC.NET. It worked fine. No run-time errors.
Steve

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page