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

How to reduce size of an application linking MKL statically?

jirina
New Contributor I
1,041 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
Honored Contributor III
1,041 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).

0 Kudos
Gennady_F_Intel
Moderator
1,041 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" 

0 Kudos
Evarist_F_Intel
Employee
1,041 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...

0 Kudos
Reply