1#!/bin/csh
2#
3# This is the base test script for OPT++.  The script is written to run as
4# a csh script because that preserves csh environment variables needed for
5# making OPT++
6#
7# Usage: run_base_test.csh root_directory optpp_version
8#
9# The package versions are passed on to the checkout_script.
10# The script can be started at the command line or by using crontab.
11
12# set up the environment variables
13set ROOT = $1
14set SQA  = $ROOT/OPT++/bin
15set UNAME = `uname`
16if ( $UNAME == 'SunOS' ) then
17#  if ($4 == 'tflop')
18#    set PLATFORM = tflop
19#  else
20    set PLATFORM = solaris
21#  endif
22else if ( $UNAME == 'AIX' ) then
23  set PLATFORM = aix
24else if ( $UNAME == 'IRIX64') then
25  set PLATFORM = irix
26else if ( $UNAME == 'Linux' ) then
27  set PLATFORM = linux
28else if ( $UNAME == 'OSF1' ) then
29  set PLATFORM = osf
30endif
31set BASE = $ROOT/test_$PLATFORM
32
33# if base directory does not exist, create
34#if (-e $BASE) then
35#  echo "Base directory is $BASE"
36#else
37#  mkdir -p $BASE
38#  echo "Creating base directory $BASE"
39#endif
40
41# Checkout the correct versions of DAKOTA and its packages.
42$SQA/checkout_script.csh $ROOT $BASE
43
44# Run make script which configures (with hardwired arguments) and builds dakota.
45setenv OPTPP  $BASE/OPT++
46cd $OPTPP
47$SQA/make_script.csh
48#$SQA/make_script.csh --with-mpi
49
50# create VOTD distributions
51$SQA/create_votd.csh $ROOT $PLATFORM
52
53# Check to see if there were any errors.
54# If not, run test suites (native builds only).
55cd $OPTPP
56if (! -e make_optpp.err) then
57  make tests
58  echo "Tests completed"
59endif
60
61# Finish
62cd $ROOT
63