From bb8a12533c994741ffefa2db680051684ccee464 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Mon, 3 Nov 2014 16:54:04 -0500 Subject: [svn-r25770] Check in initial versions of scripts to build, package and test release binaries. Further work is needed to make them version independent. --- bin/build_and_package_hdf5_binaries.sh | 180 +++++++++ bin/make1814TarFiles.pl | 350 +++++++++++++++++ bin/makeInternal1814README.pl | 190 +++++++++ bin/makeOuter1814README.pl | 173 +++++++++ bin/testh51814binary.sh | 688 +++++++++++++++++++++++++++++++++ 5 files changed, 1581 insertions(+) create mode 100644 bin/build_and_package_hdf5_binaries.sh create mode 100755 bin/make1814TarFiles.pl create mode 100755 bin/makeInternal1814README.pl create mode 100755 bin/makeOuter1814README.pl create mode 100644 bin/testh51814binary.sh diff --git a/bin/build_and_package_hdf5_binaries.sh b/bin/build_and_package_hdf5_binaries.sh new file mode 100644 index 0000000..b6f67b5 --- /dev/null +++ b/bin/build_and_package_hdf5_binaries.sh @@ -0,0 +1,180 @@ +#! /bin/sh +# (Use -e to abort at any unexpected error.) +# Submit daily tests of HDF5 base software +# Usauge: DailyHDFTests [-r] +# Example: DailyHDFTests # test the CVS current version +# DailyHDFTests -r1.2 # test version 1.2 +# DailyHDFTests -r1.4 # test version 1.4 + +# This script assumes we are building binaries for a release in +# a directory named $HOME/snapshots-bin-${sw}${SWVERSTR}, i.e. +# /home/hdftest/snapshots-bin-hdf5_1_8_14 for the HDF5 v1.8.14 release. + +# This script should be run from the $HOME/snapshots-bin-${sw}${SWVERSTR} +# directory with the command +# "sh current/bin/build_and_package_hdf5_binaries.sh -r -b" + +# general setup +PROGRAMNAME=`basename $0` +DEBUGMODE="" # change to -debug for debug mode + +# Setup +HOSTNAME=`hostname | cut -f1 -d.` # no domain part +TODAY=`date +%m%d%a` +SW=HDF5 # Name of Software. +sw=hdf5 # Name of Software in lower cases. +SWVER= # Software version, default to current CVS version. +SWVERSTR= # Software version string. +TITLE="${SW} Tests on $TODAY" +errcode=0 # error code so far + +# Parse command options +while [ $# -gt 0 ]; do + case "$1" in + -r*) + SWVER="$1" + SWVERSTR=_`echo $SWVER | sed -e s/-r// -e s/\\\./_/g` + ;; + -debug*) + DEBUGMODE="$1" + ;; + -b*) + BINARYDIR=`echo $1 | sed -e s/-b//` + ;; + *) + echo "Unknown option ($1)" + exit 1 + ;; + esac + shift +done + +# Mail addresses for reports +# TOWHOM_PASSED--normal report +# TOWHOM_FAILED--Failure Report +# If in debug mode, email output to myself; else to the "group". +if [ -n "$DEBUGMODE" ]; then + echo "******** DEBUGMODE is $DEBUGMODE ************" +# TOWHOM_PASSED=hdftest +# TOWHOM_FAILED=hdftest + TOWHOM_PASSED=lrknox + TOWHOM_FAILED=lrknox +else +# TOWHOM_PASSED="hdf5repo@lists.hdfgroup.org repo-all@lists.hdfgroup.org" +# TOWHOM_FAILED=hdf5lib@lists.hdfgroup.org +# TOWHOM_PASSED=hdftest +# TOWHOM_FAILED=hdftest + TOWHOM_PASSED=lrknox + TOWHOM_FAILED=lrknox +fi + +# Setup test directories +LOGDIR=$HOME/snapshots-bin-${sw}${SWVERSTR}/log +LOGDIRLOCK=${LOGDIR}/.lock-${HOSTNAME} +LOGFILE=${LOGDIR}/${PROGRAMNAME}-${HOSTNAME}_${TODAY} +FAILEDLOG=${LOGDIR}/FAILED_LOG_${TODAY} +FAILEDDETAIL=${LOGDIR}/FAILED_DETAIL_${TODAY} +INCOMPLETELOG=${LOGDIR}/INCOMPLETE_LOG_${TODAY} +PASSEDLOG=${LOGDIR}/PASSED_LOG_${TODAY} +SKIPPEDLOG=${LOGDIR}/SKIPPED_LOG_${TODAY} +TIMELOG=${LOGDIR}/TIME_LOG_${TODAY} +TIMEKEEPERLOG=${LOGDIR}/TIMEKEEPER_LOG_${TODAY} +REPORTED=${LOGDIR}/REPORTED_${TODAY} +REPOLOG=${LOGDIR}/REPO_LOG_${TODAY} +REPOLOG_LOCK=${LOGDIR}/REPO_LOG_LOCK_${TODAY} +SNAPSHOTLOG=${LOGDIR}/SNAPSHOT_LOG_${TODAY} +RELEASE_ASAP=${LOGDIR}/../release_asap # make a special release asap +RELEASE_ALWAYS=${LOGDIR}/../release_always # always release +RELEASE_NOT=${LOGDIR}/../release_not # Do not release +RELEASED=${LOGDIR}/RELEASED_${TODAY} +WATCHERFILE=${LOGDIR}/../watchers # List of platform watchers +CMD="bin/runtest $DEBUGMODE ${SWVER}" + +# Setup Mailing command and Report title +MAIL=mail +TEST_TITLE="$HOSTNAME ${SW}${SWVERSTR}_Daily_Tests_${TODAY}" + +# set up auto-cleanup +trap "rm -f $LOGDIRLOCK" 0 +trap "rm -f $LOGDIRLOCK" 1 2 3 4 5 6 7 8 9 10 12 13 14 15 + +# Clean up LOGDIR by moving all files that are not "of today" to OLD. +# Then go into OLD and move all files older than 7 days to OLDER. +# Then go into OLDer and remove all files older than 30 days. +# This procedure keeps old logfiles in two tiers. The first tier is OLD +# which should be in AFS space so that the files are available to most hosts. +# The second tier is OLDER which could be in HDF's own NFS space which has +# much bigger capacity but not as widely available. +# Do all these in a sub-shell with -e to abort the cleaning if any error is +# encountered. +(set -e +nold=6 +nolder=31 +echo cleaning $LOGDIR by moving all old logfiles to OLD +cd $LOGDIR +test -d OLD/. || mkdir OLD +#find . \( -name OLD -prune \) \ +# -o -type f ! -name '*'$TODAY'*' -exec mv '{}' OLD/. \; + +echo cleaning $LOGDIR/OLD by moving all files older than $nold days to OLDER +cd OLD +test -d OLDER/. || mkdir OLDER +find . \( -name OLDER -prune \) \ + -o -type f -mtime +$nold -exec mv '{}' OLDER/. \; + +echo cleaning $LOGDIR/OLDER by removing all files older than $nolder days. +cd OLDER +find . -type f -mtime +$nolder -exec rm -f '{}' \; + +if [ -f $LOGFILE ]; then + if [ -n "$DEBUGMODE" ]; then + echo "$LOGFILE exists. No more daily tests today" + fi + exit 1 +fi +) + +#(cd $HOME/snapshots-bin-${sw}${SWVERSTR}; touch $REPOLOG; $CMD -nodiff -norepo -all) > $LOGFILE 2>&1 + +# Verify test script did complete by checking the last lines +#(tail -4 $LOGFILE | grep -s "^*** finished .* in $HOSTNAME ***" > /dev/null 2>&1) || +# (echo "****snaptest launcher FAILED to complete in $HOSTNAME****" >> $FAILEDLOG) + +#CURRENT_DIR=`pwd` +#cd $HOME/snapshots-bin-${sw}${SWVERSTR}/current +#pwd +#SVN_URL=`svn info | grep URL` +#BRANCHNAME=`echo $SVN_URL | sed -e 's/URL:.*\///' | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` +#REVISION=`svn info | grep Revision` +#LAST_INFO=`svn info | grep "Last Changed"` +#TEST_TITLE="$HOSTNAME ${BRANCHNAME}${SWVERSTR}_Daily_Tests_${TODAY}" +#TITLE="${BRANCHNAME} Tests on $TODAY" +#cd $CURRENT_DIR + +# Check result +if [ -f $FAILEDLOG ]; then + errcode=1 +elif [ -f $INCOMPLETELOG ]; then + errcode=1 + echo "Not all builds were completed!" +fi + +if [ $errcode -eq 0 ]; then + DEPLOYDIR=`grep "deploydir \/mnt" ./snaptest.cfg | sed "s/^.*deploydir //"` + echo "Make binary tar files from deployed files in $DEPLOYDIR in $BINARYDIR" + CURRENT_DIR=`pwd` + cd current/bin;perl ./make1814TarFiles.pl $DEPLOYDIR $BINARYDIR + cd $CURRENT_DIR +else + echo "errcode was $errcode; no tar files were created." +fi + +# remove lock +rm -f $LOGDIRLOCK + +# test binaries on 3 linux binary test machines. + + +# final exit +exit $errcode + diff --git a/bin/make1814TarFiles.pl b/bin/make1814TarFiles.pl new file mode 100755 index 0000000..9ff3b91 --- /dev/null +++ b/bin/make1814TarFiles.pl @@ -0,0 +1,350 @@ +#!/usr/bin/perl + +# makeTarFiles.pl +use warnings; +use strict; +use Cwd; + + + +my %destsubdir = ('duck' => 'mac-lion-x86_64', + 'emu' => 'solaris', + 'emu64' => 'solaris64', + 'freedom' => 'freebsd-amd64', + 'jam' => 'linux', + 'jamgnu482' => 'linux-gnu482', + 'koala' => 'linux-x86_64', + 'koalagnu482' => 'linux-x86_64-gnu482', + 'loyalty' => 'freebsd', + 'ostrich' => 'linux-ppc64', + 'ostrichxl' => 'linux-ppc64xl', + 'platypus' => 'linux-centos6-x86_64', + 'hdf-duck' => 'mac-lion-x86_64', + 'kite' => 'mac-mountainlion-x86_64', + 'quail' => 'mac-mavericks-x86_64'); +#my %destsubdir = ('jam' => 'linux', +# 'jamgnu481' => 'linux-gnu481', +# 'koalagnu481' => 'linux-x86_64-gnu481', +# 'koala' => 'linux-x86_64'); + + +my %szipdir = ('duck' => '/mnt/hdf/packages/szip/shared/encoder/macOS-10.8', + 'duck-static' => '/mnt/hdf/packages/szip/static/encoder/mac-intel-x86_64', + 'emu' => '/mnt/hdf/packages/szip/shared/encoder/SunOS-5.10', + 'emu-static' => '/mnt/hdf/packages/szip/static/encoder/SunOS-5.10', + 'emu64' => '/mnt/hdf/packages/szip-PIC/shared/encoder/SunOS-5.11-64', + 'emu64-static' => '/mnt/hdf/packages/szip-PIC/shared/encoder/SunOS-5.11-64', + 'freedom' => '/mnt/hdf/packages/szip/shared/encoder/FreeBSD-64', + 'freedom-static' => '/mnt/hdf/packages/szip/static/encoder/FreeBSD-64', + 'hdf-duck' => '/mnt/hdf/packages/szip/shared/encoder/MacOS-10.8', + 'hdf-duck-static' => '/mnt/hdf/packages/szip/static/encoder/mac-intel-x86_64', + 'jam' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-gcc', + 'jamgnu482' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-gcc', + 'jam-static' => '/mnt/hdf/packages/szip/static/encoder/Linux2.6-gcc', + 'jamgnu482-static' => '/mnt/hdf/packages/szip/static/encoder/Linux2.6-gcc', + 'kite' => '/mnt/hdf/packages/szip/shared/encoder/MacOS-10.8', + 'kite-static' => '/mnt/hdf/packages/szip-PIC/static/encoder/MacOS-10.8', + 'koala' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-x86_64-gcc', + 'koalagnu482' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-x86_64-gcc', + 'koala-static' => '/mnt/hdf/packages/szip/static/encoder/Linux2.6-x86_64-gcc', + 'koalagnu482-static' => '/mnt/hdf/packages/szip/static/encoder/Linux2.6-x86_64-gcc', + 'jam-new' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-gcc', + 'jam-new-static' => '/mnt/hdf/packages/szip/static/encoder/Linux2.6-gcc', + 'koala-new' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-x86_64-gcc', + 'koala-new-static' => '/mnt/hdf/packages/szip/static/encoder/Linux2.6-x86_64-gcc', + 'loyalty' => '/mnt/hdf/packages/szip/shared/encoder/FreeBSD', + 'loyalty-static' => '/mnt/hdf/packages/szip/static/encoder/FreeBSD', + 'ostrich32' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-ppc64-gcc', + 'ostrich32-static' => '/mnt/hdf/packages/szip/static/encoder/Linux2.6-ibmppc64-gcc-32', + 'ostrich' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-ppc64-gcc-64', + 'ostrich-static' => '/mnt/hdf/packages/szip/static/encoder/Linux2.6-ibmppc64-gcc', + 'ostrichxl' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-ppc64-gcc-64', + 'ostrichxl-static' => '/mnt/hdf/packages/szip/static/encoder/Linux2.6-ibmppc64-gcc', + 'platypus' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-x86_64-gcc', + 'platypus-static' => '/mnt/hdf/packages/szip/static/encoder/Linux2.6-x86_64-gcc', + 'quail' => '/mnt/hdf/packages/szip/shared/encoder/MacOS-10.8', + 'quail-static' => '/mnt/hdf/packages/szip-PIC/static/encoder/MacOS-10.8'); + +my %zlibdir = ('duck' => ' /mnt/hdf/packages/zlib-125/shared/mac-intel-x86_64', + 'duck-static' => ' /mnt/hdf/packages/zlib-125/static/mac-intel-x86_64', + 'emu' => '/mnt/hdf/packages/zlib-125/shared/SunOS-5.10', + 'emu-static' => '/mnt/hdf/packages/zlib-125/static/SunOS-5.10', + 'emu64' => '/mnt/hdf/packages/zlib-123-PIC/SunOS-5.11-64', + 'emu64-static' => '/mnt/hdf/packages/zlib-123-PIC/SunOS-5.11-64', + 'fred' => ' /mnt/hdf/packages/zlib-125/static/mac-intel-x86_64', + 'fred-static' => ' /mnt/hdf/packages/zlib-125/static/mac-intel-x86_64', + 'freedom' => '/mnt/hdf/packages/zlib-125/shared/FreeBSD-64', + 'freedom-static' => '/mnt/hdf/packages/zlib-125/static/FreeBSD-64', + 'hdf-duck' => ' /mnt/hdf/packages/zlib-125/shared/mac-intel-x86_64', + 'hdf-duck-static' => ' /mnt/hdf/packages/zlib-125/static/mac-intel-x86_64', + 'jam' => '/mnt/hdf/packages/zlib-125/shared/Linux2.6-gcc', + 'jamgnu482' => '/mnt/hdf/packages/zlib-125/shared/Linux2.6-gcc', + 'jam-static' => '/mnt/hdf/packages/zlib-125/static/Linux2.6-gcc', + 'jamgnu482-static' => '/mnt/hdf/packages/zlib-125/static/Linux2.6-gcc', + 'kite' => ' /mnt/hdf/packages/zlib-125/shared/mac-intel-x86_64', + 'kite-static' => ' /mnt/hdf/packages/zlib-125/static/mac-intel-x86_64', + 'koala' => '/mnt/hdf/packages/zlib-125/shared/Linux2.6-x86_64-gcc', + 'koalagnu482' => '/mnt/hdf/packages/zlib-125/shared/Linux2.6-x86_64-gcc', + 'koala-static' => '/mnt/hdf/packages/zlib-125/static/Linux2.6-x86_64-gcc', + 'koalagnu482-static' => '/mnt/hdf/packages/zlib-125/static/Linux2.6-x86_64-gcc', + 'jam-new' => '/mnt/hdf/packages/zlib-125/shared/Linux2.6-gcc', + 'jam-new-static' => '/mnt/hdf/packages/zlib-125/static/Linux2.6-gcc', + 'koala-new' => '/mnt/hdf/packages/zlib-125/shared/Linux2.6-x86_64-gcc', + 'koala-new-static' => '/mnt/hdf/packages/zlib-125/static/Linux2.6-x86_64-gcc', + 'loyalty' => '/mnt/hdf/packages/zlib-125/shared/FreeBSD', + 'loyalty-static' => '/mnt/hdf/packages/zlib-125/static/FreeBSD', + 'ostrich32' => '/mnt/hdf/packages/zlib-125/PIC/Linux2.6-ppc64-gcc', + 'ostrich32-static' => '/mnt/hdf/packages/zlib-125/PIC/Linux2.6-ppc64-gcc', + 'ostrich' => '/mnt/hdf/packages/zlib-125/PIC/Linux2.6-ppc64-gcc-64', + 'ostrich-static' => '/mnt/hdf/packages/zlib-125/PIC/Linux2.6-ppc64-gcc-64', + 'ostrichxl' => '/mnt/hdf/packages/zlib-125/PIC/Linux2.6-ppc64-gcc-64', + 'ostrichxl-static' => '/mnt/hdf/packages/zlib-125/PIC/Linux2.6-ppc64-gcc-64', + 'platypus' => '/mnt/hdf/packages/zlib-125/shared/Linux2.6-x86_64-gcc', + 'platypus-static' => '/mnt/hdf/packages/zlib-125/static/Linux2.6-x86_64-gcc', + 'quail' => ' /mnt/hdf/packages/zlib-125/shared/mac-intel-x86_64', + 'quail-static' => ' /mnt/hdf/packages/zlib-125/static/mac-intel-x86_64'); + +my $indirectory = "."; +$indirectory = shift; + +my $outdirectory = "."; +$outdirectory = shift; + +my $key = "."; +#$key = shift; + +unless (-d $outdirectory) { + print "$outdirectory not found. Create it or choose another one and try again.\n"; + exit 1; +} + +print "Subdirectories of $indirectory will be tarred and stored in $outdirectory.\n"; + + +my $tarfilename; +my $tardirname; +my $output; +my $cmd; + +# I'm currently copying system zlibs for at least solaris and FreeBSD machines. Since this script runs on jam it may require scp to get the libs. + +#For future reference +# command for getting szlib files and links for shared binaries: +# tar cvf - -C /lib . | tar xvf - -C . +# libz.so.1.2.3 and the static files should just be copied because they're in directories +# with other files. Then create the libz.so.1 and libz.so symbolic links. +sub addzandszlibs { + my $dir = shift; + my $indirectory = shift; + my $currentdir = getcwd(); + + if (-d "$indirectory/$dir" ) { + my $szdir = $szipdir{$dir}; + my $zldir = $zlibdir{$dir}; + if ($dir =~ /static/ || $dir =~ /ostrich/) { + $cmd = "cp $szdir/lib/libsz.a $indirectory/$dir/lib"; + $output = `$cmd`; + print $output; + $cmd = "cp $zldir/lib/libz.a $indirectory/$dir/lib"; + $output = `$cmd`; + print $output; + } elsif ($dir eq "freedom" || $dir eq "loyalty") { + $cmd = "cp $szdir/lib/libsz.so.2 $indirectory/$dir/lib"; + $output = `$cmd`; + print $output; + $cmd = "cp $zldir/lib/libz.so.5 $indirectory/$dir/lib"; + $output = `$cmd`; + print $output; + + chdir "$indirectory/$dir/lib" or die "Couldn't change directory to $indirectory/$dir/lib, $!"; + $cmd = "ln -s libsz.so.2 libsz.so"; + $output = `$cmd`; + print $output; + + $cmd = "ln -s libz.so.5 libz.so"; + $output = `$cmd`; + print $output; + + chdir $currentdir or die "Couldn't change directory back to $currentdir, $!"; + } elsif ($dir eq "duck" || $dir eq "quail" || $dir eq "kite") { + #we've been using the static libraries for the macs - built with -fPIC +# $cmd = "cp $szdir/lib/libsz.a $indirectory/$dir/lib"; +# $output = `$cmd`; +# print $output; +# $cmd = "cp $zldir/lib/libz.a $indirectory/$dir/lib"; +# $output = `$cmd`; +# print $output; + $cmd = "cp $szdir/lib/libsz.so.2.0.0.dylib $indirectory/$dir/lib"; + $output = `$cmd`; + print $output; + $cmd = "cp $zldir/lib/libz.1.2.5.dylib $indirectory/$dir/lib"; + $output = `$cmd`; + print $output; + + chdir "$indirectory/$dir/lib" or die "Couldn't change directory to $indirectory/$dir/lib, $!"; + $cmd = "ln -s libsz.so.2.0.0.dylib libsz.2.dylib"; + $output = `$cmd`; + print $output; + + $cmd = "ln -s libsz.so.2.0.0.dylib libsz.cylib"; + $output = `$cmd`; + print $output; + + $cmd = "ln -s libz.1.2.5.dylib libz.1.dylib"; + $output = `$cmd`; + print $output; + + $cmd = "ln -s libz.1.2.5.dylib libz.dylib"; + $output = `$cmd`; + print $output; + + chdir $currentdir or die "Couldn't change directory back to $currentdir, $!"; + + } elsif ($dir eq "emu64") { + $cmd = "cp $szdir/lib/libsz.so.2.0.0 $indirectory/$dir/lib"; + $output = `$cmd`; + print $output; + $cmd = "cp $zldir/lib/libz.a $indirectory/$dir/lib"; + $output = `$cmd`; + print $output; + + chdir "$indirectory/$dir/lib" or die "Couldn't change directory to $indirectory/$dir/lib, $!"; + $cmd = "ln -s libsz.so.2.0.0 libsz.so.2"; + $output = `$cmd`; + print $output; + + $cmd = "ln -s libsz.so.2.0.0 libsz.so"; + $output = `$cmd`; + print $output; + + chdir $currentdir or die "Couldn't change directory back to $currentdir, $!"; + + } else { + $cmd = "cp $szdir/lib/libsz.so.2.0.0 $indirectory/$dir/lib"; + $output = `$cmd`; + print $output; + $cmd = "cp $zldir/lib/libz.so.1.2.5 $indirectory/$dir/lib"; + $output = `$cmd`; + print $output; + + chdir "$indirectory/$dir/lib" or die "Couldn't change directory to $indirectory/$dir/lib, $!"; + $cmd = "ln -s libsz.so.2.0.0 libsz.so.2"; + $output = `$cmd`; + print $output; + + $cmd = "ln -s libsz.so.2.0.0 libsz.so"; + $output = `$cmd`; + print $output; + + $cmd = "ln -s libz.so.1.2.5 libz.so.1"; + $output = `$cmd`; + print $output; + + $cmd = "ln -s libz.so.1.2.5 libz.so"; + $output = `$cmd`; + print $output; + + chdir $currentdir or die "Couldn't change directory back to $currentdir, $!"; + } + } +} + +sub makeTarFile { + my $directoryname = shift; + my $origdirname = shift; + my $tarfilename = shift; + my $tardirname = shift; + $cmd = "mv $indirectory/$origdirname $indirectory/$tardirname"; + $output = `$cmd`; + print $output; + if (-d $indirectory."/".$tardirname."/doc/hdf5/examples") { + $cmd = "mv $indirectory/$tardirname/doc/hdf5/examples $indirectory/$tardirname/examples"; + $output = `$cmd`; + print $output; + $cmd = "rm -rf $indirectory/$tardirname/doc"; + $output = `$cmd`; + print $output; + } + $cmd = "tar zcvf $outdirectory/$directoryname/$tarfilename -C $indirectory $tardirname"; + print "Need to run $cmd.\n"; + $output = `$cmd`; + sleep 10; + print "Create $tarfilename: $output\n"; + $cmd = "mv $indirectory/$tardirname $indirectory/$origdirname"; + $output = `$cmd`; + print $output; +} + +foreach $key (keys %destsubdir) { + print "Process ".$key."\n\n"; + #skip unless there's a directory by the name of $key or $key-static + next unless -d $indirectory.'/'.$key || -d $indirectory.'/'.$key."-static"; + my $version; + # This assumes a static directory. Probably the others should be checked if this + # doesn't exist. + $cmd = "grep \"HDF5 Version\" $indirectory/$key/lib/libhdf5.settings"; + $_ = `$cmd`; + #print OUTFILE $_, "\n"; + s/HDF5 Version://; + s/^\s+//; + chomp; + $version = $_; + #my $directoryname = substr $destsubdir{$key}, 0, rindex($destsubdir{$key}, '-'); + my $directoryname = $destsubdir{$key}; + mkdir $outdirectory."/".$directoryname, 0755 unless -d $outdirectory."/".$directoryname; + my $staticdir = $key."-static"; + print $indirectory."/$key tarfile will be put in " . $outdirectory."/".$directoryname."\n"; + if (-e $outdirectory."/".$destsubdir{$key}."/README") { + print $outdirectory."/".$destsubdir{$key}."/README" . " has already been created.\n"; + } + else { + print "Make the Outer README file: "; + $cmd = "perl ./makeOuter1814README.pl $indirectory/$key $outdirectory $directoryname"; + print $cmd, "\n"; + my $output = `$cmd`; + print $output; + } + my $file = ""; + my @dirnames = ""; + opendir(DIR, $indirectory) or die "can't open .: $!"; + while (defined($file = readdir(DIR))) { + next unless ($file eq $key || $file eq "$key-static") && -d $indirectory."/".$file; + push @dirnames, $file; + } + foreach my $dir (@dirnames) { + next if $dir eq ""; + print "Make the Inner README files.\n"; + $cmd = "perl ./makeInternal1814README.pl $indirectory/$dir"; + print $cmd, "\n"; + $output = `$cmd`; + print $output; + print "Add the zlib and szip files for $dir.\n"; + &addzandszlibs($dir, $indirectory); + my $currentdir = getcwd(); + + chdir "$indirectory/$dir/bin" or die "Couldn't change directory to $indirectory/$dir/bin, $!"; + $cmd = "/home/lrknox/hdf/release_scripts/h5rmflags -force"; + $output = `$cmd`; + print $output; + chdir $currentdir or die "Couldn't change directory back to $currentdir, $!"; + print "Tar up the files into the output directory.\n"; + if (-d $indirectory."/".$dir) { + if ($dir =~ /static/) { + $tarfilename = "hdf5-$version-$destsubdir{$key}-static.tar.gz"; + $tardirname = "hdf5-$version-$destsubdir{$key}-static"; + } else { + $tarfilename = "hdf5-$version-$destsubdir{$key}-shared.tar.gz"; + $tardirname = "hdf5-$version-$destsubdir{$key}-shared"; + } + &makeTarFile($directoryname, $dir, $tarfilename, $tardirname); + } + } + # If this copy is done after h5rmflags is run on all the directories the compile scripts + # in the utilities directory will already have the paths removed. + if (-d $indirectory."/".$staticdir) { + $cmd = "cp -prv $indirectory/$staticdir/bin $outdirectory/$directoryname/utilities"; + $output = `$cmd`; + print $output; + } +} + diff --git a/bin/makeInternal1814README.pl b/bin/makeInternal1814README.pl new file mode 100755 index 0000000..624f9cb --- /dev/null +++ b/bin/makeInternal1814README.pl @@ -0,0 +1,190 @@ +#!/usr/bin/perl +# makeInternalREADME.pl +use warnings; +use strict; + +my $section2="For information on compilers and settings used to build these HDF5 +libraries, please refer to: + + ./lib/libhdf5.settings + +The contents of this directory are: + + COPYING - Copyright notice + README - This file + RELEASE.txt - Detailed information regarding this release + bin/ - Directory containing HDF5 pre-compiled utilities + include/ - Directory containing HDF5 include files + lib/ - Directory containing HDF5 libraries and settings + share/ - Directory containing HDF5 C, C++ and Fortran example + program code and scripts to test compile scripts + h5cc, h5c++ and h5fc + +These binaries were built with the ZLIB and SZIP (version 2.1, Encoder +ENABLED) external libraries which are included in the lib directory for +convenience. + +We also provide the ZLIB and SZIP source code on our ftp server at: + + ftp://ftp.hdfgroup.org/lib-external/ + +The official ZLIB and SZIP pages are at: + + ZLIB: http://www.zlib.net/ + SZIP: http://hdfgroup.org/doc_resource/SZIP/ + +"; + +my $section3 = "If using the shared libraries, you must add the HDF5 library path +to the LD_LIBRARY_PATH variable. +"; + +my $section4 = "We provide scripts for compiling applications with the HDF5 libraries: + + bin/h5cc - for C + bin/h5fc - for F90 (if Fortran 90 is included with the binaries) + bin/h5c++ - for C++ (if C++ is included with the binaries) + +After you have installed the binaries to their final destination, +you can use these scripts (h5cc, h5fc, h5c++) to compile. However, +you must first: + + 1) Run ./h5redeploy in the bin directory to change site specific paths in the scripts. + + 2) Edit each script and update the paths for the external libraries + in LDFLAGS and CPPFLAGS. + +You may also need to change other variables in the scripts, depending +on how things are set up on your system. Here are some of the variables +to check: + + prefix - Path to the HDF5 top level installation directory + CCBASE - Name of the alternative C compiler + CLINKERBASE - Name of the alternative linker + LIBS - Libraries your application will link with + +For further details refer to the INSTALL files in the ./release_docs/ +directory of the HDF5 source code: + + ftp://ftp.hdfgroup.org/HDF5/current/src/unpacked/release_docs/ + +Source code can be found on the THG ftp server in: + + ftp://ftp.hdfgroup.org/HDF5/current/src/ + +Please send questions, comments, and suggestions to: + + http://hdfgroup.org/about/contact.html + + +"; + +my $indirectory = "."; +$indirectory = shift; +my $linktype = "shared"; +if ($indirectory =~ /static/) { + $linktype = "static"; +} + +my $version; + +my $outfile = "$indirectory/README"; +open OUTFILE, ">$outfile" or die "$!Couldn't open $outfile - check permissions for $indirectory\n"; +my $hostname; +my $cmd = "grep \"HDF5 Version\" $indirectory/lib/libhdf5.settings"; +$_ = `$cmd`; +#print OUTFILE $_, "\n"; +s/HDF5 Version://; +s/^\s+//; +chomp; +$version = $_; +#print OUTFILE $_, "\n"; + +my $versionstring= "This directory contains the $linktype binary distribution of HDF5-".$version; + +$cmd = "grep \"Uname information:\" $indirectory/lib/libhdf5.settings"; +$_ = `$cmd`; +s/Uname information://; +s/^\s+//; +#print OUTFILE $_; +chomp; +#s/(^\w+)(\s)(\S+)/$1/; +#s/(^.*)(-)(.*)(200[7-8])(.*)(\s)(\S+)/$1 $5/; +#my $platformstring = "\nthat was compiled on:" . $_ . " "; +my $platformstring = ""; +my $hostnamestring = $_; +my @hostnamestring = split / /, $hostnamestring; +#print OUTFILE "Size of hostnamestring is ", scalar @hostnamestring, "\n"; +#print OUTFILE $hostnamestring[0] . "\t" . $hostnamestring[2]."\t".$hostnamestring[19]."\n"; +$hostname = $hostnamestring[1]; +#my $size = scalar @hostnamestring; +if ($hostname =~ /loyalty/) { + $platformstring = "\nthat was compiled on: " . $hostnamestring[0]." " . $hostnamestring[2]." " . $hostnamestring[-1] . " "; +} +elsif ($hostname =~ /freedom/) { + $platformstring = "\nthat was compiled on: " . $hostnamestring[0]." " . $hostnamestring[2]." " . $hostnamestring[-1] . " "; +} elsif ($hostname =~ /emu/) { + $platformstring = "\nthat was compiled on: " . $hostnamestring[0]." " . $hostnamestring[2] . " " . $hostnamestring[-2] . " "; +} elsif ($hostname =~ /fred/) { + $platformstring = "\nthat was compiled on: " . $hostnamestring[0]." " . $hostnamestring[2] . " " . $hostnamestring[-1] . " "; +} else { + $_ = $hostnamestring[2]; + my $pos = index $_, '-'; + my $os = substr $_, 0, $pos; + $platformstring = "\nthat was compiled on: " . $hostnamestring[0] . " " . $os . " " . $hostnamestring[-2] . " "; +} + + +my $mappingstring = ""; +#no mappingstring for 1.6. Put it back for 1.8. +#$cmd = "grep \"Default API Mapping:\" $indirectory/lib/libhdf5.settings"; +#$_ = `$cmd`; +#s/Default API Mapping://; +#s/^\s+//; +#chomp; +#if (/v\d+/) { +# s/v//; +# s/(\d)(\d)/$1\.$2/g; +# $mappingstring = "using the default\nAPI mapping for VERSION ".$_."."; +# +#} +print OUTFILE $versionstring; +print OUTFILE $platformstring."\n\n"; +#print OUTFILE $mappingstring; + +#if ($hostname eq "loyalty.hdfgroup.uiuc.edu" || $hostname eq "freedom.hdfgroup.uiuc.edu") { +# print OUTFILE " It includes the C APIs,\nbuilt using the following "; +# print OUTFILE "compilers:\n\n"; +#} +#else { +print OUTFILE "\n\nIt includes the C, C++, and F90 APIs, built using the following\n"; +print OUTFILE "compilers:\n\n"; +#} + +# Only the gcc compiler version is in libhdf5.settings, so for now I looked +# up the versions and hardcoded them here. We will put them in libhdf5.settings +# for the next release. +if ($indirectory =~ /gnu482/) { + print OUTFILE "\tgcc, g++, and gfortran 4.8.2\n\n"; +} elsif ($hostname =~ /jam/ || $hostname =~ /koala/) { + print OUTFILE "\tgcc, g++, and gfortran 4.1.2\n\n"; +} elsif ($hostname =~ /platypus/) { + print OUTFILE "\tgcc, g++, and gfortran 4.4.7\n\n"; +} elsif ($hostname =~ /emu/) { + print OUTFILE "\tSun C and C++ 5.12, Sun Fortran 95 8.6\n\n"; +} elsif ($hostname =~ /loyalty/ || $hostname =~ /freedom/) { + print OUTFILE "\tgcc, g++, and gfortran 4.6.1\n\n"; +} elsif ($hostname =~ /duck/) { + print OUTFILE "\tApple clang/clang++ 3.0 from Xcode 4.6.1 and gfortran 4.8.2\n\n"; +} elsif ($hostname =~ /kite/) { + print OUTFILE "\tApple clang/clang++ 5.1 from Xcode 5.0.2 and gfortran 4.8.2\n\n"; +} elsif ($hostname =~ /quail/) { + print OUTFILE "\tgcc, g++ 5.1 from Xcode 5.1 and gfortran 4.8.2\n\n"; +} + +print OUTFILE $section2; + +print OUTFILE $section3; + +print OUTFILE $section4; + diff --git a/bin/makeOuter1814README.pl b/bin/makeOuter1814README.pl new file mode 100755 index 0000000..6218ecc --- /dev/null +++ b/bin/makeOuter1814README.pl @@ -0,0 +1,173 @@ +#!/usr/bin/perl +# makeOuterREADME.pl +use warnings; +use strict; + +my $indirectory = "."; +$indirectory = shift; + +my $outdirectory = "."; +$outdirectory = shift; + +my $outsubdir = shift; + +my $version; + +my $outfile = "$outdirectory/$outsubdir/README"; +open OUTFILE, ">$outfile"; +my $hostname=""; +my $cmd = "grep \"HDF5 Version\" $indirectory-static/lib/libhdf5.settings"; +$_ = `$cmd`; +#print OUTFILE $_, "\n"; +s/HDF5 Version://; +s/^\s+//; +chomp; +$version = $_; +#print OUTFILE $_, "\n"; +my $versionstring= "This directory contains the precompiled HDF5 $version binary distribution\n(include files, libraries, utilities) for"; + +$cmd = "grep \"Uname information:\" $indirectory-static/lib/libhdf5.settings"; +$_ = `$cmd`; +s/Uname information://; +s/^\s+//; +chomp; +print "String to work with is $_\n"; +my $platformstring = ""; +my $hostnamestring = $_; +my @hostnamestring = split / /, $hostnamestring; +$platformstring = "$hostnamestring[0] "; +if ($indirectory =~ /jam/ || $indirectory =~ /koala/) { + $hostnamestring = $hostnamestring[2]; + my $pos = index $hostnamestring, "-"; + if ($pos > 0) { + $platformstring .= substr $hostnamestring, 0, $pos; + } else { + $platformstring .= $hostnamestring[2]; + } + $platformstring .= " ".$hostnamestring[-3]; +} elsif ($indirectory =~ /linew/) { + $platformstring .= "$hostnamestring[2] $hostnamestring[-2]"; +} else { + $platformstring .= "$hostnamestring[2] $hostnamestring[-1]"; +} + +print OUTFILE $versionstring." ".$platformstring.":\n\n"; +my $line1; +my $line3; +my $line5; +my $compilerstring=""; + +print $indirectory, "\n"; + +if ($indirectory =~ /loyalty/) { +# $line1 = " 5-$version-$outsubdir-16API.tar.gz - Includes C and C++ APIs (using\n"; + $line3 = " 5-$version-$outsubdir-static.tar.gz - Includes C APIs (using\n"; + $line5 = " 5-$version-$outsubdir-shared.tar.gz - Includes C APIs (using\n"; + $compilerstring = " gcc, g++, and gfortran 4.6.1)\n"; +} +elsif ($indirectory =~ /freedom/) { +# $line1 = " 5-$version-$outsubdir-16API.tar.gz - Includes C and C++ APIs (using\n"; + $line3 = " 5-$version-$outsubdir-static.tar.gz - Includes C APIs (using\n"; + $line5 = " 5-$version-$outsubdir-shared.tar.gz - Includes C APIs (using\n"; + $compilerstring = " gcc, g++, and gfortran 4.6.1)\n"; +} +elsif ($indirectory =~ /ostrich/) { +# $line1 = " 5-$version-$outsubdir-16API.tar.gz - Includes C, C++, F90 APIs (using\n"; + $line3 = " 5-$version-$outsubdir-static.tar.gz - Includes C, C++, F90 APIs (using\n"; + $line5 = " 5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 APIs (using\n"; + $compilerstring = " gcc, g++, and gfortran 4.4.7)\n"; +} +elsif ($indirectory =~ /platypus/) { +# $line1 = " 5-$version-$outsubdir-16API.tar.gz - Includes C, C++, F90 APIs (using\n"; + $line3 = " 5-$version-$outsubdir-static.tar.gz - Includes C, C++, F90 APIs (using\n"; + $line5 = " 5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 APIs (using\n"; + $compilerstring = " gcc, g++, and gfortran 4.4.7)\n"; +} +elsif ($indirectory =~ /jam/) { +# $line1 = " 5-$version-$outsubdir-16API.tar.gz - Includes C, C++, F90 APIs (using\n"; + $line3 = " 5-$version-$outsubdir-static.tar.gz - Includes C, C++, F90 APIs (using\n"; + $line5 = " 5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 APIs (using\n"; + if ($indirectory =~ /gnu482/) { + $compilerstring = " gcc, g++, and gfortran 4.8.2)\n"; + } else { + $compilerstring = " gcc, g++, and gfortran 4.1.2)\n"; + } +} +elsif ($indirectory =~ /koala/) { +# $line1 = " 5-$version-$outsubdir-16API.tar.gz - Includes C, C++, F90 APIs (using\n"; + $line3 = " 5-$version-$outsubdir-static.tar.gz - Includes C, C++, F90 APIs (using\n"; + $line5 = " 5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 APIs (using\n"; + if ($indirectory =~ /gnu482/) { + $compilerstring = " gcc, g++, and gfortran 4.8.2)\n"; + } else { + $compilerstring = " gcc, g++, and gfortran 4.1.2)\n"; + } +} +elsif ($indirectory =~ /emu/) { +# $line1 = " 5-$version-$outsubdir-16API.tar.gz - Includes C, C++, F90 APIs (using\n"; + $line3 = " 5-$version-$outsubdir-static.tar.gz - Includes C, C++, F90 APIs (using\n"; + $line5 = " 5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 APIs (using\n"; + $compilerstring = " Sun C and C++ 5.12, Sun Fortran 95 8.6)\n"; +} +elsif ($indirectory =~ /duck/) { + $line3 = " 5-$version-$outsubdir-static.tar.gz - Includes C, C++, F90 APIs (using\n"; + $line5 = " 5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 APIs (using\n"; + $compilerstring = " Apple clang/clang++ 3.0 from Xcode 4.6.1, + gfortran 4.6.2)\n"; +} +elsif ($indirectory =~ /kite/) { + $line3 = " 5-$version-$outsubdir-static.tar.gz - Includes C, C++, F90 APIs (using\n"; + $line5 = " 5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 APIs (using\n"; + $compilerstring = " Apple clang/clang++ 5.0 from Xcode 5.0.2, + gfortran 4.8.2)\n"; +} +elsif ($indirectory =~ /quail/) { + $line3 = " 5-$version-$outsubdir-static.tar.gz - Includes C, C++, F90 APIs (using\n"; + $line5 = " 5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 APIs (using\n"; + $compilerstring = " Apple clang/clang++ 5.1 from Xcode 5.1, + gfortran 4.8.2)\n"; +} + + print OUTFILE $line3; + print OUTFILE $compilerstring."\n"; +if ($line5 ne "") { + print OUTFILE $line5; + print OUTFILE $compilerstring."\n"; +} +#elsif ($indirectory =~ /-16API/) { +# print OUTFILE $line1; +# print OUTFILE $compilerstring; +# print OUTFILE " USES THE VERSION 1.6 DEFAULT API\n"; +# print OUTFILE " MAPPING.\n\n"; +#} + +print OUTFILE " utilities/ - Directory containing the compiled HDF5 utilities.\n"; +print OUTFILE " These utilities are STATICALLY linked and will run as is.\n\n"; +#print OUTFILE " The tools can be downloaded separately, or ALL in one\n"; +#print OUTFILE " compressed file (5-$version-$outsubdir-static-util.tar.gz).\n\n"; +print OUTFILE "\n"; +print OUTFILE "To obtain the HDF5 distribution, 'unzip' and 'untar' the distribution\n"; +print OUTFILE "file:\n\n"; +print OUTFILE " gzip -cd | tar xvf -\n"; + + +#$cmd = "grep \"Configured by:\" $indirectory/$key-static/lib/libhdf5.settings"; +#$_ = `$cmd`; +#s/Configured by://; +#s/^\s+//; +#print OUTFILE $_; +#chomp; +#my $hostnamestring = $_; +#s/(^\w+)(\s)(\S+)/$1/; +#s/(^.*)(-)(.*)(200[7-8])(.*)(\s)(\S+)/$1 $5/; +#my $platformstring = $_ . ":\n\n"; +#my @hostnamestring = split /@/, $hostnamestring; +#print "Size of hostnamestring is ", scalar @hostnamestring, "\n"; +#print $hostnamestring[0] . "\t" . $hostnamestring[2]."\t".$hostnamestring[19]."\n"; +#my $platformstring = $hostnamestring[1].":\n\n"; +#$hostnamestring = $hostnamestring[1]; +#my $pos = index $hostnamestring, "."; +#if ($pos > 0) { +# @hostnamestring = split /\./, $hostnamestring; +# $platformstring = $hostnamestring[0].":\n\n"; +#} diff --git a/bin/testh51814binary.sh b/bin/testh51814binary.sh new file mode 100644 index 0000000..531ef8f --- /dev/null +++ b/bin/testh51814binary.sh @@ -0,0 +1,688 @@ +#! /bin/sh + +FORTRAN=yes +ARG=$1 +if [ -n "${ARG}" ] && [ "${ARG}" = "-nofortran" ]; then + FORTRAN=no +fi + +echo "Fortran: ${FORTRAN}" + +THIS_DIR=`pwd` + +THIS_TEST_RESULT=0 +TEST_RESULT=0 +FILE_LIST=`ls` +RESULTSLOG="" +SUMMARYLOG="" +EXAMPLE1LOG="" +EXAMPLE2LOG="" +FAILED_TEST_LOGS="" + +# step 0: Check presence of top-level README file +STEP0RESULT=0 +README_FILE="" +README_FILE=`ls README` + +echo "Check for presence of top-level README file" +if test -z "$README_FILE"; then + echo "Missing Outer README file." + STEP0RESULT=1 +else + echo "Present" +fi + +for f in $FILE_LIST ; do + #be sure to start in the "top level" directory + cd $THIS_DIR + IS_TARFILE="" + UTILTEST="" + THIS_TEST_RESULT=0 + + IS_TARFILE=`ls $f | grep tar.gz` + + if [ "$f" = "utilities" ]; then + UTILTEST="yes" + cd utilities + RESULTSLOG=$THIS_DIR/utilities_Results.log + SUMMARYLOG=$THIS_DIR/utilities_Summary + echo " SUMMARY" > $SUMMARYLOG + echo "" + echo "Testing $f" + echo "" + elif [ -n "$IS_TARFILE" ] ; then + UTILTEST="" + EXTRACTED=`echo $f | sed 's/\.tar\.gz//'` + STORSH=`echo $EXTRACTED | awk -F- '{ print $NF }'` + + if [ "$STORSH" = "shared" ]; then + SHAREDLIBS=yes + else + SHAREDLIBS="" + fi + echo "" + echo "Testing $f" + + echo + echo "Unpack and install $f." + echo + EXTRACTLOG=extract_$f.log + RESULTSLOG=$THIS_DIR/${STORSH}_Results.log + SUMMARYLOG=$THIS_DIR/${STORSH}_Summary + EXAMPLE1LOG=$THIS_DIR/${STORSH}_hdf5-examples.log + EXAMPLE2LOG=$THIS_DIR/${STORSH}_share_examples.log + echo " SUMMARY" > $SUMMARYLOG + + + # Step 1: unpack binary and run h5redeploy + # Extraction not needed when testing the utilities directory ($UTILTEST = "yes") + echo "Executing step 1: Extracting $f" + tar zxvf $f > $EXTRACTLOG + cd $EXTRACTED/bin + # Check for internal README file in $EXTRACTED + echo "Check for presence of top-level README file" + STEP1RESULT=0 + README_FILE="" + README_FILE=`ls ../README` + + if test -z "$README_FILE"; then + echo "Missing Internal README file." + STEP1RESULT=1 + else + echo "Present" + fi + + else + continue + fi + + ./h5redeploy -force > ${RESULTSLOG} + + # Steps 2 & 3 don't apply for testing the utilities directory ($UTILTEST = "yes") + if [ -z "$UTILTEST" ]; then + # For testing tar files, go back up to the test directory + cd $THIS_DIR + + # Step 2 + STEP2RESULT=0 + echo "Executing step 2: Check and verify contents of the lib/libhdf5.settings file." + + # 2.1 Check Platform + # The platform information won't match exactly and is somewhat irregular. We + # can write a script with awk and sed to match enough information to determine + # a match, but it will take some thought and research to determine which parts + # to check. For now, present the output of "uname -a" and the "Uname information" + # line from libhdf5.settings and let the developer decide. + + MACH_UNAME=`uname -a` + BIN_UNAME=`grep "Uname information" $EXTRACTED/lib/libhdf5.settings | sed 's/\s*Uname information://'` + + IS_SOLARIS=`echo $BIN_UNAME | grep SunOS` + IS_PPC64=`echo$BIN_UNAME | grep ppc64` + IS_MAC=`echo $BIN_UNAME | grep Darwin` +# if [ -n "$IS_MAC" ]; then +# IS_MAC32=`echo $BIN_UNAME | grep tejeda` +# IS_MAC64=`echo $BIN_UNAME | grep fred` +# fi + # at present we only need to know if the binary is for mac or not, so if + +# echo "The output of \"uname -a\" for this machine is:" +# echo "" +# echo " $MACH_UNAME" +# echo "" +# echo "The \"Uname information\" line from the libhdf5.settings in this binary is:" +# echo "" +# echo " $BIN_UNAME" +# echo "" + + # Probably we won't ask, just print the results in the summary + #echo "Is this the correct binary to install on this machine? (yes/no - yes to continue, no to exit)" + #read CORRECT + #if [ "$CORRECT" = "yes" ]; then + # echo "Continuing with binary tests." + #else + # echo "Exiting - Try downloading another binary for this machine." + #fi + + # 2.2 Check compiler versions in libhdf5.settings against RELEASE.txt + # Need to compare both files in detail to find unique string to compare +# grep -A 70 "^Platforms Tested$" $EXTRACTED/RELEASE.txt +# echo "" +# echo "We need to check that the compilers listed in" +# echo "$EXTRACTED/lib/libhdf5.settings are also listed" +# echo "in the \"Platforms Tested\" section of $EXTRACTED/RELEASE.txt, displayed above." +# echo "Please find the compiler version information for the following compilers" +# echo "and for this platform, $BIN_UNAME, in the \"Platforms Tested\" section (printed above)" +# echo "and enter it below." +# echo "" +# echo "For multiple lines copy a line at a time separated by a space." +# echo "" +# echo "If the compiler cannot in the \"Platforms Tested\" section above please check the RELEASE.txt file." +# echo "If no match is found there, please enter \"NO MATCH\"" +# + C_COMPILER=`grep "C Compiler:" $EXTRACTED/lib/libhdf5.settings | sed 's/\s*//'` + F_COMPILER=`grep "Fortran Compiler:" $EXTRACTED/lib/libhdf5.settings | sed 's/\s*//'` + CXX_COMPILER=`grep "C++ Compiler:" $EXTRACTED/lib/libhdf5.settings | sed 's/\s*//'` +# echo "" +# echo $C_COMPILER +# echo "" +# echo $F_COMPILER +# echo "" +# echo $CXX_COMPILER +# echo "" +# echo "Enter info from RELEASE.txt for C Compiler:" +# read C_COMP_INFO +# echo "Enter info for Fortran Compiler:" +# read F_COMP_INFO +# echo "Enter info for C++ Compiler:" +# read CXX_COMP_INFO + + # 2.3 Check libhdf5.settings for Shared and Static (Static Executables?) + STATIC=`grep Static $EXTRACTED/lib/libhdf5.settings | grep Library | grep yes` + RETVAL=$? + if [ "$RETVAL" = "0" ]; then + #echo "Static Libraries PASSED." + echo "Static Libraries PASSED." >> $RESULTSLOG + + else + #echo "No static libraries: FAILED." + STEP2RESULT=1 + echo "No static libraries: FAILED." >> $RESULTSLOG + fi + + if [ -n "$SHAREDLIBS" ]; then + SHARED=`grep Shared $EXTRACTED/lib/libhdf5.settings | grep Library | grep yes` + RETVAL=$? + if [ "$RETVAL" = "0" ]; then + # echo "Shared Libraries present: PASSED." + # echo $SHARED + echo "Shared Libraries present: PASSED." >> $RESULTSLOG + else + # echo "Shared libraries are missing: FAILED." + STEP2RESULT=1 + echo "Shared libraries are missing: FAILED." >> $RESULTSLOG + fi + fi + + #2.4 Check for Fortran support + SUPPORT=`grep "Fortran: yes" $EXTRACTED/lib/libhdf5.settings` + RETVAL=$? + if [ "$RETVAL" = "0" ]; then + # echo "Fortran supported: PASSED" + echo "Fortran supported: PASSED" >> $RESULTSLOG + else + # echo "Fortran not supported: FAILED" + STEP2RESULT=1 + echo "Fortran not supported: FAILED" >> $RESULTSLOG + fi + + #2.5 Check for C++ support + SUPPORT=`grep "C++: yes" $EXTRACTED/lib/libhdf5.settings` + if [ "$RETVAL" = "0" ]; then + # echo "C++ supported: PASSED" + echo "C++ supported: PASSED" >> $RESULTSLOG + else + # echo "C++ not supported: FAILED" + STEP2RESULT=1 + echo "C++ not supported: FAILED" >> $RESULTSLOG + fi + + #2.6 Check that zlib and szip are enabled + SUPPORT=`grep "I/O filters (external): " $EXTRACTED/lib/libhdf5.settings | grep "deflate(zlib)"` + if [ "$RETVAL" = "0" ]; then + echo "zlib supported: PASSED" >> $RESULTSLOG + else + STEP2RESULT=1 + echo "zlib not supported: FAILED" >> $RESULTSLOG + fi + SUPPORT=`grep "I/O filters (external): " $EXTRACTED/lib/libhdf5.settings | grep "szip(encoder)"` + if [ "$RETVAL" = "0" ]; then + # echo "szip with encoder supported: PASSED" + echo "szip with encoder supported: PASSED" >> $RESULTSLOG + else + # echo "szip with encoder not supported: FAILED" + STEP2RESULT=1 + echo "szip with encoder not supported: FAILED" >> $RESULTSLOG + fi + + #2.7 Check for Compilation Mode = production + PRODUCTION=`grep "Compilation Mode: production" $EXTRACTED/lib/libhdf5.settings` + if [ "$RETVAL" = "0" ]; then + #echo "Compilation Mode is production: PASSED" + echo "Compilation Mode is production: PASSED" >> $RESULTSLOG + else + #echo "Compilation Mode is development: FAILED" + STEP2RESULT=1 + echo "Compilation Mode is development: FAILED" >> $RESULTSLOG + fi + + #2.8 Check for optimization flag + OPTIMIZED=`grep -i FLAGS $EXTRACTED/lib/libhdf5.settings | grep "\-O"` + if [ "$RETVAL" = "0" ]; then + # echo "Optimization is on: PASSED" + echo "Optimization is on: PASSED" >> $RESULTSLOG + else + # echo "No optimization found in FLAGS: FAILED" + STEP2RESULT=1 + echo "No optimization found in FLAGS: FAILED" >> $RESULTSLOG + fi + + #2.9 Check for no "-g" flags + DEBUG=`grep -i FLAGS $EXTRACTED/lib/libhdf5.settings | grep " \-g "` + RETVAL=$? + if [ "$RETVAL" = "0" ]; then + #echo "-g flag is present: $DEBUG FAILED" + echo "-g flag is present: $DEBUG FAILED" >> $RESULTSLOG + else + #echo "-g flag is not present: PASSED" + echo "-g flag is not present: PASSED" >> $RESULTSLOG + fi + + if [ "$STEP2RESULT" = "0" ]; then + echo "PASSED" + echo "Step 2 PASSED" >> $SUMMARYLOG + else + echo "**** FAILED" + echo "**** Step 2 FAILED ****" >> $RESULTSLOG + echo "**** Step 2 FAILED ****" >> $SUMMARYLOG + fi + + # Step 3 + echo "Executing step 3: Check and verify included libraries." + STEP3RESULT=0 + + RETVAL=0 + THIS_DIR=`pwd` + cd $EXTRACTED/lib + STATIC_LIBFILES="libhdf5.a libhdf5_cpp.a libhdf5_fortran.a libhdf5_hl.a libhdf5_hl_cpp.a libhdf5hl_fortran.a libhdf5_cpp.a" + for s in $STATIC_LIBFILES ; do + if test -f $s; then + echo "found $s" >> $RESULTSLOG + else + echo "$s not found." >> $RESULTSLOG + RETVAL=1 + fi + done + if [ -n "$IS_MAC" ]; then + # Currently no shared libraries for Fortran are produced on the mac-intel machines + SHARED_LIBFILES="libhdf5_cpp.9.dylib libhdf5_hl_cpp.9.dylib libhdf5_hl.9.dylib libhdf5.9.dylib libsz.a" + elif [ -n "$IS_PPC64" ]; then + SHARED_LIBFILES="libhdf5_cpp.so.9.0.0 libhdf5_fortran.so.9.0.0 libhdf5_hl_cpp.so.9.0.0 libhdf5hl_fortran.so.9.0.0 libhdf5_hl.so.9.0.0 libhdf5.so.9.0.0" + else + SHARED_LIBFILES="libhdf5_cpp.so.9.0.0 libhdf5_fortran.so.9.0.0 libhdf5_hl_cpp.so.9.0.0 libhdf5hl_fortran.so.9.0.0 libhdf5_hl.so.9.0.0 libhdf5.so.9.0.0 libsz.so.2.0.0 libz.so.1.2.5" + fi + if [ -n "${SHAREDLIBS}" ]; then + for s in $SHARED_LIBFILES ; do + if test -f $s; then + echo "found $s" >> $RESULTSLOG + else + echo "$s not found." >> $RESULTSLOG + RETVAL=1 + fi + done + if [ "$RETVAL" = "0" ]; then + #echo "All shared and static library files are included: PASSED" + echo "All shared and static library files are included: PASSED" >> $RESULTSLOG + else + #echo "Expected library files are missing: FAILED" + STEP3RESULT=1 + echo "Expected library files are missing: FAILED" >> $RESULTSLOG + fi + else + EXTLIBS="libsz.a libz.a" + for l in $EXTLIBS ; do + if test -f $l; then + echo "found $l" >> $RESULTSLOG + else + echo "$l not found." >> $RESULTSLOG + RETVAL=1 + fi + done + if [ "$RETVAL" = "0" ]; then + # check to see if any shared library files are in the directory + # 'ls' returns 0 if it finds a match, non-zero if no match is found. + ls *.so* >& /dev/null + RETVAL=$? + if [ "$RETVAL" = "0" ]; then + #echo "Unexpected shared library files are present: FAILED" + STEP3RESULT=1 + echo "Unexpected shared library files are present: FAILED" >> $RESULTSLOG + else + #echo "Static library files are included and no shared libraries are present: PASSED" + echo "Static library files are included and no shared libraries are present: PASSED" >> $RESULTSLOG + fi + else + #echo "Expected library files are missing: FAILED" + STEP3RESULT=1 + echo "Expected library files are missing: FAILED" >> $RESULTSLOG + fi + fi + if [ "$STEP3RESULT" = "0" ]; then + echo "PASSED" + echo "Step 3 PASSED" >> $SUMMARYLOG + else + echo "**** FAILED ****" + echo "**** Step 3 FAILED ****" >> $RESULTSLOG + echo "**** Step 3 FAILED ****" >> $SUMMARYLOG + fi + # change to the $EXTRACTED/bin directory. + # For utilities testing we should already be in the utilities directory + cd ../bin + fi + + # Step 4 + echo "Executing step 4: Verify binary platform type." + STEP4RESULT=0 + + # This step is included to check that the binaries built with --enable-static-exec + # aren't dynamically linked to any libraries. --enable-static-exec doesn't work on + # solaris, and our macs and ppc64 only have dynamic zlib libraries, so we skip this step for + # those machines. + if [ -z "$IS_SOLARIS" ] && [ -z "$IS_MAC" ] && [ -z "$IS_PPC64" ]; then + RETVAL=0 + EXEC_BINFILES="gif2h5 h52gif h5copy h5debug h5diff h5dump h5import h5jam h5ls h5mkgrp h5perf_serial h5repack h5repart h5stat h5unjam" + for e in $EXEC_BINFILES ; do + if [ -n "$IS_MAC" ]; then + OUTPUT=`otool -L $e` + else + OUTPUT=`ldd $e` + fi + match_number=`expr "$OUTPUT" : '\s*not a dynamic executable'` + + if [ "$match_number" = "25" ]; then + #echo "$e $OUTPUT PASSED" + echo "$e $OUTPUT PASSED" >> $RESULTSLOG + else + #echo "$e $OUTPUT Please report whether this output is acceptable" + STEP4RESULT=1 + echo "$e $OUTPUT Please report whether this output is acceptable" >> $RESULTSLOG + fi + done + if [ "$STEP4RESULT" = "0" ]; then + #echo "Executable files ran successfully on this platform" + echo "PASSED" + echo "Step 4 PASSED" >> $SUMMARYLOG + else + #echo "Not all executable files ran successfully on this platform" + echo "**** FAILED ****" + echo "**** Step 4 FAILED ****" >> $RESULTSLOG + echo "**** Step 4 FAILED. See $RESULTSLOG for details ****" >> $SUMMARYLOG + fi + fi + + if [ -z "$UTILTEST" ]; then + # Step 5 + echo "Executing step 5: Compile and test examples in hdf5-examples repository with the tar file's h5cc, h5fc and h5c++." + + #return to the top level test directory (the starting directory) + cd $THIS_DIR + STEP5RESULT=0 + + # For the macs, we need DYLD_LIBRARY_PATH set to the lib directory of the hdf5 to be tested. + if [ -n "${IS_MAC}" ] && [ "${SHAREDLIBS}" = "yes" ]; then + DYLD_LIBRARY_PATH=$THIS_DIR/$EXTRACTED/lib + export DYLD_LIBRARY_PATH + fi + + if test -d hdf5-examples ; then + rm -rf hdf5-examples + fi + svn co https://svn.hdfgroup.uiuc.edu/hdf5-examples/trunk/ hdf5-examples > checkout.log + CC=$THIS_DIR/$EXTRACTED/bin/h5cc + export CC + FC=$THIS_DIR/$EXTRACTED/bin/h5fc + export FC + # hdf5-examples/1_8/FORTRAN fails with -O2 or higher + if [ -n "$IS_MAC" ]; then + FCFLAGS=-O1 + export FCFLAGS + fi + CXX=$THIS_DIR/$EXTRACTED/bin/h5c++ + export CXX + H5EX_16=yes + export H5EX_16 + H5EX_18=yes + export H5EX_18 + cd hdf5-examples + ./configure > ${EXAMPLE1LOG} + if [ "${FORTRAN}" = "yes" ]; then + make check > ${EXAMPLE1LOG} + else + cd 1_6 + make check > ${EXAMPLE1LOG} + cd ../1_8/C + make check >> ${EXAMPLE1LOG} + cd ../.. + fi + RETVAL=`echo $?` + NUMFAILED=`grep -c FAILED ${EXAMPLE1LOG}` + NUMFAILED0=`grep -c "# FAIL: 0" ${EXAMPLE1LOG}` + NUMPASSED=`grep -c "# PASS: 1" ${EXAMPLE1LOG}` + NUMTOTAL=`grep -c "# TOTAL: 1" ${EXAMPLE1LOG}` + NUMERR=`grep -i error ${EXAMPLE1LOG} | grep -v "# ERROR: 0" | grep -ic error` + NUMERR0=`grep -c "# ERROR: 0" ${EXAMPLE1LOG}` +# NUMPASSREQ=120 +# if [ "${FORTRAN}" = "no" ]; then +# NUMPASSREQ=102 +# fi + + if test "$RETVAL" = "0" -a "$NUMFAILED" = "0" ; then + if test "$NUMERR" = "0" -a "$NUMPASSED" = "$NUMTOTAL" -a "$NUMERR0" = "$NUMTOTAL" -a "$NUMFAILED0" = "$NUMTOTAL" ; then + echo "PASSED" + echo "Step 5 PASSED: $NUMPASSED tests passed in hdf5-examples with no failures or errors" >> ${RESULTSLOG} + echo "Step 5 PASSED: $NUMPASSED tests passed in hdf5-examples with no failures or errors" >> ${SUMMARYLOG} + else + STEP5RESULT=1 + if test $NUMERR -gt 0 -o $NUMFAILED -gt 0 ; then + echo "**** FAILED ****" + echo "**** Step 5 FAILED: Some examples failed. There were $NUMERR errors. See details in ${EXAMPLE1LOG} ****" >> ${RESULTSLOG} + echo "**** Step 5 FAILED: Some examples failed. There were $NUMERR errors. See details in ${EXAMPLE1LOG} ****" >> ${SUMMARYLOG} + else + echo "**** Step 5 FAILED: $NUMPASSED examples passed; there should have been at least $NUMTOTAL. See details in ${EXAMPLE1LOG} ****" >> ${RESULTSLOG} + echo "**** Step 5 FAILED: $NUMPASSED examples passed; there should have been at least $NUMTOTAL. See details in ${EXAMPLE1LOG} ****" >> ${SUMMARYLOG} + fi + fi + else + STEP5RESULT=1 + echo "**** FAILED ****" + echo "**** Step 5 FAILED: Some examples failed. There were $NUMERR errors. See details in ${EXAMPLE1LOG} ****" >> ${RESULTSLOG} + echo "**** Step 5 FAILED: Some examples failed. There were $NUMERR errors. See details in ${EXAMPLE1LOG} ****" >> ${SUMMARYLOG} + fi + + cd $THIS_DIR + + # Step 6 NA for utilities + + # Step 6 + echo "Executing step 6: Use run-all-ex.sh to compile and run installed examples." + STEP6RESULT=0 + + cd $EXTRACTED/share/hdf5_examples + if [ "${FORTRAN}" = "no" ]; then + echo "Run c examples" + if ((cd c; sh ./run-c-ex.sh) && \ + (if test -d c++; then + echo "Run c++ examples" + cd c++; sh ./run-c++-ex.sh + fi) && \ + (if test -d hl; then + echo "Run hl examples." + cd hl && \ + (cd c; sh ./run-hlc-ex.sh) && \ + (if test -d c++; then + echo "Run hl c++ examples" + cd c++; sh ./run-hlc++-ex.sh + fi) + fi)) > $EXAMPLE2LOG; then + echo "Done" + RETVAL=0 + else + RETVAL=1 + fi + else + sh ./run-all-ex.sh > $EXAMPLE2LOG + RETVAL=$? + fi + + + if [ "$RETVAL" = "0" ]; then + echo "PASSED" + echo "Step 6 PASSED: The examples in .../share/hdf5_examples were successfully compiled and ran without errors." >> ${RESULTSLOG} + echo "Step 6 PASSED: The examples in .../share/hdf5_examples were successfully compiled and ran without errors." >> ${SUMMARYLOG} + else + echo "**** FAILED ****" + STEP6RESULT=1 + "**** Step 6 FAILED: The examples in .../share/hdf5_examples failed to compile or run. See details in $EXAMPLE2LOG ****" >> ${RESULTSLOG} + "**** Step 6 FAILED: The examples in .../share/hdf5_examples failed to compile or run. See details in $EXAMPLE2LOG ****" >> ${SUMMARYLOG} + fi + fi + + + # Step 7 + echo "Executing step 7: Run command -V with executables to be sure that they will run." + + STEP7PASS=0 + STEP7FAIL=0 + STEP7RESULT=0 + # h5debug and h5perf_serial don't return 0 with -V, so they aren't in this list. -h would be another + # option, but even more bin files don't return 0. h5redeploy is tested as part of install, and doesn't + # support -V. + EXEC_BINFILES="gif2h5 h52gif h5copy h5diff h5dump h5import h5jam h5ls h5mkgrp h5repack h5repart h5stat h5unjam" + for e in $EXEC_BINFILES ; do + OUTPUT=`$THIS_DIR/$EXTRACTED/bin/$e -V` + RETVAL=$? + + if [ "$RETVAL" = "0" ]; then + echo "$e $OUTPUT PASSED" >> $RESULTSLOG + STEP7PASS=`expr $STEP7PASS + 1` + else + echo "$e $OUTPUT FAILED" >> $RESULTSLOG + STEP7FAIL=`expr $STEP7FAIL + 1` + fi + done + if [ $STEP7PASS -gt 12 ] && [ $STEP7FAIL -eq 0 ]; then + echo "PASSED" + echo "Step 7 PASSED: $STEP7PASS executable files in bin ran with -V on this machine." >> $SUMMARYLOG + else + STEP7RESULT=1 + echo "**** FAILED ****" + echo "**** Step 7 FAILED: $STEP7FAIL executable files in bin failed to run with -V on this machine. ****" >> $RESULTSLOG + echo "**** Step 7 FAILED: $STEP7FAIL executable files in bin failed to run with -V on this machine. ****" >> $SUMMARYLOG + fi + +# echo "" +# echo "SUMMARY:" +# echo "" +# echo "Uname information:" +# echo " Machine: $MACH_UNAME" +# echo " Binary: $BIN_UNAME" +# echo "" + + +# if [ "$C_COMP_INFO" = "NO MATCH" ]; then +# echo "$C_COMPILER not found in RELEASE.txt" +# else +# echo "C Compiler: $C_COMPILER - $C_COMP_INFO" +# fi +# if [ "$F_COMP_INFO" = "NO MATCH" ]; then +# echo "$F_COMPILER not found in RELEASE.txt" +# else +# echo "Fortran Compiler: $F_COMPILER - $F_COMP_INFO" +# fi +# if [ "$CXX_COMP_INFO" = "NO MATCH" ]; then +# echo "$CXX_COMPILER not found in RELEASE.txt" +# else +# echo "C++ Compiler: $CXX_COMPILER - $CXX_COMP_INFO" +# fi +# echo "" + + + + + if [ "$STEP0RESULT" != "0" ]; then + THIS_TEST_RESULT=1 + echo "Step 0 failed" + STEP0RESULT=0 + fi + + if [ "$STEP1RESULT" != "0" ]; then + THIS_TEST_RESULT=1 + echo "Step 1 failed" + STEP1RESULT=0 + fi + + if [ "$STEP2RESULT" != "0" ]; then + THIS_TEST_RESULT=1 + echo "Step 2 failed" + STEP2RESULT=0 + fi + + if [ "$STEP3RESULT" != "0" ]; then + THIS_TEST_RESULT=1 + echo "Step 3 failed" + STEP3RESULT=0 + fi + + if [ "$STEP4RESULT" != "0" ]; then + THIS_TEST_RESULT=1 + echo "Step 4 failed" + STEP4RESULT=0 + fi + + if [ "$STEP5RESULT" != "0" ]; then + THIS_TEST_RESULT=1 + echo "Step 5 failed" + STEP5RESULT=0 + fi + + if [ "$STEP6RESULT" != "0" ]; then + THIS_TEST_RESULT=1 + echo "Step 6 failed" + STEP6RESULT=0 + fi + + if [ "$STEP7RESULT" != "0" ]; then + THIS_TEST_RESULT=1 + echo "Step 7 failed" + STEP7RESULT=0 + fi + + echo "Done testing $f" + + if [ "$THIS_TEST_RESULT" != "0" ]; then + TEST_RESULT=1 + FAILED_TEST_LOGS="$FAILED_TEST_LOGS $RESULTSLOG" + fi + +done + + +echo "" +if [ "$TEST_RESULT" = "0" ]; then + echo "**** FINAL RESULT: All tests PASSED ****" +else + echo "**** FINAL RESULT: TESTS FAILED! See FAILED details in $FAILED_TEST_LOGS ****" +fi + echo "" + echo "For this version we need to perform the two following checks manually. We hope that for future versions these can also be automated, and any suggestions for accomplishing that are most welcome." + echo "" + echo "The output of \"uname -a\" for this machine is:" + echo "" + echo " $MACH_UNAME" + echo "" + echo "The \"Uname information\" line from the libhdf5.settings in this binary is:" + echo "" + echo " $BIN_UNAME" + echo "" + echo "Please verify that the above information for this machine is compatible with that from the binary." + echo "" + echo $C_COMPILER + echo "" + echo $F_COMPILER + echo "" + echo $CXX_COMPILER + echo "" + echo "Please check that these compiler versions are listed for this platform in the \"Platforms Tested\" section of the binary's RELEASE.txt file." + +#cat $THIS_DIR/*Summary + -- cgit v0.12