Community
cancel
Showing results for 
Search instead for 
Did you mean: 
ian_m_2
Beginner
1,402 Views

issues compiling and / or linking MKL in visual studio 2015 windows 10

Jump to solution

i have installed a trial of intel parallel composer. i have already referred to the following resources:

additionally, i have ran: C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\mkl\bin\mklvars.bat as administrator

after following these instructions and suggestions, visual studio says it still cannot find the header file mkl.h even though the additional include directories property in the visual studio project is: C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\mkl\include and it still says it cannot find the header file when i add it to the headers in the visual studio project

after fully qualifying the header in the source file: #include "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\mkl\include\mkl.h" the project will compile, but will not link: it says 'unresolved external' for any MKL function

  • are there any other resources online for compiling MKL in visual studio 2015 on windows 10?
  • is this the right path: C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\mkl\?
0 Kudos
1 Solution
Ying_H_Intel
Employee
1,402 Views

Hi Ian, 

It seem the integration MKL to MSVS environment haven't worked as expected.  I will check with the MSVS2015 installation 

For the error unresolved external' , please check if MKL option was switch by

If you installed the integration component, you can configure your project for use with the Intel MKL as follows: Go to Project » Properties » Libraries » Use Intel Math Kernel Library and select Parallel, Sequential, or Cluster as appropriate. 

If the switch don't work,  you may solve the problem by adding mkl header file path, library and library path manually 

1. Select Project » Properties » Linker » General » Additional Library Directories. Add the architecture specific lib folder, for example, \lib\ia32. 

2. Select Project » Properties » Linker » Input » Additional Dependencies. Insert

mkl_intel_c.lib mkl_sequential.lib mkl_core.lib if 32bit application. 

mkl_intel_lp64.lib mkl_sequential.lib mkl_core.lib if 64bit application

Please let us know if any issue. 

About debug the link,  you may open the verbose by property => C++ => General => Supress Startup banner  to NO

And property page => Linker=> general => Show progress to For Libraries Searched (/VERBOSE:Lib).

Clean your project and rebuild it , then check the buildlog to see what is going wrong.

Best Regards,

Ying 

View solution in original post

5 Replies
JohnNichols
Valued Contributor I
1,402 Views

Did you turn on the swtich in th eProject proeprties to use the MKL libraries?

ian_m_2
Beginner
1,402 Views

i set the 'Use Intel MKL' property to 'Parallel'. is this the switch you are talking about?

Ying_H_Intel
Employee
1,403 Views

Hi Ian, 

It seem the integration MKL to MSVS environment haven't worked as expected.  I will check with the MSVS2015 installation 

For the error unresolved external' , please check if MKL option was switch by

If you installed the integration component, you can configure your project for use with the Intel MKL as follows: Go to Project » Properties » Libraries » Use Intel Math Kernel Library and select Parallel, Sequential, or Cluster as appropriate. 

If the switch don't work,  you may solve the problem by adding mkl header file path, library and library path manually 

1. Select Project » Properties » Linker » General » Additional Library Directories. Add the architecture specific lib folder, for example, \lib\ia32. 

2. Select Project » Properties » Linker » Input » Additional Dependencies. Insert

mkl_intel_c.lib mkl_sequential.lib mkl_core.lib if 32bit application. 

mkl_intel_lp64.lib mkl_sequential.lib mkl_core.lib if 64bit application

Please let us know if any issue. 

About debug the link,  you may open the verbose by property => C++ => General => Supress Startup banner  to NO

And property page => Linker=> general => Show progress to For Libraries Searched (/VERBOSE:Lib).

Clean your project and rebuild it , then check the buildlog to see what is going wrong.

Best Regards,

Ying 

View solution in original post

ian_m_2
Beginner
1,402 Views

