#!/usr/local/bin/tcsh
#------------------------------------------------------
# This example unpacks tau, pdt, cheetah and pooma,
# builds them all, builds an example code, runs it, and
# reports the profiling results.
#------------------------------------------------------

#unpack the tar files:

echo 'unpacking distributions'

zcat tau-2.8b8.tar.gz | tar -xf -
zcat pooma-2.3.0.tgz | tar -xf -
zcat cheetah-1.0.tgz | tar -xf -
zcat pdtoolkit-1.3.tar.gz | tar -xf -

setenv PDTDIR $PWD/pdtoolkit-1.3
setenv CHEETAHDIR $PWD/cheetah-1.0/build/cheetah-1.0.devel
setenv TAUDIR $PWD/tau-2.8b8

#configure and build cheetah:

echo 'building cheetah'

cd cheetah-1.0
setenv MPICH_ROOT /usr/local/packages/mpich-1.1.2
configure --arch SGI64KCC --mpich --shmem
cd lib/SGI64KCC
make
make install
cd ../../..

#configure and build pdt:

echo 'building pdt'

cd pdtoolkit-1.3
./configure -KAI
make
make install
cd ..

#configure and build tau:

echo 'building tau'

cd tau-2.8b8
configure -arch=sgi64 -c++=KCC -SGITIMERS -pdt=/pooma/sa_smith/Tau/pdtoolkit-1.3
make install
cd ..

#configure and build pooma:

echo 'building pooma'

cd pooma-2.3.0
configure --arch SGI64KCC --profile --ex --messaging --suite KMP
setenv POOMASUITE KMP
make

echo 'building a pooma example'

cd examples/Doof2d
make

echo 'running a pooma example'

KMP/Doof2d

echo 'running tau utility - pprof'

$TAUDIR/sgi64/bin/pprof 



