Compiling programs on Quarry at IU

Three compilers are available on Quarry at Indiana University: the GNU compilers (GCC), Intel compilers, and Portland Group compilers.

GCC

  • Current versions: 4.1.1 and 4.2.2 (Select between them with the SoftEnv keys +gcc-4.1.1 and +gcc-4.2.2.)
  • Compiler commands: gcc for C, g++ for C++, and g77 for Fortran
  • Works the same as GCC everywhere else
  • Compile by default in 64-bit
  • For 32-bit compilations, use the -m32 compiler switch (use -m64 to return to 64-bit).
  • The default optimization level is -O0, which means no optimization by default. The -O and -O1 levels are the same. UITS usually recommends -O2 or -O3 for production runs.
  • Higher numbers after -O indicate higher optimization, but more potential to alter the semantics of a program.
  • For gcc/g++ help, use man gcc ; for g77 help, use man g77 .

Intel compilers

  • Current version: 10.1
  • Compiler commands: icc for C, icpc for C++, and ifort for Fortran
  • For 64-bit compilation, use the SoftEnv macro @intel-64-v10.1. This is defined by default in the @quarry SoftEnv macro.
  • For 32-bit compilation, use the SoftEnv macro @intel-32-v10.1. If you use this macro in your .soft file, it must appear before the @quarry SoftEnv macro.
  • The default (and also generally recommended) optimization level is -O2. Level -O is the same as -O2. Level -O0 disables optimizations.
  • Higher numbers after -O indicate higher optimization, but more potential to alter the semantics of a program.
  • You can try the compiler switch, -fast , to see if this improves the performance.
  • For icc help, use man icc or icc -help | less ; for ifort help, use man ifort or ifort -help | less .
  • Additional documentation for Intel(R) Fortran Compiler is available in /N/soft/linux-rhel4-x86_64/intel/fce/10.1.013/doc.
  • Additional documentation for Intel(R) C++ Compiler is available in /N/soft/linux-rhel4-x86_64/intel/cce/10.1.013/doc.

Portland Group compilers

  • Current (default) version is 7.0
  • You must use soft add +pgi and then run resoft to set up the environment. Alternatively, add the SoftEnv key +pgi into $HOME/.soft; the change will take effect the next time you log in.
  • Additional versions and their SoftEnv keys are:
    • 6.1: +pgi-6.1-6
    • 7.0: +pgi-7.0-3
    • 7.2: +pgi-7.2.4
  • Compiler commands: pgcc for C, pgCC for C++, pgf77 for Fortran 77, and pgf90 for Fortran90/95
  • Compile by default in 64-bit
  • For 32-bit compilations, use the -tp p7 compiler switch (-tp p7-64 for 64-bit).
  • If -O is not specified, the default optimization level is 1 if -g is not specified, and 0 if -g is specified. -O is the same as -O2.
  • Higher numbers after -O indicate higher optimization, but more potential to alter the semantics of a program.
  • For help, use man [compiler-command] .
  • Additional documentation for pgi-7.2-4 is available in /N/soft/linux-rhel4-x86_64/pg-7.2-4/linux86-64/7.2-4/doc.