Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Using MKL for the first time - setup help!

happyjazz
Beginner
362 Views
Hello!

I just started using Fortran and Linux a week ago, so I'm still in the progress of learning.

I'm using the Intel Fortran Compiler v11 to compile some Fortran code on quantum mechanics. I'm down to a problem where i need to solve a symmetrical n*n matrix, and someone told me to just use the "ssyev" command. This has, however, proved to be more diffifcult than I imagined!

Apparantly the "ssyev" command is from this mathpack, LAPACK, included in MKL, and to use it i got something like this:


program gaulag

(lots of stuff here)

call eigen(Ham, eig ,jobz ,U ,info)

(more stuff)

contains

(some functions and subroutines)

subroutine eigen(Ham, eig ,jobz ,U ,info)
USE mkl95_PRECISION
USE mkl95_LAPACK
implicit none
character :: N,U, jobz
integer :: nt
real :: info
real, dimension(:,:), allocatable :: Ham
real, dimension(:), allocatable :: eig
allocate(Ham(0:nt,0:nt))
allocate(eig(0:nt))

call ssyev(Ham,eig,N,U,info)

end subroutine eigen

end program laulag



But !!

It seems I need to compile some files, something to do with LEPACK and BLAS? And further more, I can no longer just comepile using:
ifort myprogram.f90
?

I would really appreciate some help, I'm totally at a loss as to what I need to do, to get this working.

Im using the 32bit Intel Fortran Conpiler, on Ubuntu 8.10.

-Happyjazz
0 Kudos
3 Replies
TimP
Honored Contributor III
362 Views
LAPACK linking never gets any simpler than
ifort myprogram.f90 -lmkl_lapack
which might work in your situation. That's what the examples are for.
0 Kudos
Gennady_F_Intel
Moderator
362 Views
With Intel Fortran Compiler v11 you have to use the following linking dependencies:
libmkl_intel.so libmkl_intel_thread.so libmkl_core.so libiomp5.so
--Gennady

0 Kudos
TimP
Honored Contributor III
362 Views
With Intel Fortran Compiler v11 you have to use the following linking dependencies:
libmkl_intel.so libmkl_intel_thread.so libmkl_core.so libiomp5.so
--Gennady

If you're into abbreviations, as it appears,
ifort -openmp myprogram.f90 -lmkl_intel -lmkl_core -lmkl_thread
would be equivalent to Gennady's recommendation. mkl_lapack, if you cat it, is a script invoking those 3 libraries, and -openmp adds libiomp5 and libpthread.
If you aren't looking for threading.
ifort myprogram.f90 -lmkl_intel -lmkl_core -lmkl_sequential
would do.
0 Kudos
Reply