1
votes

I am new to using the Math Kernel Library(mkl). I have a program that uses a system-of-linear-equations-solver( gesv routine) of LAPACK (which comes with MKL). I already have MKL (also Intel Parallel Studio XE) installed on my computer. I am having trouble compiling/linking the code. I compile the code using:

ifort -mkl matrixinv.f90 

However, it gives the following error

/tmp/ifortjcXZTm.o: In function `MAIN__':
matrixinv.f90:(.text+0xdf): undefined reference to `gesv_'

The code is attached below

PROGRAM matrixinv
IMPLICIT NONE
REAL(8),DIMENSION(3,3)::A,C
INTEGER(4),DIMENSION(3)::IPVT
REAL(8)::RCOND
REAL(8),DIMENSION(3)::V,B
A(1,1)=3.0_8
A(1,2)=2.0_8
A(1,3)=-1.0_8
A(2,1)=2.0_8
A(2,2)=-2.0_8
A(2,3)=4.0_8
A(3,1)=-1.0_8
A(3,2)=0.5_8
A(3,3)=-1.0_8
B(1)=1.0_8
B(2)=-2.0_8
B(3)=0.0_8

call gesv(A,B)
PRINT*,B

END PROGRAM matrixinv
1
According to IntelĀ® MKL Link Line Advisor you should use this : ` -mkl=sequential ` - M. Chinoune

1 Answers

0
votes

You probably want to declare gesv as external. Add the following statement after the "implicit none":

external gesv