Compiling programs

PDS Lab cluster supports GNU compilers to compile your serial programs, MPI programs, OpenMP program and Hybrid MPI/OpenMP programs.

Serial programs

To compile and link a serial program in Fortran, C, and C++, you can use one of these commands:

f77 /path/to/myprog.f
g77 /path/to/myprog.f
gfortran /path/to/myprog.f
gcc /path/to/myprog.c
g++ /path/to/myprog.cpp

MPI programs

There are 3 MPI implementations available on the system: MVAPICH, OpenMPI, and MPICH.

You may explicitly add one of the other available MPI implementations to your environment via the soft add command to use the compilers shown.

MPI Implementation Compile Commands
MVAPICH
Fortran 77: mpif77 /path/to/myprog.f
Fortran 90: mpif90 /path/to/myprog.f90
C : mpicc /path/to/myprog.c
C++ : mpiCC /path/to/myprog.cpp

Open MPI 
MPICH 

OpenMP programs

To compile and link an OpenMP program in Fortran, C and C++, use the -fopenmp option on compiling command:

gfortran -fopenmp /path/to/myprog.f
gcc -fopenmp /path/to/myprog.c
g++ -fopenmp /path/to/myprog.cpp

Hybrid MPI/OpenMP programs

To compile and link an MPI/OpenMP hybrid program, use the -fopenmp option with the MPI compling commands:

mpif77 -fopenmp /path/to/myprog.f
mpif90 -fopenmp /path/to/myprog.f90
mpicc -fopenmp /path/to/myprog.c
mpiCC -fopenmp /path/to/myprog.cc