You can use Intel® Visual Fortran Compiler within Microsoft* Visual Studio* Integrated Development Environment (IDE) to develop Fortran applications. The following provides the information for linking your program with Intel® MKL from the Microsoft* Visual Studio* 2012 and Intel® Fortran Compiler.
This article was mainly for the user who transfered from Compaq Visual Fortran to Intel Visual Fortran Compiler. Some related articles are :
How to build an Intel® MKL application with Intel® Visual FORTRAN Compiler
Compiling and Linking MKL with Microsoft* Visual C/C++*
First, please install Intel® Fortran Compiler for Windows. By default, it will be integrated within one version of Microsoft* Visual Studio* IDE on your machine. Take Microsoft Visual Studio* 2012 and Intel® Visual Fortran Compiler for windows* as example.
In Microsoft* Visual Studio* environment, compiling and linking Intel® MKL with Intel® Fortan Compiler can be completed quickly by the below steps:
Here is a Fortran sample project based on Intel® MKL FFT :Download
From the Visual Studio* IDE main toolbar, select View » Solution Explorer, and make sure this window is active.
Select the Project in the Solution Explorer window, and then right-click the mouse and select Properties from the menu.
In Properties Pages
Windows, select Configuration Properties» Fortran » Libraries ,
In Use Intel Math Kernal Library
item to choose Parallel (/Qmkl:parallel)
or Sequential (/Qmkl:sequentail)
or Cluster (/Qmkl:cluster).
Then click OK
and build the project. In most of case, the setting should be enough for building a Fortran application based on Intel® MKL.
The below steps are optional, which are doing above configuration manually. You should switch off the quick option /Qmkl:xxx if go with the below steps.
In Configuration Properties
, select Fortran » General
, and then in the Additional Include Directories
item, add the Intel® MKL header files path as shown in the figure
In Configuration Properties, select Linker » General, and then in the Additional Library Directories item, add the Intel® MKL Library path as shown below
Select Linker » Input
, and then in Additional Dependencies
add the Intel® MKL libraries as shown below(e.g. mkl_intel_c.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib). Please refer to section Linking Your Application with Intel MKL
to find which Intel® MKL libraries are needed in your application.
Note: For Intel® Fortran compiler default setting, the mkl_intel_c[_dll].lib is appropriate library to link. For Compaq Visual Fortran compiler, mkl_intel_s[_dll].lib is right library to link.
Please read more details from Intel MKL User Guide =>Using the cdecl and stdcall Interfaces
Call a routine with the following statement:
extern __stdcall name( <prototype variable1>, <prototype variable2>, .. );
where stdcall is actually the CVF compiler default compilation, which differs from the regular stdcall compilation in the way how strings are passed to the routine. Because the default CVF format is not identical with stdcall, you must specially handle strings in the calling sequence. See how to do it in sections on interfaces in the CVF documentation.