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

Building a Custom Dynamic-link Library in the Visual Studio Development System

Shai_E_
Beginner
2,331 Views

Hi,

 

I trying to build a custom DLL by following the instructions in https://software.intel.com/en-us/mkl-windows-developer-guide-building-a-custom-dynamic-link-library-in-the-visual-studio-development-system .

I get the following warning:

example.def(22): warning LNK4017: cblas_dgemm statement not supported for the target platform; ignored
example.def(23): warning LNK4017: cblas_sgemv statement not supported for the target platform; ignored
example.def(24): warning LNK4017: cblas_sgemm statement not supported for the target platform; ignored
example.def(25): warning LNK4017: LAPACKE_sgetrf statement not supported for the target platform; ignored
example.def(26): warning LNK4017: LAPACKE_sgetri statement not supported for the target platform; ignored
example.def(27): warning LNK4017: MKL_malloc statement not supported for the target platform; ignored
example.def(27): warning LNK4017: MKL_free statement not supported for the target platform; ignored

and it seems that the resulted dll doesn't contain these methods.

Thank you,

Shai

0 Kudos
1 Solution
Gennady_F_Intel
Moderator
2,331 Views

1/ yes, I see also some inconsistency when VS Solutions are used. We will take a look at this case.

2/ You may build the custom dll by using the command line. It works. Here is output I see on my side:
>nmake libintel64
Microsoft (R) Program Maintenance Utility Version 14.11.25547.0
Copyright (C) Microsoft Corporation.  All rights reserved.
        set Lib=..\..\lib\intel64;%Lib%;..\..\..\compiler\lib\intel64
        type user_example_list | findstr /V "^[;#]" >> user_def_file.def
        lib .\lib\mkl_cdll_intel64.lib /EXTRACT:"i_malloc_dll.obj" /OUT:".\temp_cdll\i_malloc_dll.obj"
Microsoft (R) Library Manager Version 14.11.25547.0
Copyright (C) Microsoft Corporation.  All rights reserved.
        lib .\lib\mkl_cdll_intel64.lib /EXTRACT:_vml_dll_core.obj /OUT:.\temp_cdll\_vml_dll_core.obj
Microsoft (R) Library Manager Version 14.11.25547.0
Copyright (C) Microsoft Corporation.  All rights reserved.

  link /DLL /MANIFEST /MACHINE:AMD64 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libmmt.lib /NODEFAULTLIB:libirc.lib /N
ODEFAULTLIB:svml_dispmt.lib /NODEFAULTLIB:libdecimal.lib /def:user_def_file.def  .\temp_cdll\i_malloc_dll.obj .\temp_cdl

l\_vml_dll_core.obj   mkl_intel_lp64.lib mkl_intel_thread.lib mkl_core.lib  libiomp5md.lib  msvcrt.lib kernel32.lib user
32.lib /out:mkl_custom.dll
Microsoft (R) Incremental Linker Version 14.11.25547.0
Copyright (C) Microsoft Corporation.  All rights reserved.
   Creating library mkl_custom.lib and object mkl_custom.exp
        mt.exe -nologo -manifest mkl_custom.dll.manifest -outputresource:mkl_custom.dll;2
..\compilers_and_libraries\windows\mkl\tools\builder>

dir /b shows  :
mkl_custom.dll
mkl_custom.dll.manifest
mkl_custom.exp

3/ the similar works as an expected with dynamic cases nmake dllintel64

View solution in original post

0 Kudos
4 Replies
Gennady_F_Intel
Moderator
2,331 Views

Thanks Shai.

Could you please give more details to reproduce the case on our side:  is VS 2013, 2015 or 2017?

ia32 or 64?

list  of function from xamples.def file.

version of MKL?

thanks, Gennady

0 Kudos
Shai_E_
Beginner
2,331 Views

Hi,

I'm using the VS2015 solution, Intel 64 architecture, MKL version 2017 update 3, 17.0.0.051.

The list of functions is:

cblas_dgemm
cblas_sgemv
cblas_sgemm
LAPACKE_sgetrf
LAPACKE_sgetri
MKL_malloc
MKL_free

Thanks,

Shai

0 Kudos
Gennady_F_Intel
Moderator
2,332 Views

1/ yes, I see also some inconsistency when VS Solutions are used. We will take a look at this case.

2/ You may build the custom dll by using the command line. It works. Here is output I see on my side:
>nmake libintel64
Microsoft (R) Program Maintenance Utility Version 14.11.25547.0
Copyright (C) Microsoft Corporation.  All rights reserved.
        set Lib=..\..\lib\intel64;%Lib%;..\..\..\compiler\lib\intel64
        type user_example_list | findstr /V "^[;#]" >> user_def_file.def
        lib .\lib\mkl_cdll_intel64.lib /EXTRACT:"i_malloc_dll.obj" /OUT:".\temp_cdll\i_malloc_dll.obj"
Microsoft (R) Library Manager Version 14.11.25547.0
Copyright (C) Microsoft Corporation.  All rights reserved.
        lib .\lib\mkl_cdll_intel64.lib /EXTRACT:_vml_dll_core.obj /OUT:.\temp_cdll\_vml_dll_core.obj
Microsoft (R) Library Manager Version 14.11.25547.0
Copyright (C) Microsoft Corporation.  All rights reserved.

  link /DLL /MANIFEST /MACHINE:AMD64 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libmmt.lib /NODEFAULTLIB:libirc.lib /N
ODEFAULTLIB:svml_dispmt.lib /NODEFAULTLIB:libdecimal.lib /def:user_def_file.def  .\temp_cdll\i_malloc_dll.obj .\temp_cdl

l\_vml_dll_core.obj   mkl_intel_lp64.lib mkl_intel_thread.lib mkl_core.lib  libiomp5md.lib  msvcrt.lib kernel32.lib user
32.lib /out:mkl_custom.dll
Microsoft (R) Incremental Linker Version 14.11.25547.0
Copyright (C) Microsoft Corporation.  All rights reserved.
   Creating library mkl_custom.lib and object mkl_custom.exp
        mt.exe -nologo -manifest mkl_custom.dll.manifest -outputresource:mkl_custom.dll;2
..\compilers_and_libraries\windows\mkl\tools\builder>

dir /b shows  :
mkl_custom.dll
mkl_custom.dll.manifest
mkl_custom.exp

3/ the similar works as an expected with dynamic cases nmake dllintel64

0 Kudos
Shai_E_
Beginner
2,331 Views

Thank you, I've succeeded to build the dll using the command line tool.

0 Kudos
Reply