University of California

Compiling on the ShaRCS Clusters

Compiling Serial and Parallel Programs

Serial Programs

Serial source code should be compiled for the ShaRCS system with the following compiler commands:

  • icc [options] file.c (C programs)
  • icpc [options] file.cpp (C++ programs)
  • ifort [options] file.f (fixed form Fortran source code)
  • ifort [options] file.f90 (free format Fortran source code)

Parallel Programs

MPI source code should be compiled for the ShaRCS system with the following default compiler commands:

  • mpicc [options] file.c (MPI parallel C++ programs)
  • mpicxx [options] file.cpp (MPI parallel C++ programs)
  • mpif77 [options] file.f (Fortran 77 source code)
  • mpif90 [options] file.f (free format code/dynamic memory allocation/object oriented Fortran source code)

Other MPI stack/compiler combinations may be obtained by choosing the appropriate Modules Environment.

The clusters also have PGI compilers available.

  • pgcc [options] file.c (C and C++)
  • pgf77 [options] file.f (fixed form Fortran source code)
  • pgf90 [options] file.f90 (free format Fortran source code)

GNU compilers (gcc, g++ & g77) are also available on the cluster but code performance will not be as good as with Intel compilers.

Intel Numerical Libraries

Intel has developed Math Kernel Library (MKL) which contain many linear algebra, FFT and other useful numerical routines, including:

  • Basic linear algebra subprograms (BLAS) with additional sparse routines
  • Fast Fourier Transforms (FFT) in 1 and 2 dimensions, complex and real
  • The linear algebra package, LAPACK
  • A C interface to BLAS
  • Vector Math Library (VML)
  • Vector Statistical Library (VSL)
  • Multi-dimensional Discrete Fourier Transforms (DFTs)

You are encouraged to use the MKL libraries wherever possible because they have been tested for accuracy and correctness, and generally produce faster programs than user-developed routines.

To find the correct link options for MKL libraries (both dynamically and statically), for BLAS and LAPACK, consult the Intel Math Kernel Library Link Line Advisor page.