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

Questions about building a custom 32-bit MKL static library in Windows with MSVS 2010

tennican
Beginner
266 Views
I'm trying to build a minimally sized library to redistribute with a 32-bit Window application which only uses a very few functions from MKL. I have suceeded in creating a dll and lib that are correctly used by the application.
But, I have a couple questions.

1) A mkl_custom.dll was created despite specifying the target libia32. Why didn't it build me a static library as the target indicated?
2) The custom_my.dll is 10M. Is there any way to reduce the size more and will the size grow rapidly as I start using more functions? I've currently been given a budget of 5M which might be flexible to 10M. But, if it goes up significantly like when I start using MKL matrix multiplication, I will be unlikely to be able to use this library.

* Here is the Method I used to produce the custom library:
** Add C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\bin to PATH
** cd to C:\\Program Files (x86)\\Intel\\ComposerXE-2011\\mkl\\tools\\builder
** Create functions_list with functions for SVD and summary statistics
LAPACKE_dgesdd (DGESDD does not work)
vsldSSNewTask
vsldSSCompute
vslSSDeleteTask
vsldSSEditQuantiles
vsldSSEditTask
vsldSSEditMoments
** run vcvars32.bat
** Edit makefile and change buf_lib=bufferoverflowu.lib to buf_lib=
** run nmake libia32 interface=cdecl
** Check the libraries with dumpbin /exports mkl_custom.lib

thanks, Scott
0 Kudos
2 Replies
barragan_villanueva_
Valued Contributor I
266 Views
Quoting tennican
1) A mkl_custom.dll was created despite specifying the target libia32. Why didn't it build me a static library as the target indicated?

2) The custom_my.dll is 10M. Is there any way to reduce the size more and will the size grow rapidly as I start using more functions? I've currently been given a budget of 5M which might be flexible to 10M. But, if it goes up significantly like when I start using MKL matrix multiplication, I will be unlikely to be able to use this library.

Hi,

MKL custom builder always creates dynamic custom library. And target `ia32' in the builder-makefile means that custom library is built from satic MKL libraries.
libia32 - for IA-32 architecture from static MKL libraries

As toyour second question, custom librarysize can be reduced by excluding functions from the export list. Do you really need allthese functions? Maybe, someof themare not used in your application. Please try to find out the function which expands your custom libary the most or consider using other MKL functions which can do the same work. I mean using LAPACK dgesddinstead of LAPACKE, for example. BTW, why it does not work for you?
0 Kudos
tennican
Beginner
266 Views
Hi Victor,

I didn't realize that LAPACK had the dgesdd function.
This is probably because I started out using dgesvd until I realized it was depricated which I believe is only in LAPACKE. I'll try the LAPACK version of dgesdd as soon as I get a chance.

It turns out that my limit of 5M is compressed size.
So, I'm still within budget with my current custom library.

thanks, Scott
0 Kudos
Reply