#!/bin/sh # this is a script that is intended to guide the procession of # our makefiles in an independent way across multiple OS platforms # and multiple hardware platform...(first for sun) echo "checking out target machine:" X="os-detected" MY_OS="" if [ `uname -a | fgrep -i sun | wc -l` -ne 0 ] ; then MY_OS="sunos" fi if [ `uname -a | fgrep -i aix | wc -l` -ne 0 ] ; then MY_OS="aix" fi if [ `uname -a | fgrep -i hp-ux | wc -l` -ne 0 ] ; then MY_OS="hp-ux" fi if [ `uname -a | fgrep -i irix | wc -l` -ne 0 ] ; then MY_OS="irix" fi /bin/rm -fr makefile case $MY_OS in "sunos") echo " detected SunOS..." echo $MY_OS > $X echo "include makefile.sun.mpich" > makefile ;; "aix") echo " detected AIX..." echo $MY_OS > $X echo "include makefile.ibm.mpif" > makefile ;; "irix") echo " detected IRIX..." echo $MY_OS > $X echo "include makefile.sgi.mpich" > makefile ;; "hp-ux") echo " detected HP-UX..." echo $MY_OS > $X echo "include makefile.hpux.mpich" > makefile ;; *) echo "Hey, I don't know this operating system..." echo $MY_OS > $X echo "include makefile.unix.posix" > makefile ;; esac cat makefile.proto >> makefile case $MY_OS in "irix") # those folks busted "which" FOUND_MPI=`which -f mpirun |wc |awk '{print $2}'` ;; *) FOUND_MPI=`which mpirun |wc |awk '{print $2}'` ;; esac if [ $FOUND_MPI -ne 0 ] ; then echo " found MPI..." fi FP='/scratch-modi4/'`whoami`'/' mkdir $FP >/dev/null 2>&1 echo " user temp directory $FP exists..." echo 'FILEPREFIXVAL=\"'$FP'\"' > fileprefix echo "the file \"makefile\" is now configured for target." exit 0