During my installation process, there is a problem:
cd TESTING; make
ZGG: Testing COMPLEX16 Nonsymmetric Generalized Eigenvalue Problem routines
./xeigtstz < zgg.in > zgg.out 2>&1
/bin/sh: line 1: 22252 segmentation fault (core dumped) ./xeigtstz < zgg.in > zgg.out 2>&1
make: *** [zgg.out] fault 139
I don't know whether this problem is the real cause for my following link problem, but maybe this information is helpful.
Although with the above testing problem, I still get blas_LINUX.a lapack_LINUX.a libcblaswr.a tmglib_LINUX.a, and I have correctly put them into /usr/local/lib, and put clapackh and f2c.h and blaswrap.h into /usr/local/include
then I tried to compile a simple program, but it has errors:
g++ clapacktest.cc -lcblas -lclapack -llibf2c
/usr/local/lib/libclapack.a(sgetrf.o): In function `sgetrf_':
sgetrf.c:(.text+0x45c): undefined reference to `f2c_strsm'
sgetrf.c:(.text+0x524): undefined reference to `f2c_sgemm'
/usr/local/lib/libclapack.a(sgetrs.o): In function `sgetrs_':
sgetrs.c:(.text+0x194): undefined reference to `f2c_strsm'
sgetrs.c:(.text+0x1cf): undefined reference to `f2c_strsm'
sgetrs.c:(.text+0x303): undefined reference to `f2c_strsm'
sgetrs.c:(.text+0x33e): undefined reference to `f2c_strsm'
/usr/local/lib/libclapack.a(sgetf2.o): In function `sgetf2_':
sgetf2.c:(.text+0x180): undefined reference to `f2c_isamax'
sgetf2.c:(.text+0x1ca): undefined reference to `f2c_sswap'
sgetf2.c:(.text+0x329): undefined reference to `f2c_sger'
sgetf2.c:(.text+0x3b5): undefined reference to `f2c_sscal'
collect2: ld return 1
what is the problem? thanks in advance ! and my program is pasted below FYI.
#include
using namespace std;
extern "C"
{
#include
#include
}
int
main (void)
{
integer M = 3;
integer N = 1;
real a[9] = { 4, 3, 11, 2, -1, 0, -1, 2, 3 };
real b[3] = { 2, 10, 8 };
integer lda;
integer ldb;
integer INFO;
lda = M;
ldb = M;
integer ipiv[M];
sgesv_ (&M, &N, a, &lda, ipiv, b, &ldb, &INFO);
if (INFO == 0)
{
for (int i = 0; i < M; i++)
{
cout << b[i] << endl;
}
}
else
{
cout << "Failed." << endl;
}
return 0;
}