Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.

Link to MKL

wjiang123
Beginner
754 Views

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

0 Kudos
1 Solution
Vladimir_Petrov__Int
New Contributor III
754 Views
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

View solution in original post

0 Kudos
3 Replies
Andrey_G_Intel2
Employee
754 Views
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
0 Kudos
wjiang123
Beginner
754 Views
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.

0 Kudos
Vladimir_Petrov__Int
New Contributor III
755 Views
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

0 Kudos
Reply