Ying, thanks for your help in resolving this issue. Below I have enumerated the steps I took to get a new empty project compiled in VS 2015 on windows 10:

  • new empty project
  • use intel compiler option in project context menu
  • use intel mkl project property: Parallel
  • C/C++ general > additional include directories: C:\Program Files (x86)\IntelSWTools\parallel_studio_xe_2016.2.055\compilers_and_libraries_2016\windows\mkl\include
  • compilation error on #include "mkl.h"
  • / GS / W3 / Zc:wchar_t / I"C:\Program Files (x86)\IntelSWTools\parallel_studio_xe_2016.2.055\compilers_and_libraries_2016\windows\mkl\include" / ZI / Od / Fd"x64\Debug\vc140.pdb" / D "_MBCS" / Zc : forScope / RTC1 / MDd / Fa"x64\Debug\" /EHsc /nologo /Fo"x64\Debug\" /Qprof-dir "x64\Debug\" /Fp"x64\Debug\oculto_test.pch" 
  • noticed 64 bit related flag values, and changed visual studio 'solution platforms' option from default x86 to x64 and the project compiled
  • LINK : fatal error LNK1104: cannot open file 'mkl_rt_dll.lib'
  • added mkl_rt to linker > input > additional dependencies
  • 1>ipo: : error #11018: Cannot open mkl_intel_c.lib
  • 1>LINK : fatal error LNK1104 : cannot open file 'mkl_intel_c.lib'
  • linker > general > additional library directories: C:\Program Files (x86)\IntelSWTools\parallel_studio_xe_2016.2.055\compilers_and_libraries_2016\windows\mkl\lib\intel64_win
  • same error
  • linker > general > additional library directories: C:\Program Files (x86)\IntelSWTools\parallel_studio_xe_2016.2.055\compilers_and_libraries_2016\windows\mkl\lib\ia32
  • rebuild all succeeded
#include "mkl.h"

int main()
{
	vcAbs(0, 0, 0); // trivial MKL function call for testing purposes
	return 0;
}

 

