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

Confusing MKL Documentation

brianlamm
Beginner
441 Views
I'm confused over the MKL documentation regarding using dynamic versus static libraries.
In the getting started guide it reads

Also, threading software is supplied as:

  • a separate library (libguide.lib) for static linking (discouraged - please see "Using Intel MKL Parallelism" section in the mkluse.htm document)
  • a dynamic link library (libguide40.dll) when linking dynamically to Intel MKL (recommended - please see "Using Intel MKL Parallelism" section in the mkluse.htm document)

Well, in the mkluse.htm document, under using parallelilsm there in not one word written regarding using static versus dynamic libraries. Not one word, so what good does reading about using parallelism do me regarding using dynamic verus static linking do? None.

Next, in the Getting Started Guide, it reads in the directory structure that in each implementation (IA32, EM64T, IA64) in the lib directory there is

libguide40.lib interface library for dynamic threading library

libguide.lib static threading library

and in the bin directory there is libguide40.dll, the dynamic threading library alluded to in description of libguide40.lib above.

Okay, fine. But what's confusing me is that in the sample build lines for building apps using dll's it's libguide.lib that's called out in the command line examples, e.g. for IA32

ifort myprog.f mkl_c_dll.lib libguide.lib cdecl interface for dynamic linking of user code myprog.f. DLL dispatcher will load the appropriate DLL for the processor dynamic kernel

Why, in this example found in MKL Getting Started Guide, is not libguide40.lib called out instead?

and for EM64T an example is called out as

ifort myprog.f mkl_dll.lib libguide.lib dynamic linking of user code myprog.f. The DLL dispatcher will load the appropriate DLL for the processor dynamic kernel

Again, shouldn't libguide40.lib be called out instead of libguide.lib (which use is deprecated by Intel)?

What am I missing? Does the (deprecated use!) libguide.lib somehow "invoke" libguide40.lib?

Next, since the sparse solver routines can only be statically linked (mkl_solver.lib), am I FORCED to use (deprecated!) static linking when building a dll or exe that references pardiso? In the past, I've built a dll that included the solver pardiso and it works fine (linking against libguide.lib).

Message Edited by Brian-Lamm on 05-14-200609:25 AM

Message Edited by Brian-Lamm on 05-19-200605:48 AM

0 Kudos
5 Replies
brianlamm
Beginner
441 Views
Due to everyone at Intel being too busy to reply to this post, should I post to Intel Premier where I'll actually get some response?
0 Kudos
Chao_Y_Intel
Moderator
441 Views

Thanks for the feedbacks. We will continue toimprove the document to make it more clear for our customers. For the sample command line:

ifort myprog.f mkl_c_dll.lib libguide.lib

In this command line, MKL libraries (MKL_c_dll.lib) is called by cdecl interface for dynamic linking . MKL_c_dll.lib is DLL dispatcher library , which will load the appropriate DLL for the processor dynamic kernel. For libguide library, it is statically linked with the application. You can also chose DLL linking for libguide library:
ifort myprog.f mkl_c_dll.lib libguide40.lib

For sparse solver, we only have a static library (mkl_solver.lib). You only can statically linking with mkl_solvler.lib. but you can chose to dynamically linking with libguide(libguide40.lib) or statically linking with the libguide(libguide.lib).

0 Kudos
brianlamm
Beginner
441 Views
I'm sorry but your explanation is very confusing and broken and has shed no light whatsoever. It appears you are writing that "part" of a single build from the command line can envoke both static and dynamic linking.
Again, your explanation has done nothing to alleviate the confusion for me.
I'll try to find explanations somewhere else.
Thank You.
Brian
0 Kudos
Tony_Garratt
Beginner
441 Views

I am also struggling with the documentation. We are linking to MKL statically - should be use libguide.lib or libguide40.lib? What might happen if we use the former?
I ask because we are experiencing some difficult to diagnose problems when using MKL in our applications (we saw a OMP abort message at one point) and am wondering if we should be using libguide40 instead of libguide (we are currently using the later).
I have had a look through the documentation but cant find many references to libguide.lib versus libguide40.lib when linking statically.
Thanks!
Tony

0 Kudos
Chao_Y_Intel
Moderator
441 Views

I am also struggling with the documentation. We are linking to MKL statically - should be use libguide.lib or libguide40.lib? What might happen if we use the former?
I ask because we are experiencing some difficult to diagnose problems when using MKL in our applications (we saw a OMP abort message at one point) and am wondering if we should be using libguide40 instead of libguide (we are currently using the later).
I have had a look through the documentation but cant find many references to libguide.lib versus libguide40.lib when linking statically.
Thanks!
Tony

Hi Tony,

You are recommendeddynamically link with libguide(libguide40.lib). Please see bellow from MKL user guide:

Intel MKL-specific Linking Recommendations
You are strongly encouraged to dynamically link in Intel Compatibility OpenMP* run-time
library libiomp and Intel Legacy OpenMP* run-time library libguide. Linking to static
OpenMP* run-time library is not recommended, as it is very easy with layered software to
link in more than one copy of the library. This causes performance problems (too many
threads) and may cause correctness problems if more than one copy is initialized.


Thanks,
Chao

0 Kudos
Reply