Creating a New Project

The following applies to Microsoft Visual Studio* 2012, 2010, and 2008.

Creating a New Project

When you create a project, Visual Studio* automatically creates a corresponding solution to contain it. To create a new Intel® Fortran project using the Visual Studio* IDE:

  1. Select File > New > Project.

  2. Click Intel® Visual Fortran in the left pane (as shown above) to display the Fortran project types. For each project type, available templates are listed in the right pane. In this example, the Console Application project type has two associated templates: Empty Project and Main Program Code .

  3. Click the appropriate project type (see Understanding Project Types).

  4. Accept or specify a project name (shown above as Console1).

  5. Accept or specify the Location for the project directory. Project files will be stored here. If the directory specified does not exist, it will be created.

  6. Click OK.

The project and its files appear in the Solution Explorer view. For a COM Server project, you will see a second page with additional user options.

Adding Source Files

To add an existing file to the project:

  • If not already open, open the project (use the File menu).

  • In the Project menu, select Add Existing Item.

  • The Add Existing Item dialog box appears. Use this dialog box to select the Fortran files to be added to the project. To add more than one file to the project, hold down the Ctrl key as you select each file name.

To add a new file to the project:

  • If not already open, open the project (use the File menu).

  • In the Project menu, select Add New Item.

  • The Add New Item dialog box appears. Specify the file name.

  • Choose the type of file (for example, Include or Source file).

  • Click Open . The editor appears, letting you type in source code. The file name appears in the Solution Explorer view.

Organizing Existing Source Code

If you have existing source code, you should organize it into directories before creating a project, although it is easy to move files and edit your project definitions if you should later decide to reorganize your files.

Working with Fortran Modules

If your program uses Fortran modules, you do not need to explicitly add them to your project; they appear as dependencies (.MOD files).

A module file is a precompiled, binary version of a module definition, stored as a .mod file. When you change the source definition of a module, you can update the .mod file before you rebuild your project. To do this, compile the corresponding source file separately by clicking (selecting) the file in the Solution Explorer window and selecting Build > Compile. If the module source file is part of your project, you do not need to compile the file separately. When you build your project, the Intel® Fortran Compiler determines what files need to be compiled.

To control the placement of module files in directories, use Project > Properties > Output Files > Module Path in the IDE or the compiler option [no]module on the command line. The location you specify is automatically searched for .mod files.

To control the search for module files in directories, select one of the following:

  • In the IDE
    • Project > Properties > Preprocessor > Default Include and Use Path

    • Project > Properties > Preprocessor > Ignore Standard Include Path

  • On the Command Line

    • [no]include and assume:source_include compiler options.

For a newly created project (or any other project), the IDE scans the file list for sources that define modules and compiles them before compiling the program units that use them. The IDE automatically scans the added project files for modules specified in USE statements, as well as any INCLUDE statements. It scans the source files for all tools used in building the project.

Pour de plus amples informations sur les optimisations de compilation, consultez notre Avertissement concernant les optimisations.