#
# PGI Compiler Configurations for High Performance Fortran
#
# $Id: pghpf90rc,v 1.7 2000/09/08 19:32:22 mx86 Exp $
#

set SYSV_PROF=NO

#
# User Defined Switches for HPF
#

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

switch Mg=-g
switch Mport=-Wh,-x,49,0x80
switch Mautoind=-Wh,-x,47,0x200000
switch Mnoindependent=-Wh,-x,49,0x80000
switch Mcraft=-Wh,-craft
switch Mserial=-Wh,-x,58,0x4000
switch Mlocal=-Wh,-x,58,0x2000
switch Mf90=-Wh,-x,58,0x40
switch Msmp=-Wh,-x,58,0x80
switch Mexemplar=-Wh,-x,58,0x80
switch Mfixed=-Mnofreeform
switch Mhpf2=-Wh,-x,58,0x22
switch byteswapio=-Wh,-x,125,2
switch Mbyteswapio=-Wh,-x,125,2
switch Mnogenblock=-Wh,-x,58,0x200000
switch errorlimit*=-Wh,-errlimit*
switch Mchkptr=-Wh,-x,70,4
switch Msave=-Wh,-save -W0,-save
switch Mnosave=-Wh,-nosave -W0,-nosave

switch Mmpi
switch Mnx
switch Mmpl
switch Mpvm
switch Mrpm
switch Mrpm1
switch Mhpvm
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 Hpvm=-Mpvm
switch Hrpm=-Mrpm
switch Hsmp=-Msmp
switch Hexemplar=-Mexemplar
switch Hrpm1=-Mrpm1
switch Hmpi=-Mmpi
switch Hnx=-Mnx
switch Hhpvm=-Mhpvm
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

map "0,-list"=""

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


#
# Tool arguments
#

ifndef COMP_HPF		set COMP_HPF=pghpf1
ifndef HPFDIR		set HPFDIR=$PGI/$SYSTEM/bin
ifndef EXTRACTOR_HPF	if DOS \
				set EXTRACTOR_HPF=pghpf1ex \
			else \
				set EXTRACTOR_HPF=pghpf1_ex
ifndef HPFEXDIR		set HPFEXDIR=$PGI/$SYSTEM/bin

set DRIVER_ARGS_HPF="$HOST_ARGS_H90 $EXTRA_DRIVER_ARGS_H90"
set COMP_FTN=pghpf2

set COMP_ARGS_HPF="-x 49 0x400004 -x 57 0x40 -x 58 0x10000 $TARGET_ARGS_HPF1 $EXTRA_ARGS_HPF1"
set COMP_ARGS_FTN="-x 50 2 $TARGET_ARGS_HPF2 $EXTRA_ARGS_HPF2"

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="-lpghpf_VT" \
else if PROF_HPF_FUNC \
  set P="_p" \
  set HPF_PROF_LIBS="-lpghpf_prof" \
  if -mslibs set HPF_PROF_LIBS="\"$PGIDIR/libpghpf_prof.a\"" endif \
else if PROF_HPF_LINES \
  set P="_p" \
  set HPF_PROF_LIBS="-lpghpf_prof" \
  if -mslibs set HPF_PROF_LIBS="\"$PGIDIR/libpghpf_prof.a\"" endif \
endif

if PGHPF \
  set LPGFTNRTL="-lpgftnrtl" \
  if -mslibs set LPGFTNRTL="\"$PGIDIR/libpgftnrtl.a\"" endif \
  ifn -Mnohpf \
    ifn -Mnomain \
	ifn -shared \
	    ifn -G \
		set PGFMAIN="\"$PGIDIR/hpfmain.o\"" \
	    endif \
	endif \
    endif \
    if -Mmpl \
	set HPF_COMM_LIBS="-lpghpf_mpl$P" \
    endif \
    if -Mmpi \
	set HPF_COMM_LIBS="-lpghpf_mpi$P $_HPF_MPI $HPF_SOCKET" \
    endif \
    if -Mnx \
	set HPF_COMM_LIBS="-lpghpf_nx$P -lnx $HPF_NX $HPF_SOCKET" \
    endif \
    if -Mpvm \
	ifndef LPVM3 \
	    set LPVM3="$_PVM_ROOT/lib/$_PVM_ARCH/libpvm3.a" \
	endif \
	set HPF_COMM_LIBS="-lpghpf_pvm$P $LPVM3 $HPF_SOCKET" \
    endif \
    if -Mrpm \
	set HPF_COMM_LIBS="-lpghpf_rpm$P $HPF_SOCKET" \
	if -mslibs set HPF_COMM_LIBS="\"$PGIDIR/libpghpf_rpm$P.a\" $HPF_SOCKET" endif \
    endif \
    if -Mrpm1 \
	set HPF_COMM_LIBS="-lpghpf_rpm1$P $HPF_UCB" \
	if -mslibs set HPF_COMM_LIBS="\"$PGIDIR/libpghpf_rpm1$P.a\" $HPF_UCB" endif \
    endif \
    if -Mf90 \
	set HPF_COMM_LIBS="-lpghpf_rpm1$P $HPF_UCB" \
	if -mslibs set HPF_COMM_LIBS="\"$PGIDIR/libpghpf_rpm1$P.a\" $HPF_UCB" endif \
    endif \
    if -Mserial \
	set HPF_COMM_LIBS="-lpghpf_rpm1$P $HPF_UCB" \
	if -mslibs set HPF_COMM_LIBS="\"$PGIDIR/libpghpf_rpm1$P.a\" $HPF_UCB" endif \
    endif \
    if -Mhpvm \
	set HPF_COMM_LIBS="-lpghpf_hpvm$P $HPF_HPVM" \
	if -mslibs set HPF_COMM_LIBS="\"$PGIDIR/libpghpf_hpvm$P.a\" $HPF_HPVM" endif \
    endif \
    if -Mdolphin \
	set HPF_COMM_LIBS="-lpghpf_dol$P $HPF_SOCKET" \
    endif \
    if -Msmp \
	set HPF_COMM_LIBS="-lpghpf_smp$P $HPF_POSIX" \
	if -mslibs set HPF_COMM_LIBS="\"$PGIDIR/libpghpf_smp$P.a\" $HPF_POSIX" endif \
    endif \
    ifndef HPF_COMM_LIBS \
	set HPF_COMM_LIBS="-lpghpf_rpm$P $HPF_SOCKET" \
	if -mslibs set HPF_COMM_LIBS="\"$PGIDIR/libpghpf_rpm$P.a\" $HPF_SOCKET" endif \
    endif \
    set LPGHPF="-lpghpf $HPF_COMM_LIBS $HPF_PROF_LIBS -lpghpf2" \
    if -mslibs set LPGHPF="\"$PGIDIR/libpghpf.a\" $HPF_COMM_LIBS $HPF_PROF_LIBS \"$PGIDIR/libpghpf2.a\"" endif \
    set HPF_LIBS="$LPGHPF" \
  endif \
endif

set PGFALT="hpfalt.o"

