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!
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!
链接已复制
7 回复数
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
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!!
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!!
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
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.