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
ifort -O3 -mkl=sequential test.f90 test.x
real :: corr(5,5), eval(5)
/tmp/ifortGvqotk.o: In function `MAIN__':
test.f90:(.text+0x411f): undefined reference to `syev_'
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 .
Thanks, the code will compile with
mpiifort -O2 test.f90 -mkl=parallel -o test.x -lmkl_lapack95_lp64
ifort -O2 test.f90 -mkl=sequential -o test.x -lmkl_lapack95_lp64
and insert use lapack95 in the main block
Many thanks for helping!