Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Is static library self-contained?

Jing_Q_
Beginner
520 Views

I built a static library by calling some function in MKL. Now, I want to deploy my library to others that may not have MKL. Just wondering whether my static library is self-contatined such that its caller does not need MKL anymore?

Thanks,

0 Kudos
4 Replies
TimP
Honored Contributor III
520 Views

Check  with dumpbin /dependents your.exe  If you have linked MKL threaded, a dependency on OpenMP shared library is expected.

You must have a commercial license to support distributing to others.  If you do, you are entitled to package the necessary MKL shared libraries or the distributable library package if it's a compiler license.

0 Kudos
Steven_L_Intel1
Employee
520 Views

A static library is not self-contained - it has only the code you built in to the library. All external references need to be resolved when the application is linked on the end-user's system.  As Tim notes, a commercial (or academic, but not student) license for either the compiler or for MKL individually permits redistribution of the MKL libraries, even the static library form. The end user will also need the Intel Fortran and OpenMP linkable libraries, either static or shared, to link with.

You may find that building a DLL is a better choice - you can either specify that the dependent libraries are linked in statically (except for OpenMP, which can't be), or you can leave them as dynamic and then simply require that the end-user install the Intel "redistributables" package that we provide. (Installing a Microsoft Visual C++ redistributable package may also be required.)

0 Kudos
Jing_Q_
Beginner
520 Views

Steve and Tim:

  Thanks a lot for your reply.  I do have commercial license for redistributation but my user may not have the MKL. That's why I asked how to make the library self contained.

Thanks again!

Jing 

0 Kudos
Steven_L_Intel1
Employee
520 Views

MKL is included in your redistribution license.

0 Kudos
Reply