Configuration Files and Response Files

Configuration files and response files are similar in that both eliminate the need to enter the same commands again and again. (Response files are also known as indirect command files.) The following describes each type of file.

Configuration Files

You can use a configuration (.cfg) file to:

You can insert any valid command-line options into a configuration file. The compiler processes options in the configuration file in the order in which they appear followed by the command-line options that you specify when you invoke the compiler.


Options placed in the configuration file will be included each time you run the compiler. If you have varying option requirements for different projects, use response files.

By default, a configuration file named ifort.cfg is used.

This file resides in the same directory where the compiler executable resides.

However, if you want the compiler to use another configuration file in a different location, you can use the IFORTCFG environment variable to assign the directory and file name for the other configuration file.

Example Configuration File

An example configuration file is shown below. The pound (#) character indicates that the rest of the line is a comment.

## Example ifort.cfg file
## Define preprocessor macro MY_PROJECT.
## Set extended-length source lines.
## Set maximum floating-point significand precision.

Response Files

You can use response files (also known as indirect command files) to:

Response files are invoked as an option on the command line. Options specified in a response file are inserted in the command line at the point where the response file is invoked.

Like configuration files, response files are used to:

However, options in a configuration file are executed every time you run the compiler. In contrast, you use response files to maintain options for individual projects.

You can place any number of options or file names on a line in the indirect command file or response file. Several files can be referenced in the same command line.

The syntax for using response files is:

ifort @responsefile [@responsefile2...]


An "at" sign (@) must precede the name of the response file on the command line.