Compiling your C, C++, and Fortran programs on Quarry at IU

On this page:


Available compilers

The following compilers are available on Quarry at Indiana University:

  • Intel Fortran (ifort)
  • Intel C (icc)
  • Intel C++ (icpc)
  • GNU C/C++/Fortran 77 (gcc)
  • Portland Group Suite

Available subroutine libraries

Many software packages are available on Quarry. A complete list is updated nightly. If you need a package that is not listed, submit a Research Systems Software Request.

Available scientific/numerical subroutine libraries include:

  • GNU Scientific Library (GSL)
  • Fast Fourier Transforms (FFTW)
  • Intel Cluster Math Kernel Library (MKL)

Compiling your program

To achieve optimal performance for your code, use the Intel C, C++, or Fortran compiler. The SoftEnv keys @intel-32-v10.1 and @intel-64-v10.1 will set your PATH so that you can use these compilers.

Examples

The following examples show how to compile serial, MPI, and OpenMP parallel programs. Quarry does not have a high-speed interconnect, so MPI parallel applications may not perform well on this platform. OpenMP applications benefit from the fact that each Quarry node has two quad-core Xeon processors.

This example shows how to compile a serial Fortran program that calls subroutines in the Intel math library. It uses the Intel Fortran compiler with optimization level 2 and 32-bit addressing. (To use 32-bit addressing, use the SoftEnv key @intel-32-v10.1 .) ifort -O2 -o myprogram.exe -lm myprogram.f

To compile a large-memory (64-bit) serial C program, use the SoftEnv key @intel-64-v10.1 and then:

icc -o myprogram.exe myprogram.c

This example shows how to compile a parallel OpenMP Fortran 90 program that calls FFTW subroutines:

ifort -openmp -o myprogram.exe -L/N/soft/linux-rhel4-x86_64/fftw-3.1.2/lib -lfftw3_threads myprogram.f

The program source code uses $OMP directives to demarcate parallel sections of the code. Libraries linked to the application must be thread-safe (i.e., must guarantee that for shared memory processes that use threads, an independent function will be available for each thread that makes the call).

This example shows how to compile an MPI application using the Intel C++ compiler and OpenMPI version 1.2.6 (use the SoftEnv key +openmpi-1.2.6-intel-64):

mpic++ -o myprogram.exe myprogram.cpp