How to use MKL in MSVC 2005(Intel Fortran)
Dear ALL,
I noticed some users have probelms when use MKL in MSVC 2005(Intel Fortran). I upload a MSVC
2005 project (Intel fortran 11.0.0.074 IA32) for your reference.
Some notable things:
1) which
kind of application: ia32, em64t or ia64 application. you may make sure which target machine you need your
application run on? ia32: 32 bit application. em64t: Intel 64 bit application IA64: Intel Itanium
64bit application.
For example, most of us may build ia32 or em64t application on a xeon machine with
windows*. Then in MSVC environment, Check the project configuration manager=> active platform. They are
"ia32" or "X64" (which is corresponding to em64t).
2. Which MKL library you need link into.
Here is FAQ about how to
use MKL in MSVC . You may add the include path, library path as the article show.
But about library
path, as above, you need enter rigth directory: they <MKL install dir>ia32, for ia32 application <MKL install dir>em64t, for X64 application <MKL install dir>em64t, for IA64 application they
can't be mixed
Aboub the library you need. There are many libraries under MKL lib directory. Which one you
needs?
We have on-line KB article Intel® Math Kernel Library Link Line
Advisor After choose it, you can get which libraries you need to list.
In general, mkl_intel_c.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib are enough for any ia32 windows
application.
3. About CVF support, CVF and Intel Fortran compiler use different call convention by
default: CVF: stdcall Intel Fortran,C Compiler: cdecl (default interface of the Microsoft Visual C*
application)
MKL support both of them on ia32 platform, but if you are porting from CVF to intel
Fortran, you may take care the required library: mkl_intel_s or mkl_intel_c.lib
- Using the CVF compiler
the CVF compiler will link with mkl_intel_s[_dll].lib if routines are compiled
with the default interface. However, if you compile with the option /iface=(cref,nomixed_str_len_arg), the compiler
will link with mkl_intel_c[_dll].lib .
· Using the Intel® Fortran compiler
The Intel Fortran compiler will link with mkl_intel_c[_dll].lib by
default. If the /Gm option is used, call mkl_intel_s[_dll].lib (/Gm enables CVF and Powerstation calling
convention compatibility, so does /iface:cvf).
Additionally, if you are porting CVF application to X64 or
IA64 platform with Intel Fortran compiler and MKL. Please note, MKL don't provide em64t and IA64 CVF interface
support. So you must to link mkl_intel_lp64|ilp64, mkl_intel_thread, mkl_core. and remove the compiler option /Gm or
/iface:cvf.
4. Regarding Lapack95, blas95 interface library usage, we may discuss it later if you have
interest.
Best Regards, Ying
|