Page 1 of 1

undefined reference in final lapack.a lib

PostPosted: Thu Mar 01, 2007 7:15 pm
by kukuttou
Hi, I got a weird problem for you guys.
I followed the instruction and installed the clapack package sucessfully in my Red-hat Linux system. It passed all the testing.
I include the f2c.h and clapack.h
I linked blas_c.a lacpack_c.a and libF77.a in my makefile.
But when I call dsyev_(...) in my program, there are link errors, like:
../CLAPACK/lapack_c.a(dlamch.o)(.text+0x9d): In function `dlamch_':
: undefined reference to `pow_di'
../CLAPACK/lapack_c.a(dsteqr.o)(.text+0x823): In function `dsteqr_':
: undefined reference to `d_sign'
../CLAPACK/lapack_c.a(ilaenv.o)(.text+0x3b): In function `ilaenv_':
: undefined reference to `s_copy'
../CLAPACK/lapack_c.a(ilaenv.o)(.text+0x210): In function `ilaenv_':
: undefined reference to `s_cmp'
../CLAPACK/lapack_c.a(ilaenv.o)(.text+0x2b6): more undefined references to `s_cmp' follow
../CLAPACK/lapack_c.a(dlartg.o)(.text+0x63f): In function `dlartg_':
: undefined reference to `pow_di'
../CLAPACK/lapack_c.a(dlarfg.o)(.text+0x7b): In function `dlarfg_':
: undefined reference to `d_sign'
../CLAPACK/lapack_c.a(dlarfg.o)(.text+0x1d5): In function `dlarfg_':
: undefined reference to `d_sign'
and bla bla bla.................
I totally have no idea about this, and tried reinstall the whole clapack again, the problem still there. But for the win32 version clapack, under windows xp with visual studio , my code running O.K. No such error when calling dsyev_(...).
Any one has any tips to solve this?
Thanks

PostPosted: Tue Mar 06, 2007 6:19 pm
by Iana
Hi Kukuttou

I'm not sure if this helps, but on my system (scientific linux 4.4), these symbols are defined by the f2c library /usr/lib/libg2c.a so -lg2c would allow them to be resolved.

Hope this helps.

Ian.

PostPosted: Wed Mar 14, 2007 9:37 am
by Klaas
Hi,

I generaly noticed that you have to add the libraries in the correct order. There you use clapack, this would be

lapack_c.a blas_c.a libF77.a libI77.a

With those four libraries and in this order it should work properly