Tells the compiler to use appropriate precompiled header files.
Linux: Precompiled Headers > Automatic Processing for Precompiled Headers
IA-32, IntelŪ EM64T, IntelŪ ItaniumŪ architecture
Linux: | -pch |
Windows: | None |
None
OFF | The compiler does not create or use precompiled headers unless you tell it to do so. |
This option tells the compiler to use appropriate precompiled header (PCH) files. If none are available, they are created as sourcefile.pchi. This option is supported for multiple source files.
The -pch option will use PCH files created from other sources if the headers files are the same. For example, if you compile source1.cpp using -pch, then source1.pchi is created. If you then compile source2.cpp using -pch, the compiler will use source1.pchi if it detects the same headers.
Caution
Depending on how you organize the header files listed in your sources,
this option may increase compile times. To learn how to optimize compile
times using the PCH options, see "Precompiled Header Files"
in the User's Guide.
None
Consider the following command line:
icpc -pch source1.cpp source2.cpp
It produces the following output when .pchi files do not exist:
"source1.cpp": creating precompiled header
file "source1.pchi"
"source2.cpp": creating precompiled header file "source2.pchi"
It produces the following output when .pchi files do exist:
"source1.cpp": using precompiled header file
"source1.pchi"
"source2.cpp": using precompiled header file "source2.pchi"