Undefined BLAS functions

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

Undefined BLAS functions

Postby Mallo96 » Wed Apr 12, 2017 12:29 pm

Hi everyone,

I am just getting started with Lapack but I am facing what I think to be a problem of linking. After having followed the main instructions indicated in http://www.netlib.org/lapack/lawnspdf/lawn81.pdf and ran positively the tests, I tried compiling a fortran code sent by a colleague with the following command :

gfortran -L/home/user/Desktop/LAPACK -I/home/user/Desktop/LAPACK/include -llapack -L/home/user/Desktop/LAPACK -I/home/user/Desktop/LAPACK/include -lblas -O3 codev4.f90 -o code_2.x -ffree-line-length-200

where the libraries (liblapack.a and libblas.a) are contained in /home/user/Desktop/LAPACK and I put all the header files in home/mallory/Desktop/LAPACK/include

I get the following errors :

/tmp/ccoALfwz.o: In function `testcorrelation_':
lorenz96v4.f90:(.text+0x132d): undefined reference to `dgemv_'
lorenz96v4.f90:(.text+0x171e): undefined reference to `dgemv_'
lorenz96v4.f90:(.text+0x1787): undefined reference to `dgemv_'
/tmp/ccoALfwz.o: In function `qr_':
lorenz96v4.f90:(.text+0x1da0): undefined reference to `dorm2r_'
lorenz96v4.f90:(.text+0x1dcb): undefined reference to `dgeqrf_'
/tmp/ccoALfwz.o: In function `rungekutta4thtl_':
lorenz96v4.f90:(.text+0x3653): undefined reference to `dgemm_'
lorenz96v4.f90:(.text+0x36bf): undefined reference to `dgemm_'
lorenz96v4.f90:(.text+0x3726): undefined reference to `dgemm_'
lorenz96v4.f90:(.text+0x375a): undefined reference to `dlaset_'
lorenz96v4.f90:(.text+0x3c88): undefined reference to `dgemm_'
lorenz96v4.f90:(.text+0x3cf4): undefined reference to `dgemm_'
lorenz96v4.f90:(.text+0x3d53): undefined reference to `dgemm_'
lorenz96v4.f90:(.text+0x3d84): undefined reference to `dlaset_'
/tmp/ccoALfwz.o: In function `MAIN__':
lorenz96v4.f90:(.text+0x8cd6): undefined reference to `dgemm_'
lorenz96v4.f90:(.text+0xa023): undefined reference to `dlaset_'
lorenz96v4.f90:(.text+0xa195): undefined reference to `ilaenv_'
lorenz96v4.f90:(.text+0xa276): undefined reference to `dgeqrf_'
lorenz96v4.f90:(.text+0xb343): undefined reference to `dlaset_'
lorenz96v4.f90:(.text+0xb4b5): undefined reference to `ilaenv_'
lorenz96v4.f90:(.text+0xbfa2): undefined reference to `dgeqrf_'
lorenz96v4.f90:(.text+0xc30d): undefined reference to `dtrtrs_'
lorenz96v4.f90:(.text+0xc399): undefined reference to `dnrm2_'
lorenz96v4.f90:(.text+0xceb5): undefined reference to `dorm2r_'
collect2: error: ld returned 1 exit status


It looks like the compiler doesn't find the header files as the functions are defined in there. Can anyone help me with that ?

Thank you very much !
Mallo96
 
Posts: 1
Joined: Wed Apr 12, 2017 12:16 pm

Return to Linking Problem

Who is online

Users browsing this forum: No registered users and 1 guest