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.1and+gcc-4.2.2.) - Compiler commands:
gccfor C,g++for C++, andg77for Fortran - Works the same as GCC everywhere else
- Compile by default in 64-bit
- For 32-bit compilations, use the
-m32compiler switch (use-m64to return to 64-bit). - The default optimization level is
-O0, which means no optimization by default. The-Oand-O1levels are the same. UITS usually recommends-O2or-O3for production runs. - Higher numbers after
-Oindicate higher optimization, but more potential to alter the semantics of a program. - For
gcc/g++help, useman gcc; forg77help, useman g77.
Intel compilers
- Current version: 10.1
- Compiler commands:
iccfor C,icpcfor C++, andifortfor Fortran - For 64-bit compilation, use the SoftEnv macro
@intel-64-v10.1. This is defined by default in the@quarrySoftEnv macro. - For 32-bit compilation, use the SoftEnv macro
@intel-32-v10.1. If you use this macro in your.softfile, it must appear before the@quarrySoftEnv macro. - The default (and also generally recommended) optimization level is
-O2. Level-Ois the same as-O2. Level-O0disables optimizations. - Higher numbers after
-Oindicate 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
icchelp, useman iccoricc -help | less; foriforthelp, useman ifortorifort -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 +pgiand then runresoftto set up the environment. Alternatively, add the SoftEnv key+pgiinto$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
- 6.1:
- Compiler commands:
pgccfor C,pgCCfor C++,pgf77for Fortran 77, andpgf90for Fortran90/95 - Compile by default in 64-bit
- For 32-bit compilations, use the
-tp p7compiler switch (-tp p7-64for 64-bit). - If
-Ois not specified, the default optimization level is 1 if-gis not specified, and 0 if-gis specified.-Ois the same as-O2. - Higher numbers after
-Oindicate 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.




