#!/bin/bash
#
#  $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_pgf77,v 1.2 2010/03/21 21:34:01 jmc Exp $
#  $Name:  $
#
# Build options for PGI 10.9 compiler
# tested on baudelaire (Linux 2.6.34.7-61.fc13.x86_64)
#
#-------
#   -  sh,bash:
#     > export PGI=/srv/software/pgi/pgi-10.9
#     > export PATH=$PGI/linux86-64/10.9/bin:$PATH
#     > export MANPATH=$MANPATH:$PGI/linux86-64/10.9/man
#     > export LM_LICENSE_FILE=$PGI/license.dat
#   - csh,tcsh:
#     > setenv PGI /srv/software/pgi/pgi-10.9
#     > set path=($PGI/linux86-64/10.9/bin $path)
#     > setenv MANPATH "$MANPATH":$PGI/linux86-64/10.9/man
#     > setenv LM_LICENSE_FILE $PGI/license.dat
#-------

FC=pgf77

DEFINES='-DWORDLENGTH=4'
CPP='cpp  -traditional -P'
EXTENDED_SRC_FLAG='-Mextend'

NOOPTFLAGS='-O0'

if test "x$IEEE" = x ; then
    #  No need for IEEE-754
    FFLAGS="$FFLAGS -byteswapio -Mnodclchk -Ktrap=fp"
    FOPTIM='-tp k8-64 -pc=64 -O2 -Mvect=sse' #-fastsse -O3 -Msmart -Mvect=cachesize:1048576,transform'
else
    #  Try to follow IEEE-754
    FFLAGS="$FFLAGS -byteswapio -Ktrap=fp"
    FOPTIM='-tp k8-64 -pc=64 -O0 -Kieee'
fi
#- might want to use '-r8' for fizhi pkg:
#FFLAGS="$FFLAGS -r8"

