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/
  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.


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

Para obter informações mais completas sobre otimizações do compilador, consulte nosso aviso de otimização.