Performance Tools for Software Developers - Invoking the compiler from the command line

Follow these steps to invoke the Intel® C/C++ Compiler from the command line:

  1. Set up the Compiler’s build environment in a Terminal Command prompt:
    $ source /opt/intel/cc/10.xxx/bin/iccvars.sh
  2. Invoke the compiler for the C source file as follows:
    $ icc [options... ] inputfile(s)
  3. Invoke the compiler for the C++ source file as follows:
    $ icpc [options... ] inputfile(s)

The compiler will always use the options set in icc.cfg. The icc.cfg is located in the [intelc-install-dir]/bin directory.

Example:

$ icc -O2 hello.c
$ icpc -O2 hello.cpp

Pour de plus amples informations sur les optimisations de compilation, consultez notre Avertissement concernant les optimisations.