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

For more complete information about compiler optimizations, see our Optimization Notice.

1 comment

anonymous's picture

icl /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"PGO/Toga.pch" /YX /Fo"PGO/" /Fd"PGO/" /FD /O3 /G7 /GA /GF /Gs /Zm1000 /W5 /Qprof_gen /Qprof_dir"PGO/" attack.cpp board.cpp book.cpp eval.cpp fen.cpp hash.cpp learn.cpp list.cpp main.cpp material.cpp move.cpp move_check.cpp move_do.cpp move_evasion.cpp move_gen.cpp move_legal.cpp option.cpp pawn.cpp piece.cpp posix.cpp probe.cpp protocol.cpp pst.cpp pv.cpp random.cpp recog.cpp search.cpp search_full.cpp see.cpp sort.cpp square.cpp trans.cpp util.cpp value.cpp vector.cpp /link /OUT:"PGODeepLearninToga.exe"

gives the following error:

C:Program Files (x86)Microsoft Visual Studio 9.0VCINCLUDEcrtdefs.h(29): cat
astrophic error: unable to obtain mapped memory (see pch_diag.txt)
#if defined(__midl)

Add a Comment

Have a technical question? Visit our forums. Have site or software product issues? Contact support.