Blame maint/samplebuilds

Packit 0848f5
#! /bin/sh
Packit 0848f5
#
Packit 0848f5
# Configure and build the most common configurations.  Does not do 
Packit 0848f5
# extensive tests
Packit 0848f5
#
Packit 0848f5
# ----------------------------------------------------------------------------
Packit 0848f5
# Set defaults
Packit 0848f5
#
Packit 0848f5
do_tests=yes
Packit 0848f5
builddir=/sandbox/$LOGNAME/mpich2
Packit 0848f5
instdir=/sandbox/$LOGNAME/mpi2-inst
Packit 0848f5
srcdir=/home/MPI/testing/mpich2/mpich2
Packit 0848f5
# ----------------------------------------------------------------------------
Packit 0848f5
# Get arguments
Packit 0848f5
for arg in "$@" ; do
Packit 0848f5
    case $arg in 
Packit 0848f5
	-echo) set -x ;;
Packit 0848f5
	-local) 
Packit 0848f5
	# Do the testing in place.
Packit 0848f5
	builddir=`pwd`
Packit 0848f5
	instdir=`(cd .. && pwd)`"/mpi2-inst"
Packit 0848f5
	srcdir=`pwd`
Packit 0848f5
	;;
Packit 0848f5
	-notest)
Packit 0848f5
	do_tests=no
Packit 0848f5
	;;
Packit 0848f5
	*)
Packit 0848f5
	if [ -n "$arg" ] ; then
Packit 0848f5
	    echo "Unknown argument $arg"
Packit 0848f5
	    exit 1
Packit 0848f5
	fi
Packit 0848f5
	;;
Packit 0848f5
    esac
Packit 0848f5
done
Packit 0848f5
Packit 0848f5
# ----------------------------------------------------------------------------
Packit 0848f5
# Validate arguments
Packit 0848f5
#
Packit 0848f5
if [ ! -d $srcdir ] ; then
Packit 0848f5
    if [ -d /homes/MPI/testing/mpich2/mpich2 ] ; then
Packit 0848f5
        srcdir=/homes/MPI/testing/mpich2/mpich2
Packit 0848f5
    else
Packit 0848f5
	echo "Cannot find source directory"
Packit 0848f5
	exit 1
Packit 0848f5
    fi
Packit 0848f5
fi
Packit 0848f5
#
Packit 0848f5
if cd $builddir ; then
Packit 0848f5
    :
Packit 0848f5
else
Packit 0848f5
    echo "Could not change directory to $builddir"
Packit 0848f5
    exit 1
Packit 0848f5
fi
Packit 0848f5
if [ ! -x $srcdir/configure ] ; then
Packit 0848f5
    echo "Cannot find configure in $srcdir"
Packit 0848f5
    exit 1
