Page 1 of 1

linking clapack using cmake

PostPosted: Thu Jan 26, 2012 8:03 pm
by Scott54
I am having a difficult time linking clapack to my cmake project on linux and would greatly appreciate any help.

I have successfully built and linked clapack to the same project on osx which makes this situation especially frustrating.

I first downloaded clapack-3.2.1-cmake and compiled the project. I then copied the .a and relevant .h files into a directory, named CLAPACK, under the root directory of my project. (libblas.a, libf2c.a, liblapack.a and libtmglib.a into CLAPACK/lib and blaswrap.h,clapack.h and f2c.h in CLAPACK)

I then altered the cmake file of my project to include

LINK_LIBRARIES( f2c blas lapack tmglib )

These steps allowed me to compile on my mac but upon transferring the project to a linux box and recompiling the clapack library I am getting linking errors which look like this

/home/siggik/Development/SFT-9012/CLAPACK/lib/liblapack.a(sgesvd.c.o): In function `sgesvd_':
sgesvd.c:(.text+0x456): undefined reference to `s_cat'
sgesvd.c:(.text+0x1fa4): undefined reference to `s_cat'
/home/siggik/Development/SFT-9012/CLAPACK/lib/liblapack.a(sormbr.c.o): In function `sormbr_':
sormbr.c:(.text+0x39f): undefined reference to `s_cat'
sormbr.c:(.text+0x45c): undefined reference to `s_cat'
sormbr.c:(.text+0x527): undefined reference to `s_cat'

Any help would be great. Thanks,


Re: linking clapack using cmake

PostPosted: Fri Jan 27, 2012 10:34 am
by admin
f2c library seems to be the problem.
You should try LAPACKE, the C Standard Interface to LAPACK ... for_lapack

Re: linking clapack using cmake

PostPosted: Fri Jan 27, 2012 11:30 am
by Scott54
Do you have any idea why it would work on one machine and not the other? All tests are passing on my linux box (the one I am having a problem with) but I haven't looked into whether or not that tests f2c.