LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems linking Intel MKL in LabWindows

Solved!
Go to solution

I would like to use the Intel Math Kernel Libraries (MKL) in LabWindows.  However, I keep getting a linker error (undefined symbol when I try to call an MKL function).  The functions I want are the FFT libraries (DFTI).  I included the "mkl.h" and "mkl_dfti.h" files, and added them to my project as well.  I also tried adding the /Qmkl compiler flag when compiling using the Intel compiler.  This has become really frustrating, I don't know what's not added / included / not being linked.

 

Has anyone use the MKL successfully in LabWindows??  What libraries did you add?  Thanks!

0 Kudos
Message 1 of 13
(8,493 Views)

Which symbols are missing at the link time? Would you please provide the whole link error message?

 

If you can provide more information then we can help you better. For example, do you link dynamically or statically? Do you use the sequential or the parallel MKL library? Is your code Fortran or C/C++?

 

Here is an example of linking with MKL, assuming you are using Intel C++ compiler, 64-bit system, dynamic linking, and the parallel MKL library with Intel OpenMP:

 

  • Compiler option: /Qopenmp -I%MKLROOT%/include
  • Link line:   mkl_intel_lp64_dll.lib mkl_intel_thread_dll.lib  mkl_core_dll.lib

 

If you have more MKL questions, please consider post them on the "Intel MKL Forum" (http://software.intel.com/en-us/forums/intel-math-kernel-library). You will get more timely responses to your questions.

 

Thanks,

 

Intel MKL

0 Kudos
Message 2 of 13
(8,448 Views)
Thank you for the reply. The project is in LabWindows, which is a C based IDE. The only MKL function I have tried to call so far is DftiCreateDescriptor, and that is the missing symbol. I do not know how to add those .libs to the link line in LabWindows, and I am having some trouble finding the answer. Any help adding the libraries to the LabWindows linker would be appreciated. Thanks!
0 Kudos
Message 3 of 13
(8,432 Views)
I am working on a 64-bit installation of Win7, but I am making a 32-bit project. I am using LabWindows as an integrated development environment and project builder. I have tried using both its native compiler and the Intel C compiler. In both configuration the linker is LabWindows. I am so far still only trying to use one function from the MKL, to test whether I have everything included and linked properly: DftiCreateDescriptor() I am including the following two header files: #include mkl.h #include mkl_dfti.h I added the following to my include paths: c:\Program Files (x86)\Intel\Compiler\11.1\054\mkl\ia32\lib c:\Program Files (x86)\Intel\Compiler\11.1\054\mkl\ia32\bin c:\Program Files (x86)\Intel\Compiler\11.1\054\mkl\include I added six .lib's to my project: mkl_cdft_core.lib mkl_cdft_core_dll.lib mkl_core.lib mkl_core_dll.lib mkl_intel_c.lib mkl_intel_c_dll.lib I have tried compiling with both LabWindows, and with the Intel C Compiler through the LabWindows external compiler support. I have tried it with the following flags to the Intel C compiler: /Qmkl /Qopenmp -I%MKLROOT%/include I get the following errors now: FFT Test.prj(Release) - 4 link errors Undefined symbol '_mkl_dft_commit_descriptor_d_c2c_1d_omp' referenced in "mkl_intel_c.lib". Undefined symbol '_mkl_dft_commit_descriptor_d_r2c_1d_omp' referenced in "mkl_intel_c.lib". Undefined symbol '___kmpc_begin' referenced in "FFT Test.c". Undefined symbol '___kmpc_end' referenced in "FFT Test.c".
0 Kudos
Message 4 of 13
(8,430 Views)

Wow - sorry about the lack of formatting in the previous post.  Here it is again:

 

I am working on a 64-bit installation of Win7, but I am making a 32-bit project. I am using LabWindows as an integrated development environment and project builder. I have tried using both its native compiler and the Intel C compiler. In both configuration the linker is LabWindows.

 

I am so far still only trying to use one function from the MKL, to test whether I have everything included and linked properly:
DftiCreateDescriptor()

I am including the following two header files:
#include mkl.h
#include mkl_dfti.h

I added the following to my include paths:
c:\Program Files (x86)\Intel\Compiler\11.1\054\

mkl\ia32\lib
c:\Program Files (x86)\Intel\Compiler\11.1\054\mkl\ia32\bin
c:\Program Files (x86)\Intel\Compiler\11.1\054\mkl\include

I added six .lib's to my project:
mkl_cdft_core.lib
mkl_cdft_core_dll.lib
mkl_core.lib
mkl_core_dll.lib
mkl_intel_c.lib
mkl_intel_c_dll.lib

I have tried compiling with both LabWindows, and with the Intel C Compiler through the LabWindows external compiler support.  I have tried it with the following flags to the Intel C compiler:
/Qmkl
/Qopenmp -I%MKLROOT%/include

I get the following errors now:

FFT Test.prj(Release) - 4 link errors
 Undefined symbol '_mkl_dft_commit_descriptor_d_c2c_1d_omp' referenced in "mkl_intel_c.lib".
 Undefined symbol '_mkl_dft_commit_descriptor_d_r2c_1d_omp' referenced in "mkl_intel_c.lib".
 Undefined symbol '___kmpc_begin' referenced in "FFT Test.c".
 Undefined symbol '___kmpc_end' referenced in "FFT Test.c".

An Intel MKL support person appears to have responded to my NI forums question, but they haven't been particularly useful yet.  The thread is open at:
http://forums.ni.com/t5/LabWindows-CVI/Problems-linking-Intel-MKL-in-LabWindows/td-p/2210642

I have a few questions.  First, are these .lib files static libraries, or lists of exported functions for the .dll's?  I think half of them, the ones that don't have "_dll" in their name, may be static libraries and therefore can have unresolved external dependencies (giving the first two linker errors).  Second, how do I add .dll's to a LabWindows project?  I have their directory in my include path (that's the \bin directory or the second include path I listed above).  Is this enough?  Finally, the Intel MKL responder in the forums.ni thread suggests adding a few .lib files to the linker, but I can't figure out how to do this in LabWindows.
0 Kudos
Message 5 of 13
(8,425 Views)

