Configuration Files

You can decrease the time you spend entering command-line options and ensure consistency by using the configuration file to automate often-used command-line entries. You can insert any valid command-line option into the configuration file. The compiler processes options in the configuration file in the order they appear followed by the command-line options that you specify when you invoke the compiler.

Note

Options in the configuration file will be executed every time you run the compiler. If you have varying option requirements for different projects, see Response Files.

How to Use Configuration Files

The following example illustrates a basic configuration file. After you have written the .cfg file, simply ensure it is in the same directory as the compiler's executable file when you run the compiler. The text following the pound (#) character is recognized as a comment. The configuration file is icc.cfg.

## Sample configuration file.
## Define preprocessor macro MY_PROJECT.

 

-DMY_PROJECT

 

## Additional directories to be searched
## for INCLUDE files, before the default.

 

-I /project/include

Specifying the Location with ICCCFG

You can use the ICCCFG environment variable to specify the location of your configuration file:

ICCCFG=/cpp/config/my_options.cfg

Each time you invoke the compiler with icc, my_options.cfg is used as your configuration file. The ICPCCFG environment variable is supported for invoking the compiler with icpc.

See Environment Variables.