Link to MKL

Link to MKL

Hi MKL users,

I don't know how to link my program to MKL package. I want to use two libraries, lapack and pardiso, in MKL and try to link it to my program with the following command:

ifort -i8 -o prog prog.f -L /MKL path/ -I /INCLUDE path -Wl,--start-group -lmkl_intel_ilp64.a -lmkl_intel_thread.a -lmkl_solver_ilp64.a -lmkl_lapack.a -Wl
,--end-group -lguide -lpthread -lm&

But obtain the following error:

ld: cannot find -lmkl_intel_ilp64.a

I also set environment variables in ./bashrc, .bash_profile and .profile files, such as PATH, LIB, INCLUDE.

Could someone tell me what is wrong in detail? I am not very familiar with those stuffs. Thanks in advance.

Wen

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

wjiang123,
try to change your command line to following:
ifort -i8 -o prog prog.f -L/MKL path/ -I/INCLUDE path -Wl,--start-group -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_solver_ilp64 -lmkl_lapack -lmkl_core -Wl,--end-group -lguide -lpthread -lm
in this case dynamic MKL libraries will be used.
Andrey

I tried that but still got the same problem: ld: cannot find -lmkl_intel_ilp64.
I also tried to compile the pardiso_unsym_f.f file under the 'examples/solver/source' directory and got the same thing.

Best Reply

Quoting - wjiang123

I tried that but still got the same problem: ld: cannot find -lmkl_intel_ilp64.
I also tried to compile the pardiso_unsym_f.f file under the 'examples/solver/source' directory and got the same thing.

Wen,

Please make sure the path /MKL path/ you are using in the link line does contain the required libraries (e.g. libmkl_intel_ilp64.a or libmkl_intel_ilp64.so). Usually such paths look like this:

/opt/mkl100/lib/em64t

Best regards,

-Vladimir

Leave a Comment

Please sign in to add a comment. Not a member? Join today