- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are any number of ways to link to / use the MKL.I chose to wrap all MKL calls withmy own classes and functions defined inside a single DLL, and static link MKL into that DLL, which has the advantages:
- do not have to redistribute any Intel SW components
- can easily switch (e.g., to NAG, IMSL, newer MKL) by substituting a new wrapper DLL
- only link in the routines actually used
I use the Fortran-style MKL routines, but do not use the Intel supplied header files, instead creating my own header with modified versions of the prototypes I need, because Intel's:
- are not const-correct
- use MKL-specific complex type
- are uncommented
For example, zgemm() is defined in Intel's mkl_blas.h as:
void zgemm(char *transa,char *transb,int *m,int *n,int *k,MKL_Complex16 *alpha,MKL_Complex16 *a,int *lda,MKL_Complex16 *b,int *ldb,MKL_Complex16 *beta,MKL_Complex16 *c,int *ldc);
In my header file, it is declared with const where applicable, and commented (see attached file)
An outline of the steps to link and use MKL is then:
1) Add prototypes of the required routines to my header, a skeleton of which looks like the attached MyMKL.h
2)Copy the MKL library files libguide.lib, mkl_c.lib, mkl_ia32.lib and mkl_lapack.lib, from ia32lib into my project Release (and Debug) directory
4) Write the wrapper functions that call the MKL routines (an example is appended to the attached file)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In Project Settings, add the location (path) of Intel MKL sub-library in the link properties, for example, in Microsoft* Visual Studio* / Microsoft Visual C++ (v6.0):
- Select Project Settings.
- Select the Link tab.
- In the Category drop-down menu, select Input.
- In the Object/library modules section add mkl_c.lib or mkl_s.lib for static cdecl or CVF (respectively) interface libraries (mkl_c_dll, mkl_s_dll for dynamic interface libraries). The other libraries (LAPACK, BLAS, etc.) are identified as default libraries within the interface library and cause the linker to automatically link appropriately. The processor type is determined at runtime.
- You must also add the library path to the location of these libraries. In the Additional library path section, add the location of the Intel MKL sub-libraries. For example, on an IA32 system, you would add C:Program FilesintelMKL60ia32lib (for the default install location)
from the URL:
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page