Community
cancel
Showing results for 
Search instead for 
Did you mean: 
mzp
Beginner
93 Views

f90 compiling/linking to MKL library - syev routine

Hello,

I am trying to link my code to syev LAPACK 95 routine and cannot compile it can you help with I am missing?

The code with compile ok with ssyev but is more convenient to use f95 interfaces 

Thanks,

 

 

ifort -O3  -mkl=sequential   test.f90 test.x

...

real :: corr(5,5), eval(5)

...

  CALL syev(corr,eval,'V')

  PRINT *,eval

...

/tmp/ifortGvqotk.o: In function `MAIN__':
test.f90:(.text+0x411f): undefined reference to `syev_'

0 Kudos
3 Replies
mecej4
Black Belt
93 Views

You have two mistakes.

1. You called the generic subroutine syev(), which takes optional arguments as well, without providing an interface. You can correct this by inserting the statement use lapack95 in the caller(s).  See the section "Fortran 95 Interface Conventions for LAPACK Routines" in the MKL Reference (Fortran).

2. You should specify that the linker should use the Lapack95 library. To find the list of libraries to use, you may use the MKL Link Line Advisor, https://software.intel.com/sites/products/mkl/mkl_link_line_advisor.htm .

Gennady_F_Intel
Moderator
93 Views

you may also take a look at the syev.f90 example and you will see all needed to build and run. you may find out this example into mklroot\examples\lapack95\source folder

mzp
Beginner
93 Views

Thanks, the code will compile with

mpiifort -O2 test.f90 -mkl=parallel -o test.x -lmkl_lapack95_lp64

or

ifort -O2 test.f90 -mkl=sequential -o test.x -lmkl_lapack95_lp64

and insert use lapack95 in the main block

Many thanks for helping!

Reply