linking clapack using cmake

Post here if you have a question about linking your program with LAPACK or ScaLAPACK library

linking clapack using cmake

Postby Scott54 » Thu Jan 26, 2012 8:03 pm

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

INCLUDE_DIRECTORIES(${VMT_PRJ_SOURCE_DIR}/CLAPACK)
LINK_DIRECTORIES(${VMT_PRJ_SOURCE_DIR}/CLAPACK/lib)
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,

Scott
Scott54
 
Posts: 6
Joined: Thu Jan 26, 2012 5:08 pm

Re: linking clapack using cmake

Postby admin » Fri Jan 27, 2012 10:34 am

f2c library seems to be the problem.
You should try LAPACKE, the C Standard Interface to LAPACK
http://www.netlib.org/lapack/#_standard ... for_lapack
admin
Site Admin
 
Posts: 502
Joined: Wed Dec 08, 2004 7:07 pm

Re: linking clapack using cmake

Postby Scott54 » Fri Jan 27, 2012 11:30 am

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.
Scott54
 
Posts: 6
Joined: Thu Jan 26, 2012 5:08 pm


Return to Linking Problem

Who is online

Users browsing this forum: No registered users and 0 guests