SAPAC logo The South Australian Partnership for Advanced Computing spacer
Information about Information for Search SAPAC Contact SAPAC

Aquila - Compiling programs

The following compilers are provided on Aquila. They should all be accessible, with the default path provided once a choice has been made for the $COMPILER environment variable in your .cshrc.aquila file. If you are unsure about how do do this, refer to the Getting Started section of this User Guide.

  • GNU Compilers
    • gcc (also aliased to cc) for C and C++ programs.
    • g77 (also aliased to f77) for Fortran 77 programs.

  • Intel Compilers
    • icc and icpc for C and C++ programs.
    • ifc for Fortran programs.

NOTE: You may find that some programs will only compile, or will run faster, using certain compilers, so you may want to try them all.

Check the man pages and the Documentation section of this User Guide for details on usage and options for each compiler.

OpenMP Programs

OpenMP directives for shared memory parallel programming are supported by the Intel compilers. You will need to pass the -openmp flag to the compiler, for example:

  icc -openmp -o MyOMPProgram MyOMPProgram.c

NOTE: You will then also have to set the environment variable $OMP_NUM_THREADS to be equal to the number of processors you wish to run on. See the section on Running Jobs in this User Guide.

MPI Programs

MPI programs can be compiled using mpicc (for C programs), mpiCC (C++), mpif77 (Fortran 77) or mpif90 (Fortran 90). This uses the underlying Compiler Suite that has been set to the $COMPILER environment variable in your .cshrc.aquila file. This could be one of gnu|intel. You will also need to link the MPI library in to your program, for example:

  icc -o MyMPIProgram MyMPIProgram -lmpi

General Tips and Information

  • All of the compilers will produce much faster code if you use compiler optimisation flags. Check the documentation or man pages of the compiler you are using to find the appropriate optimisation flags. Some compilers use increasing numbers, e.g. -O1, -O2, etc.

  • NOTE: You should NOT use optimisation flags when developing and debugging programs. They should only be used once you have checked that the program works, and you want to make it run faster. This is because it may take substantially longer to compile the program at a higher optimisation level. Also, there is a greater chance of finding compiler problems or bugs at higher optimisation levels. The compiler may not be able to compile the program, or the output of the program may be incorrect. It is a good idea to check that the results of your programs compiled with a high optimisation level are the same as those with the default optimisation. If you detect an error when using a high optimisation level, try compiling that routine or program again at a lower optimisation level.

 

Aquila User's Guide

SAPAC SITE MAP