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

How to Build Custom Dynamic-link Libraries with MKL_Set_Threading_Layer, MKL_Set_Interface_Layer?

dusunim
Beginner
603 Views

I use MKL_Set_Threading_Layer, MKL_Set_Interface_Layer APIs on my program.

And I want to build a dynamic-link library of mkl to reduce dll size.

But I received error messages like blow from linking stage even I choosed single dynamic library option(dllia32).

I use MKL 11.0.1

How can I build the Custom Dynamic-link Libraries with MKL_Set_Threading_Layer, MKL_Set_Interface_Layer APIs?

Error messages :

user_def_file.def : error LNK2001 : unresolved external symbol MKL_Set_Interface_Layer

mkl_custom.lib : fatal error LNK1120: 2 unresolved externals

NMAKE : fatal error U1077: '"C:\Program Files <x86>\Microsoft Visual Studio 9.0\VC\BIN\link.EXE"' : return code '0x460'

Stop.

0 Kudos
3 Replies
barragan_villanueva_
Valued Contributor I
603 Views
Hi, That functions are part of mkl_rt only and will require all MKL DLLs. To reduce DLL-size please use static targets: libia32 - for IA-32 architecture from static Intel(R) MKL libraries libintel64 - for Intel(R) 64 architecture from static Intel(R) MKL libraries which will create needed small custom DLL for selected MKL functions.
0 Kudos
dusunim
Beginner
603 Views
Hi, In the reference manual, I can use single dynamic library on custom build of mkl. And the two functions are in the single dynamic library. What is the mean of use single dynamic library on custom build of mkl? and how can I use the custom build with MKL_Set_Threading_Layer, MKL_Set_Interface_Layer APIs? I attached the mkl function list which I use. Thanks.
0 Kudos
barragan_villanueva_
Valued Contributor I
603 Views
Hi, In order to build MKL custom DLL for specific interface and threading please use additional settings for nmake: interface=lp64|ilp64 Specifies programming interface for intel64. Default: lp64. threading=parallel|sequential Specifies whether to use Intel(R) MKL in the threaded or sequential mode. Default: parallel. You can run nmake help to see all possible cases to build MKL custom DLL As to your question: "What is the mean of use single dynamic library on custom build of mkl?" Single Dynamic Library is to easy linking with MKL. But all dynamic MKL will be loaded additionally and required on run-time. But MKL custom DLL is the only one dynamic library which will contain only limited set of MKL functions and therefore is much smaller and may be simply redistributed.
0 Kudos
Reply