Packit 0848f5
fi
Packit 0848f5
#
Packit 0848f5
# ---------------------------------------------------------------------------
Packit 0848f5
# BuildMPICH uses the following global variables:
Packit 0848f5
#    testname    - string name for test
Packit 0848f5
#    config_args - arguments to pass to configure
Packit 0848f5
#    do_tests    - yes or no; controls tests
Packit 0848f5
#    srcdir,instdir - directories for source, installation
Packit 0848f5
# This uses XML-style tags to mark the various segments, but does not
Packit 0848f5
# filter the output from the individual steps for XML/SGML characters (e.g.,
Packit 0848f5
# the <,>,& characters aren't handled).
Packit 0848f5
# Note: we could filter through sed with
Packit 0848f5
# sed -e 's/>/-AMP-gt;/g' -e 's/</-AMP-lt;/g' -e 's/\&/-AMP-amp;/g' | \
Packit 0848f5
# sed -e 's/-AMP-/&/g'
Packit 0848f5
#
Packit 0848f5
BuildMPICH2 () {
Packit 0848f5
echo "<BUILDTEST NAME=\"$testname\">"
Packit 0848f5
echo "<CONFIG>"
Packit 0848f5
if $srcdir/configure --prefix=$instdir $config_args ; then
Packit 0848f5
    echo "</CONFIG>"
Packit 0848f5
    echo "<MAKE>"
Packit 0848f5
    # Remove any lingering libraries
Packit 0848f5
    rm -f lib/libmpi*.a lib/libpmpi*.a lib/libmpifort*.a
Packit 0848f5
    rm -f lib/libmpi*.so lib/libpmpi*.so lib/libmpifort*.so
Packit 0848f5
    if make ; then
Packit 0848f5
        echo "</MAKE>"
Packit 0848f5
	echo "<MAKEINST>"
Packit 0848f5
	if make install ; then
Packit 0848f5
	    echo "</MAKEINST>"
Packit 0848f5
	    if [ "$do_tests" = "yes" ] ; then
Packit 0848f5
	        echo "<RUNTEST>"
Packit 0848f5
	        if make testing ; then
Packit 0848f5
		    echo "Tests completed in test/mpi/summary.xml"
Packit 0848f5
		    # Really should copy failures if any
Packit 0848f5
	        else
Packit 0848f5
		    echo "Tests failed ($testname)"
Packit 0848f5
	        fi
Packit 0848f5
	        echo "</RUNTEST>"
Packit 0848f5
	    fi
Packit 0848f5
	else
Packit 0848f5
	    rc=$?
Packit 0848f5
	    echo "Install failed ($testname)"
Packit 0848f5
	    echo "</MAKEINST STATUS=\"$rc\">"
Packit 0848f5
	fi
Packit 0848f5
    else 
Packit 0848f5
        rc = $?
Packit 0848f5
	echo "make failed ($testname)"
Packit 0848f5
	echo "</MAKE STATUS=\"$rc\">"
Packit 0848f5
    fi
Packit 0848f5
else
Packit 0848f5
    rc=$?
Packit 0848f5
    echo "Configure failed ($testname)"
Packit 0848f5
    echo "</CONFIG STATUS=\"$rc\">"
Packit 0848f5
fi
Packit 0848f5
echo "</BUILDTEST>"
Packit 0848f5
}
Packit 0848f5
# ---------------------------------------------------------------------------
Packit 0848f5
# Preamble
Packit 0848f5
echo "<MPICH2BUILD>"
Packit 0848f5
echo "<DATE>"
Packit 0848f5
date
Packit 0848f5
echo "</DATE>"
Packit 0848f5
# ---------------------------------------------------------------------------
Packit 0848f5
# Basic test
Packit 0848f5
testname="basic"
Packit 0848f5
config_args=""
Packit 0848f5
BuildMPICH2
Packit 0848f5
Packit 0848f5
#
Packit 0848f5
# No Fortran or C++
Packit 0848f5
testname="no f77/c++"
Packit 0848f5
config_args="--disable-f77 --disable-cxx"
Packit 0848f5
BuildMPICH2
Packit 0848f5
Packit 0848f5
#
Packit 0848f5
# No Weak symbols
Packit 0848f5
testname="no weak symbols"
Packit 0848f5
config_args="--disable-weak-symbols"
Packit 0848f5
BuildMPICH2
Packit 0848f5
Packit 0848f5
#
Packit 0848f5
# --enable-fast
Packit 0848f5
testname="fast"
Packit 0848f5
config_args="--enable-fast"
Packit 0848f5
BuildMPICH2
Packit 0848f5
Packit 0848f5
#
Packit 0848f5
# forker pm, strict
Packit 0848f5
testname="strict and forker"
Packit 0848f5
config_args="--enable-strict --with-pm=forker"
Packit 0848f5
BuildMPICH2
Packit 0848f5
Packit 0848f5
#
Packit 0848f5
# Build and link with a logging library
Packit 0848f5
testname="logging with lwlog"
Packit 0848f5
config_args="--with-logging=lwlog --with-pm=forker"
Packit 0848f5
BuildMPICH2
Packit 0848f5
Packit 0848f5
#
Packit 0848f5
# Build with memory checking
Packit 0848f5
testname="memory tests"
Packit 0848f5
config_args="--enable-g=all --enable-strict"
Packit 0848f5
BuildMPICH2
Packit 0848f5
Packit 0848f5
#
Packit 0848f5
# Build with shared libraries
Packit 0848f5
testname="sharedlibs"
Packit 0848f5
config_args="--enable-sharedlibs=gcc"
Packit 0848f5
BuildMPICH2
Packit 0848f5
Packit 0848f5
#
Packit 0848f5
# Build with PVFS if available
Packit 0848f5
# --with-romio=--with-file-system=ufs+nfs+testfs+pvfs
Packit 0848f5
# Tests could be run in /pvfs/pvfsstage/$LOGNAME on Chiba
Packit 0848f5
if [ -d /pvfs ] ; then
Packit 0848f5
    testname="pvfs"
Packit 0848f5
    config_args="--with-romio=--with-file-system=ufs+nfs+testfs+pvfs"
Packit 0848f5
    BuildMPICH2
Packit 0848f5
fi
Packit 0848f5
# ---------------------------------------------------------------------------
Packit 0848f5
# Postamble
Packit 0848f5
echo "</MPICH2BUILD>"