#!/bin/bash
#
#  $Header: /u/gcmpack/MITgcm/tools/build_options/linux_ia32_g77+mpi_aces,v 1.3 2008/05/17 23:35:04 jmc Exp $
#  $Name:  $
#
#  These are the build options used with the GNU compiler for the
#  daily testing on ACES (which are initiated by cron jobs on the "ao"
#  head node).
#
#  Please note the appropriate module command:
#
#    module add mpich/gnu
#

DEFINES='-DALLOW_USE_MPI -DALWAYS_USE_MPI -D_BYTESWAPIO -DWORDLENGTH=4'
CPP='cpp  -traditional -P'

FC='mpif77'
CC='mpicc'
LINK='mpif77'
LIBS='-L/usr/local/pkg/mpich/mpich-gcc/lib '
INCLUDES='-I/usr/local/pkg/mpich/mpich-gcc/include '

if test "x$IEEE" = x ; then
    #  No need for IEEE-754
    # FFLAGS='-Wimplicit -Wunused -Wuninitialized'
    # FOPTIM='-O3 -malign-double -funroll-loops'
#- note(jmc):
# -O3 is not always faster than -O2 ; sse & sse2 are faster ;
# Problems with "-funroll-loops" for some set-up, e.g. tutorial_helt_suarez_cs
    FFLAGS='-Wimplicit -Wunused -mfpmath=sse -msse -msse2'
    FOPTIM='-O3 -malign-double'
else
    #  Try to follow IEEE-754
    # FFLAGS='-Wimplicit -Wunused -ffloat-store'
    FFLAGS='-Wimplicit -Wunused -mfpmath=sse -msse -msse2'
    FOPTIM='-O0 -malign-double'
fi
NOOPTFLAGS='-O0'

