Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
6590 Discussions

How to reduce size of an application linking MKL statically?

jirina
New Contributor I
256 Views

Is there any way how to reduce the size of my application that uses MKL (/Qmkl:parallel), namely just dgetrf, dgetrs and dgerfs, and it is linked statically?

I was thinking about something like using the command use ..., only : ....

I am sorry if this is a silly question, I am not an expert on this.

0 Kudos
3 Replies
TimP
Black Belt
256 Views

USE .. ONLY

has no influence on the libraries.   It simply hides some declarations from the compiler. If you hide the declarations you actually use (or omit the USE MKL entirely), you simply suppress compile time checking of your MKL calls.

With conditional numerical reproducibility option, you might suppress linking support for CPU architectures other than your chosen one.  I don't see that the documentation addresses this point (as to whether it would reduce size).

Gennady_F_Intel
Moderator
256 Views

You may try to build custom dll which will contain only functions you need for your application.. You may have a look at the UsersGuide - https://software.intel.com/en-us/node/528533. see chapter "Building Custom Shared Objects" 

Evarist_F_Intel
Employee
256 Views

If the target application is *.so/*.out (or *.dll/*.exe) file then most likely nothing can be done, because static linker automatically picks only required symbols...

Reply