GNU Compilers
The gnu compilers are available in the default
path and are invoked with the cc and
f77 commands for the C/C++ and Fortran77
compilers respectively. gfortran invokes a gnu
fortran90 compiler.
Open source codes typically are rather easy to compile
with gnu compilers. Writers of widely used codes
typically test their codes with the universally
available gnu compilers.
Parallel programmers are strongly
encouraged to use the Intel or Portland Group
compilers to generate more efficient code.
Compiling a Multi-Core Program
The following command line gave relatively
efficient OpenMP code with gfortran on the AMD blades
gfortran -mtune=k8 -funroll-loops -fexpensive-optimization -ffast-math -fopenmp -o exec code.f
For Intel blades, the command would be
gfortran -march=nocona -funroll-loops -ffast-math -O3 -msse3 -ftree-vectorize -fopenmp -o exec code.f
For a simple BLAS-1 test code doing operations on vectors of double precicsion
numbers, the gfortran compiled
executable ran at about half the speed of Intel
and Portland Group compiled code. For 64 bit numeric libraries, see /usr/local/apps/acml/acml4.3.0.
The libraries in /usr/local/apps/acml/acml4.3.0/gfortran64_mp are multi-threaded.
Compiling a Distributed Memory Parallel Program
To get an mpich library which works with large messages,
use the command 'source /home/gwhowell/scripts/mpich13a2-gnu412.csh'.
This will permit mpicc, mpicxx,
and mpif77 to be used to compile C,C++, and
Fortran 77 MPI programs respectively. These commands
will use the GNU compilers and MPICH2 libraries
built with GNU compilers.
|