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

Please help on linking intel mkl library with intel compiler

fahad_butt
Beginner
857 Views
Hi:
I have just installed intel compiler for linux 10.1.012 with intel math library kernel 10.0.1.014 on Mozilla red hat fedora core. I am just a beginner in linux as well as programming on linux. I want to use GMRES from intel math library to solve a system of linear systems.

I just dont know what is the method in layman's words to link the libraries with the intel compiler. I have read the user guide and stuff on this linking but it is over my head. Do i have to link at the command prompt or i can use 'use' statements in the code itself.

Can somebody give me a simple example on how to link certain libraries with compiler.

I would really appreciate your timely help.

Best Regards
FB
0 Kudos
2 Replies
TimP
Honored Contributor III
857 Views
USE statements show the compiler where to get interface blocks so as to perform syntax checking on your library function calls. They are important, but they don't take care of defining libraries for linking.
I hesitate to give an over-simplified example of linking which may not work for you. Read the instructions, and head their advice to beginners not to mix static and dynamic linking. You need to know whether you are using a 32- or 64-bit compiler.
0 Kudos
Gennady_F_Intel
Moderator
857 Views

as an additional info, below I 've providedthe example how you can link your program with lapack functionality:

ifort -w test_lapack.f /opt/intel/mkl/10.1.012/lib/32/libmkl_intel.a -Wl,--start-group /opt/intel/mkl/10.1.012/lib/32/libmkl_intel_thread.a /opt/intel/mkl/10.1.012/lib/32/libmkl_core.a -Wl,--end-group -L/opt/intel/mkl/10.1.012/lib/32 -liomp5 -lpthread -o test_lapack.out

I hope it helps you.

Regards,Gennady

0 Kudos
Reply