There are two necessary steps to invoke the Intel® C++ Compiler from the command line:
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. With the default compiler installation, these scripts are:
To run an environment script, enter one of the following on the command line:
prompt>source /opt/intel_cc_80/bin/iccvars.sh
or
prompt>source /opt/intel_cc_80/bin/iccvars.csh
If you want the script to run automatically when you start Linux*, add the same command to the end of your startup file.
Sample .bash_profile entry for iccvars.sh:
# set environment vars for Intel C++ compiler source /opt/intel_cc_80/bin/iccvars.sh |
You can invoke the Intel C++ Compiler on the command line with either icc or icpc.
When you invoke the Intel C++ Compiler with icc or icpc, use the following syntax:
prompt>{icc|icpc} [options] file1 [file2 . . .]
Argument | Description |
---|---|
options | Indicates one or more command-line options. The compiler recognizes one or more letters preceded by a hyphen (-). This includes linker options. See the Options Quick Reference |
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. |
Example:
prompt>icpc -prec_div -axP -Bstatic my_source1.cpp my_source2.cpp