Hi Tom,

 

I have never used MKL before, so I am certainly not an expert it in it. But I was able to get a CVI project to build referencing the DftiCreateDescriptor function (after much headache with the undefined symbol errors you got). I had more success using the 64-bit .lib files and found that I only needed mkl_core.lib and mkl_rt.lib to get it to compile (maybe this article helps explain what mkl_rt.lib is for). Of course I am using a 64-bit configuration, but I did have success with the CVI compiler.

National Instruments
0 Kudos
Message 6 of 13
(8,374 Views)
Thanks, that's very encouraging! I'll try the 64-bit version.
0 Kudos
Message 7 of 13
(8,363 Views)

I'm still having linker problems. Compiling works just fine, so the included headers are getting found and compiled in. The only MKL function I am calling is "DftiCreateDescriptor()".

 

The following symbols are not being found by the linker:
__kmpc_begin, __kmpc_end in my C source code
omp_in_parallel, omp_get_max_threads, __kmps_for_static_init_4, __kmpc_for_static_fini and a whole bunch of others in "mkl_intel_thread.lib"

 

What library am I missing that defines these? What's wrong??

 

Current configuration:
Intel Compiler version 11.1
LabWindows linker (C code and C linker)
Static linking, 64bit build target

 

I am including the following static libraries in my project via "Add File To Project":
mkl_core.lib
mkl_intel_ilp64.lib
mkl_intel_thread.lib

 

All three are the 64-bit version of the libraries found at:
C:\Program Files(x86)\Intel\Compiler\11.1\054\mkl\em64t\lib

 

I am including the following two header files:
mkl.h
mkl_dfti.h

 

I am using the following compiler flags for the icl:
/Qvc7.1 /Qopenmp -I%MKLROOT%/include /Qmkl

However icl isn't the linker here, so how do I direct LabWindows to properly link in whatever libraries these are coming from??

0 Kudos
Message 8 of 13
(8,332 Views)

Just a quick reply saying I tried switching the "mkl_intel_lp64.lib" in for "mkl_intel_ipl64.lib" and I still had the same problems.

Source for which libraries to include:

http://software.intel.com/sites/products/documentation/hpc/mkl/userguides/mkl_userguide_win/MKL_UG_l...

By the way, could this be a problem with linking the libraries out of order with each other?

0 Kudos
Message 9 of 13
(8,330 Views)

Do you know what version of MKL you are using? Please try this tool to figure out the proper link line: http://software.intel.com/sites/products/mkl/

 

Many of the missing symbols are from Intel OpenMP library. If you are not using icc as the linker (as you indicuated), then you need to add libiomp5md.lib to your link line.

 

It also seems that a big part of the problem is about how to compile and link under LabWindows. Unfortunately, I've never used LabWindows before. Again, please ask your questions on http://software.intel.com/en-us/forums/intel-math-kernel-library. You'll get more prompt response and some users there may have expeirence with LabWindows to help you out.

 

 

0 Kudos
Message 10 of 13
(8,317 Views)