Creating, Configuring, and Running Intel® Visual FORTRAN projects in Microsoft* Visual Studio* to build Intel® MKL application

You can use Intel® Visual Fortran composer XE 2011 within Microsoft* Visual Studio Integrated Development Environment (IDE). This article provides the information for linking your application with Intel MKL form Microsoft* Visual Studio* 2005/2008/2010 and Intel Visual Fortran composer XE 2011.
Make sure that Intel Visual Fortran composer XE 2011 is integrated within Microsoft* Visual Studio* correctly.
       1.     Create a Visual Fortran Project:

a. Open Visual Studio 2005/2008/2010.

b. On the main menu, select File > New > Project to open the New Project window.

c.  Select Project Types > Intel® Fortran > Console Application, then select Templates > Empty Project. When done, in the Name field, type <project name> for example, trig_mkl, and click OK. The New Project window closes.

new+project.jpg
The next steps are performed inside the Solution Explorer window. To open it, select View > Solution Explorer from the main menu.

2. Add sources of Intel MKL example to the project :

a. Right-click the Source Files folder under <project name> and select Add > Existing Item... from the drop-down menu. The Add Existing Item - <project name> window opens.

b. Browse to the Intel MKL example directory, for example, <mkl directory>\examples\pdettf\source. Select the   example file and supporting files with extension ".f" or ".f90" (Fortran sources). For example, select the d_trig_tforms_bvp.f90 file. For the list of supporting files in each example directory, click Add.The Add Existing Item - <project name> window closes, and the selected files appear in the Source Files folder in Solution Explorer.add+source+file.jpg

c. Right-click the Header Files folder under <project name> and select Add > Existing Item... from the drop-down menu. The Add Existing Item - <project name> window opens.

d. Browse to the <mkl directory>\include directory. Select the header files, For example, select the mkl_dfti.f90 and mkl_trig_transforms.f90 files. Click Add. The Add Existing Item - <project name> window closes, and the selected files to appear in the Header Files folder in Solution Explorer.
add+header.jpg

The next step is to configuring properties of the project:

3.  Select the <project name>.

4.  On the main menu, select Project > Properties to open the <project name> Property Pages window.

5.  Set the Intel MKL include dependencies:

a.  Select Configuration Properties > Fortran > General. In the right-hand part of the window, select Additional Include Directories > > <Edit...>. The Additional Include Directories window opens.

include+setting.jpg
b.  Type the Intel MKL include directory in quotes: "<mkl directory>\include". Click OK to close the window.

6.
 Select Configuration Properties > Fortran > Preprocessor. In the right-hand part of the window, select Preprocess Source File > Yes (default is No). This step is recommended because some examples require preprocessing.
preprocessor.jpg

7.   Set library dependencies: 

a.  Select Configuration Properties > Linker > General. In the right-hand part of the window, select Additional Library Directories > > <Edit...>. The Additional Library Directories window opens.linker_general.jpg

b.  Type the directory with the Intel MKL libraries in quotes, that is, "<mkl directory>\lib\<architecture>", where <architecture> is one of { ia32, intel64 }, for example: "<mkl directory>\lib\Intel64". Click OK to close the window.

c.  Select Configuration Properties > Linker > Input. In the right-hand part of the window, select Additional Dependencies and type the libraries required, for example, if <architecture> =intel64, type mkl_intel_lp64.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib.
linker_input.jpg

8.  In the <project name> Property Pages window, click OK to close the window.

9.  Some examples do not pause before the end of execution. To see the results printed in the Console window, set a breakpoint at the very end of the program or add the 'pause' statement before the last 'end' statement.

10. To build the solution, select Build > Build Solution.

11. To run the example, select Debug > Start Debugging. The Console window opens.

12.  You can see the results of the example in the Console window. If you used 'pause' statement to pause execution of the program, press Enter to complete the run. If you used a breakpoint to pause execution of the program, select Debug > Continue. The Console window closes.

For more complete information about compiler optimizations, see our Optimization Notice.