#!/bin/sh
#############################################################################
# This script checks for a PVM 3.3 development environment
# Starting with 3.3 PVM_ROOT has to be set, making this task very easy
#
# Bernd Mohr & Pete Beckman 10/28/94
#############################################################################

pvm_whoami=`(whoami 2> /dev/null) 2> /dev/null`
nop=x

if [ $? != 0 ]
  then
#           Could not find whoami (probably a cray-ism)
  if [ $USER ]
    then
      pvm_whoami=$USER
#      echo PVM:  Got username from \$USER environment variable.
    else
      pvm_whoami=nobody
#      echo PVM:  Could not determine username, set to \"nobody\".
  fi
fi

# set PVM homedir if it is in local home directory
pvm_homedir=`echo echo ~$pvm_whoami | /bin/csh -f`/pvm3

#echo PVM:  Looking in $pvm_homedir for PVM...

# Is there really a PVM?
if [ -d $pvm_homedir/include ]
  then
    nop=x
#    echo PVM:  Found PVM in $pvm_homedir, PVM run-time will be compiled
  else
#    echo PVM:  Did not find PVM in $pvm_homedir, checking \$PVM_ROOT...
    if [ -f $PVM_ROOT/include/pvm3.h ]
      then
#        echo PVM:  Found PVM installation at $PVM_ROOT
        pvm_homedir=$PVM_ROOT
      else
        nop=x
#        echo PVM:  Could not find a PVM installation
    fi
fi

if [ -f $PVM_ROOT/include/pvm3.h ]
then
  echo $pvm_homedir
else
  echo no
fi
