I am trying to compile a program that uses lapack.
First, I installed lapack by installing all the packages using 'sudo apt-get install' on this link: https://launchpad.net/ubuntu/precise/+source/lapack
I am trying to compile the code on this page: http://www.nag.com/lapack-ex/examples/source/dgbsv-ex.f
I got this program from: http://www.nag.com/lapack-ex/lapack-ex.html
I tried to compile the program by typing
$gfortran dbgsv-ex.f -llapack -lblas
into a terminal
I get a bunch of error messages, all of the form
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/liblapack.so: undefined reference to
`ATL_strsv'
ie the error messages end with ATL_xxxx
. Note also that when I look in my /usr/lib/
I see a file called liblapack.so
As other comments already indicate, your system has an ATLAS implementation of LAPACK. The correct order of library linking (for the non-threaded version of ATLAS) would be then:
-llapack -lf77blas -lcblas -latlas
Also note, that your Fortran code seems to contain also a routine from the NAG Library (x04cef), so you would have to link the NAG Library as well.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.