#
# PGI Compiler Configurations for High Performance Fortran
#
# $Id: pgf90rc,v 1.19 2000/09/08 19:32:23 mx86 Exp $
#

set SYSV_PROF=NO

#
# User Defined Switches for F90
#

# temp
switch -Maims
switch -Mvampir="-Mprof=lines"

switch Mg=-g
switch Mport=-Wh,-x,49,0x80
switch Mnoindependent=-Wh,-x,49,0x80000
switch Mfixed=-Mnofreeform
switch byteswapio=-Wh,-x,125,2
switch Mbyteswapio=-Wh,-x,125,2
switch errorlimit*=-Wh,-errlimit*
switch Mchkptr=-Wh,-x,70,4
switch Msave=-Wh,-save -W0,-save
switch Mnosave=-Wh,-nosave -W0,-nosave

switch Mdolphin
switch Mstats

# Re-mapped -H switches to -M switches (for backwards compatibility)
switch Hq*=-Wh,-q*
switch Hx*=-Wh,-x*
switch Hy*=-Wh,-y*
switch Hkeepftn=-Mkeepftn
switch Hkeepipa=-Mkeepipa
switch Hnohpfc=
switch Mnohpfc=
switch Hipa=-Mipa
switch Hnoipa=-Mnoipa
switch Hinfo*=-Minfo*
switch Hftn=-Mftn
switch Hnofn=-Mnofn
switch Hnomv=-Mnomv
switch Hprof*=-Mprof*
switch Hbackslash=-Mbackslash
switch Hnobackslash=-Mnobackslash
switch Hr8intrinsics=-Mr8intrinsics
switch Hr8=-Mr8
switch Hunixlogical=-Munixlogical
switch Hvect*=-Mautopar*
switch Hg=-Mg
switch Hport=-Mport
switch Hdlines=-Mdlines
switch Hnodlines=-Mnodlines
switch Hextend=-Mextend
switch Hlist=-Mlist
switch Hnolist=-Mnolist
switch Hstandard=-Mstandard
switch Hdclchk=-Mdclchk
switch Hnodclchk=-Mnodclchk
switch Hfree=-Mfree
switch Hfreeform=-Mfreeform
switch Hdepchk=-Mdepchk
switch Hnodepchk=-Mnodepchk
switch Hsequence=-Msequence
switch Hnosequence=-Mnosequence
switch Hpreprocess=-Mpreprocess
switch Hupcase=-Mupcase
switch Hnoupcase=-Mnoupcase
switch -mangled_names=-Mx,117,0x2


map "0,-list"=""

# We don't want standard to go through to f77 for any F90 program.
map "0,-standard"=""


#
# Tool arguments
#

set COMP_HPF=pgf901
ifndef HPFDIR		set HPFDIR=$PGI/$SYSTEM/bin
ifndef EXTRACTOR_HPF	if DOS \
				set EXTRACTOR_HPF=pgf90ex \
			else \
				set EXTRACTOR_HPF=pgf90_ex
ifndef HPFEXDIR		set HPFEXDIR=$PGI/$SYSTEM/bin

set DRIVER_ARGS_F90="-Mnoprelink $HOST_ARGS_F90 $EXTRA_DRIVER_ARGS_F90"
set COMP_ARGS_HPF="-x 49 0x400004 -x 57 0x40 -x 58 0x31040 -nohpf $TARGET_ARGS_F901 $EXTRA_ARGS_F901"
set COMP_ARGS_FTN="$TARGET_ARGS_F902 $EXTRA_ARGS_F902"

set COMP_FTN=pgf902
set EXTRACTOR_FTN=pgf90_ex

ifndef PGAPPEND		set PGAPPEND=pgappend
ifndef PGAPPENDDIR	set PGAPPENDDIR=$PGI/$SYSTEM/bin
ifndef PGAPPENDARGS	set PGAPPENDARGS=""

ifndef PGIPA		set PGIPA=pgipa
ifndef PGIPADIR		set PGIPADIR=$PGI/$SYSTEM/bin
ifndef PGIPAARGS	set PGIPAARGS=""

#
# HPF libraries and startup files
#

if -Mstats \
  set P="_p" \
endif

if -Maims \
  set P="_p" \
  set HPF_PROF_LIBS="-lmon" \
else if -Mvampir \
  set P="_p" \
  set HPF_PROF_LIBS="-lpgf90_VT" \
else if PROF_HPF_FUNC \
  set P="_p" \
  set HPF_PROF_LIBS="-lpgf90_prof" \
  if -mslibs set HPF_PROF_LIBS="\"$PGIDIR/libpgf90_prof.a\"" endif \
else if PROF_HPF_LINES \
  set P="_p" \
  set HPF_PROF_LIBS="-lpgf90_prof" \
  if -mslibs set HPF_PROF_LIBS="\"$PGIDIR/libpgf90_prof.a\"" endif \
endif

if PGF90 \
  set LPGFTNRTL="-lpgf90rtl -lpgftnrtl" \
  if -mslibs set LPGFTNRTL="\"$PGIDIR/libpgf90rtl.a\" \"$PGIDIR/libpgftnrtl.a\"" endif\
  ifn -Mnohpf \
    ifn -Mnomain \
	ifn -shared \
	    ifn -G \
		set PGFMAIN="\"$PGIDIR/f90main.o\"" \
	    endif \
	endif \
    endif \
    if -Mdolphin \
	set F90_COMM_LIBS="-lpgf90_dol$P $HPF_SOCKET" \
    endif \
    ifndef F90_COMM_LIBS \
      set F90_COMM_LIBS="-lpgf90_rpm1$P $HPF_SOCKET" \
      if -mslibs set F90_COMM_LIBS="\"$PGIDIR/libpgf90_rpm1$P.a\" $HPF_SOCKET" endif \
    endif \
    set LPGHPF="-lpgf90 $F90_COMM_LIBS $HPF_PROF_LIBS -lpgf902" \
    if -mslibs set LPGHPF="\"$PGIDIR/libpgf90.a\" $F90_COMM_LIBS $HPF_PROF_LIBS \"$PGIDIR/libpgf902.a\"" endif \
    set HPF_LIBS="$LPGHPF" \
  endif \
endif

set PGFALT="f90alt.o"
