#!/bin/tcsh
#------------------------------------------------------
# This example unpacks cheetah and pooma, builds them
# under Linux using mpich, builds an example code and
# runs it.
#------------------------------------------------------

#unpack the tar files:

echo 'unpacking distributions'

zcat pooma-2.3.0.tgz | tar -xf -
zcat cheetah-1.0.tgz | tar -xf -

setenv CHEETAHDIR $PWD/cheetah-1.0/build/cheetah-1.0.devel

#configure and build cheetah:

echo 'building cheetah'

cd cheetah-1.0
setenv MPICH_ROOT /usr/local/packages/mpich-1.2.0
configure --arch LINUXKCC --mpich --shmem --noex --opt
cd lib/LINUXKCC
make
make install
cd ../../..

#configure and build pooma:

echo 'building pooma'

cd pooma-2.3.0
configure --arch LINUXKCC --opt --messaging --suite KP
setenv POOMASUITE KP
make

echo 'building a pooma example'

cd benchmarks/Doof2dUMPXC
make

echo 'running a pooma example'

# Note, POOMA passes the command line options to CHEETAH on initialization.
# CHEETAH requires these arguments to specifiy the messaging layer used, and
# possibly the number of contexts to create.

KP/Doof2dUMPXC -shmem -np 2
mpirun -np 2 KP/Doof2dUMPXC -mpi




