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

Help to get started with MKL in Ubuntu

madstrolle
Beginner
1,216 Views

Cheers

I have recently installed the intel Fortran compiler with MKL. The compiler works fine. I have set up a matrix, and now wish to find the eigenvalues of this matrix using MKL. I have the intel MKL users guide for linux, where i have found a linking example

ifort -L$MKLPATH -lmkl_lapack -imkl_ia32 -lguide -lpthread

The code returns the error:

ld: cannot find -lmkl_ia32

My system is Ubuntu 9.04 (32bit) using an AMD Turion x2 CPU. I have run the setup script...mkl/tools/environment/mklvars32.sh.

if i write

ifort -L$MKLPATH -lmkl_lapack -mkl -lguide -lpthread

i get no error, altough i still cant link to the LAPACK package using "USE mkl_lapack" in my fortran program. It just says

error #7002: Error in opening the compiled module file. Check INCLUDE paths. [MKL_LAPACK]
USE mkl_LAPACK


any help would be greatly apreciated!

- Mads Trolle

0 Kudos
4 Replies
TimP
Honored Contributor III
1,216 Views

If you have a current MKL, you must take your linking advice from the link advisor at the top of the forum, not from advice posted for an earlier version.

If you installed the MKL which comes with ifort, the include path ought to be taken care of by source'ing the ifortvars script. "check include path" means, for example, display the contents of the INCLUDE environment variable, and verify the file name. I see mkl_lapack.fi, which would require include 'mkl_lapack.fi' (not USE), and lapack95.mod, which may require either that you add to the include path or copy the .mod file into the main mkl include directory, should that be the one you want.

0 Kudos
Gennady_F_Intel
Moderator
1,216 Views

Hi Mads,

1)you gotld: cannot find -lmkl_ia32, because of typo: -imkl_ia32. Please change as -lmkl_ia32

2) error #7002: You have to point the path to the directory where *.mod files are stored ( see for example \include\em64t\lp64

--Gennady

0 Kudos
madstrolle
Beginner
1,216 Views

Thank you for the help!

I managed to get the lapack 95 package working, thanks to you and the linking advisor page :).

My line is now

ifort BandStruc.f90 -L(path to lib/32) -I(path to include/32)

(path to lib/32)/libmkl_solver_sequential.a -Wl,--start-group

(path to lib/32)/libmkl_intel.a

(path to lib/32)/libmkl_sequential.a

(path to lib/32)/libmkl_core.a

(path to lib/32)/libkml_blas95.a

(path to lib/32)/libmkl_lapack95.a -Wl,--end-group -lpthread -p

This enables me to include the GEEV (find eigenvalues) function from LAPACK95 in my program. I also need some vector functions, why i included BLAS95. Now, as soon as i use e.g. the DOT function (dot product) from BLAS95 i get the error message

BandStruc.f90(1): catastrophic error: **Internal compiler error: internal abort** Please report this error along with the circumstances in which it occurred in a Software Problem Report. Note: File and line given may not be explicit cause of this error.

The same result if i use the intrinsic function DOT_PRODUCT, which should do the same thing.

Again, any help is greatly appriciated!

- Mads Trolle

0 Kudos
TimP
Honored Contributor III
1,216 Views

This is an unpleasant surprise, but little can be done without a working example, preferably the smallest possible. Any such failure on a current compiler version is a reportable bug, regardless of the "legality" of your example. The instructions refer to filing a report using your support account on premier.intel.com. You could also show your example on the linux Fortran forum, in either a public or private post, depending on whether you like to have non-Intel people participate or not.

I have run myself into cases where the compiler intrinsics for dot product misbehaved, but in my cases the corresponding MKL call worked well.

0 Kudos
Reply