Ying_H_Intel
Employee
1,402 Views
Hi Ian, I tried MSVC2015 and MKL/icc 2016 update 2. The program on my machine seems work with your instruction. Maybe you need to reinstall the integration of MKL. Regarding your issue: 1) LINK : fatal error LNK1104: cannot open file 'mkl_rt_dll.lib'. mkl_rt.lib (import library of mkl_rt.dll) instead. as there is no mkl_rt_dll.lib 2) LINK : fatal error LNK1104 : cannot open file 'mkl_intel_c.lib'. because mkl_intel_c.lib is under ia32 folder, not in intel64_win. . mkl_intel_c.lib mkl_sequential.lib mkl_core.lib under ia32 folder if 32bit application. mkl_intel_lp64.lib mkl_sequential.lib mkl_core.lib under intel64 folder if 64bit application 3) do you want to build 32bit application or X64( 64bit) application. If 32bit, then linker > general > additional library directories: C:\Program Files (x86)\IntelSWTools\parallel_studio_xe_2016.2.055\compilers_and_libraries_2016\windows\mkl\lib\ia32 rebuild all succeeded otherwise, it should be C:\Program Files (x86)\IntelSWTools\parallel_studio_xe_2016.2.055\compilers_and_libraries_2016\windows\mkl\lib\intel64 Please note, don't use the -Qmkl option with the manual setting together. If you are setting the option, please switch off the use intel mkl project property: Parallel Best Regards, Ying The below is the output of ia32 1>------ Rebuild All started: Project: Project1, Configuration: Debug Win32 ------ 1> icl /Qm32 /ZI /W3 /Od /Qftz- -D __INTEL_COMPILER=1600 -D _MBCS /EHsc /RTC1 /MDd /GS /Zc:wchar_t /Zc:forScope /FoDebug\ /FdDebug\vc140.pdb /Gd /TP Source.cpp 1> 1> Intel(R) C++ Intel(R) 64 Compiler for applications running on IA-32, Version 16.0 Build 20160204 1> Copyright (C) 1985-2016 Intel Corporation. All rights reserved. 1> 1> Source.cpp 1> 1> Searching libraries 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\mkl\lib\ia32_win\mkl_intel_c_dll.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\mkl\lib\ia32_win\mkl_intel_thread_dll.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\mkl\lib\ia32_win\mkl_core_dll.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\compiler\lib\ia32_win\libiomp5md.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\kernel32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\user32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\gdi32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\winspool.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\comdlg32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\advapi32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\shell32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\ole32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\oleaut32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\uuid.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\odbc32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\odbccp32.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\compiler\lib\ia32_win\libmmdd.lib: 1> Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\MSVCRTD.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\compiler\lib\ia32_win\libirc.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\compiler\lib\ia32_win\svml_dispmd.lib: 1> Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\OLDNAMES.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\compiler\lib\ia32_win\libdecimal.lib: 1> Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\libcpmt.lib: 1> Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\vcruntimed.lib: 1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.10150.0\ucrt\x86\ucrtd.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\mkl\lib\ia32_win\mkl_intel_c_dll.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\mkl\lib\ia32_win\mkl_intel_thread_dll.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\mkl\lib\ia32_win\mkl_core_dll.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\compiler\lib\ia32_win\libiomp5md.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\kernel32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\user32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\gdi32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\winspool.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\comdlg32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\advapi32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\shell32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\ole32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\oleaut32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\uuid.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\odbc32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\odbccp32.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\compiler\lib\ia32_win\libmmdd.lib: 1> Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\MSVCRTD.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\compiler\lib\ia32_win\libirc.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\compiler\lib\ia32_win\svml_dispmd.lib: 1> Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\OLDNAMES.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\compiler\lib\ia32_win\libdecimal.lib: 1> Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\libcpmt.lib: 1> Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\vcruntimed.lib: 1> 1> Finished searching libraries 1> 1> Searching libraries 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\mkl\lib\ia32_win\mkl_intel_c_dll.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\mkl\lib\ia32_win\mkl_intel_thread_dll.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\mkl\lib\ia32_win\mkl_core_dll.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\compiler\lib\ia32_win\libiomp5md.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\kernel32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\user32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\gdi32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\winspool.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\comdlg32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\advapi32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\shell32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\ole32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\oleaut32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\uuid.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\odbc32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\odbccp32.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\compiler\lib\ia32_win\libmmdd.lib: 1> Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\MSVCRTD.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\compiler\lib\ia32_win\libirc.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\compiler\lib\ia32_win\svml_dispmd.lib: 1> Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\OLDNAMES.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\compiler\lib\ia32_win\libdecimal.lib: 1> Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\libcpmt.lib: 1> Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\vcruntimed.lib: 1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.10150.0\ucrt\x86\ucrtd.lib: 1> 1> Finished searching libraries 1> 1> Searching libraries 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\mkl\lib\ia32_win\mkl_intel_c_dll.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\mkl\lib\ia32_win\mkl_intel_thread_dll.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\mkl\lib\ia32_win\mkl_core_dll.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\compiler\lib\ia32_win\libiomp5md.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\kernel32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\user32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\gdi32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\winspool.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\comdlg32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\advapi32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\shell32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\ole32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\oleaut32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\uuid.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\odbc32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\odbccp32.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\compiler\lib\ia32_win\libmmdd.lib: 1> Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\MSVCRTD.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\compiler\lib\ia32_win\libirc.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\compiler\lib\ia32_win\svml_dispmd.lib: 1> Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\OLDNAMES.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\compiler\lib\ia32_win\libdecimal.lib: 1> Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\libcpmt.lib: 1> Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\vcruntimed.lib: 1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.10150.0\ucrt\x86\ucrtd.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\mkl\lib\ia32_win\mkl_intel_c_dll.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\mkl\lib\ia32_win\mkl_intel_thread_dll.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\mkl\lib\ia32_win\mkl_core_dll.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\compiler\lib\ia32_win\libiomp5md.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\kernel32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\user32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\gdi32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\winspool.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\comdlg32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\advapi32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\shell32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\ole32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\oleaut32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\uuid.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\odbc32.lib: 1> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\odbccp32.lib: 1> Searching C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.2.180\windows\compiler\lib\ia32_win\libmmdd.lib: 1> 1> Finished searching libraries ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
Reply