Using Intel® MKL in your C# program

Submit New Article

Last Modified On :   May 27, 2009 4:31 PM PDT
Rate
 



Introduction 

Several users have asked how to call and link the Intel® Math Kernel Library (Intel® MKL) functions from their C# programs. While the standard way of interfacing with third party software libraries from C# is well documented, some of the steps in interfacing with Intel MKL specifically may still be confusing. The attached source code package is intended to show how to navigate the whole process for Intel MKL users. These examples show how to create a DLL from Intel MKL libraries, call those functions from their C# source, and interface with that DLL.

Examples are provided for calling the BLAS, LAPACK, DFTI (the FFT interface), the PARDISO direct sparse solver, and the vector math library (VML).

Building the Examples

Follow these steps to build the example programs:

  • unzip the contents of the attached zip file
  • Open a Microsoft Visual Studio command prompt or add the Microsoft.NET Framework to the PATH environment variable in another command prompt
  • Run the build script (makefile) using nmake
    • Example: nmake ia32 MKLROOT="c:\program files\intel\mkl\10.1.1.015"
    • The makefile provides further explanation of the parameters in comments

This will create an executable for each of the example programs.


Example files: Intel_MKL_C#_Examples.zip



Take our C++/C# interface survey for Intel® Math Kernel Library





This article applies to: Intel® Math Kernel Library Knowledge Base