There are two necessary steps to invoke the Intel® C++ Compiler from the command line:
Note
You can also invoke the compiler with icpc and ecpc for C++ source files on IA-32 and Itanium®-based systems respectively. The icc and ecc compiler examples in this documentation apply to C and C++ source files.
Before you can operate the compiler, you must set the environment variables to specify locations for the various components. The Intel C++ Compiler installation includes shell scripts that you can use to set environment variables. From the command line, execute the shell script that corresponds to your installation. With the default compiler installation, these scripts are located at:
To run the iccvars.sh script on IA-32, enter the following on the command line:
prompt>source /opt/intel/compiler70/ia32/bin/iccvars.sh
If you want the iccvars.sh to run automatically when you start Linux*, edit your startup file and add the same line to the end of your file:The procedure is similar for running the eccvars.sh shell script on Itanium-based systems.
Once the environment variables are set, you can invoke the compiler as follows:
Syntax | Description |
---|---|
options | Indicates one or more command-line options. The compiler recognizes one or more letters preceded by a hyphen (-). |
file1, file2 . . . | Indicates one or more files to be processed by the compilation system. You can specify more than one file. Use a space as a delimiter for multiple files. |
linker_options |
Indicates options directed to the linker. |