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

Custom DLL Build tool

pat726627
初学者
1,746 次查看
Hi,

Just a quick question about the custom DLL build tool in MKL release 10.0 (update 1). I have successfully created a custom DLL with 4 MKL functions (namely DSYEV, DPOTRF, DGEMM, DGESVD) and link it with my own DLL library.

If I want to distribute my library, do I need to include other MKL DLLs as well (such as libguide40.dll) other than the custom built DLL?

Thanks!
0 项奖励
7 回复数
TimP
名誉分销商 III
1,746 次查看
You should be able to use dumpbin to check for dependencies. If you used mkl_sequential, libguide would certainly not be needed.
0 项奖励
pat726627
初学者
1,746 次查看
how do I specify the mkl_sequential option in the custom DLL builder? There are only interface, export, name, and xerbla options.
0 项奖励
Andrey_G_Intel2
1,746 次查看

You can specify sequential mkl usage by setting value of "threading" option to "sequential". For more help about custom dll builder tool options, put "nmake help" command in custom dll builder tool folder.

Andrey

0 项奖励
pat726627
初学者
1,746 次查看
Thanks for the quick reply! I have tried out the "threading=sequential" flag in the custom DLL build tool. However the resulting DLL still has a dependency on the libguide40.dll.

The nmake command is:

nmake ia32 interface=cdecl threading=sequential export=mkl_func_list.txt name=mkl_utils

With the corresponding output from the custom builder:

1>Microsoft Program Maintenance Utility Version 8.00.50727.762
1>Copyright (C) Microsoft Corporation. All rights reserved.
1> if exist . emp_cdll rd /q /s . emp_cdll
1>Microsoft Library Manager Version 8.00.50727.762
1>Copyright (C) Microsoft Corporation. All rights reserved.
...
1> link /DLL /MACHINE:IX86 /NODEFAULTLIB /def:user_def_file.def . emp_cdll*.obj ....ia32libmkl_intel_c.lib ....ia32libmkl_intel_thread.lib ....ia32libmkl_core.lib ....ia32libmkl_solver.lib ....ia32liblibguide40.lib msvcrt.lib kernel32.lib user32.lib /out:mkl_utils.dll
1>Microsoft Incremental Linker Version 8.00.50727.762
1>Copyright (C) Microsoft Corporation. All rights reserved.
1> Creating library mkl_utils.lib and object mkl_utils.exp

It seems like the custom builder just ignore the threading option, and that can be confirmed by these lines under the "ia32:" section in the makefile:

ia32:
@echo EXPORTS > user_def_file.def
...
link /DLL /MACHINE:IX86 /NODEFAULTLIB /def:user_def_file.def
. emp_cdll*.obj $(xerbla)
$(IFACE_LIB_32)
$(mkl32_libpath)mkl_intel_thread.lib
$(mkl32_libpath)mkl_core.lib
$(mkl32_libpath)mkl_solver.lib
$(mkl32_libpath)libguide40.lib
msvcrt.lib kernel32.lib user32.lib /out:$(name).dll

Of course I can just go ahead and change libguide40.lib to libguide.lib (static version) as well as the mkl_intel_thread.lib in the makefile, but I would like to know if there is a better/right way to correct this problem?

Thank you very much!!
0 项奖励
Vladimir_Lunev
新分销商 I
1,746 次查看

Hi!

This is a bug in the makefile for the case ia32. We'll fix it in the next MKL release.

Please, change mkl_intel_thread.lib to mkl_sequential.lib in the target ia32. Also, if you uses sequential MKL, you can remove libguide from the linker command line at all.

Vladimir

0 项奖励
pat726627
初学者
1,746 次查看
Thanks! It is all working now.

Just a related question: what's the different between linking it against mkl_intel_sequential.lib and libguide.lib?
0 项奖励
TimP
名誉分销商 III
1,746 次查看
mkl_sequential limits multi-threaded operations to single threaded, stubbing out all OpenMP references, so that libguide is not required. mkl_thread passes parallel operations on to libguide or libiomp.
0 项奖励
回复