From 9d17fc7424cce0c54d57fa7b5cfc23a96fbbc016 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 9 Jul 2003 14:28:34 -0500 Subject: [svn-r7195] Purpose: New tool. Description: A new tool to build the HDF5 library. This was historically the makeh5 command. Added here so that it can be used in machines outside of the HDF Groups. Having it in the source allows version specific customization. Platforms tested: Did run h5committest which failed due to other source code problems. Tested it by hand by ../hdf5/bin/buildhdf5 and passed as far as its own functionality. Misc. update: --- MANIFEST | 1 + bin/buildhdf5 | 315 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 316 insertions(+) create mode 100755 bin/buildhdf5 diff --git a/MANIFEST b/MANIFEST index b428cfb..80e1729 100644 --- a/MANIFEST +++ b/MANIFEST @@ -16,6 +16,7 @@ ./configure ./configure.in +./bin/buildhdf5 ./bin/checkapi _DO_NOT_DISTRIBUTE_ ./bin/checkposix _DO_NOT_DISTRIBUTE_ ./bin/chkmanifest diff --git a/bin/buildhdf5 b/bin/buildhdf5 new file mode 100755 index 0000000..4ceec6d --- /dev/null +++ b/bin/buildhdf5 @@ -0,0 +1,315 @@ +#!/bin/sh +# Build HDF5 library by doing configure, make, and tests. +# Usage: See USAGE() +# Programmer: Albert Cheng +# Creation date: Jul 9, 2003 + +# Some handy definitions +USAGE() +{ +cat <> "$resultfile" 2>&1 + if [ $? -ne 0 ]; then + echo "error in '$banner'. buildhdf5 aborted." + exit 1 + fi +} + + +# Try locate the HDF4 library +# This is a hack because there is no consistent place to find +# the valid HDF library. +LOCATE_HDF4() +{ + OS=`uname -s` + echo OS=$OS + case "$OS" in + HP-UX) + h4paths="/afs/ncsa/packages/hdf/HPUX_10.20" + ;; + IRIX) + h4paths="/afs/ncsa/packages/hdf/4.1r3_irix" + ;; + IRIX64) + case "$CC" in + *-n32) + h4paths="/afs/ncsa/packages/hdf/IRIX64-n32_6.5" + ;; + *) + h4paths="/afs/ncsa/packages/hdf/IRIX64_6.5" + ;; + esac + ;; + Linux) + h4paths="/afs/ncsa/packages/hdf/linux" + ;; + OSF1) + h4paths="/afs/ncsa/packages/hdf/OSF1_V4.0" + ;; + *) + h4paths="/usr/ncsa /usr/sdt" + ;; + esac + echo $h4paths + for h4 in $h4paths; do + if [ -f $h4/lib/libdf.a -a -f $h4/include/hdf.h ]; then + WITH_H4="--with-hdf4=$h4/include,$h4/lib" + break + fi + done + echo WITH_H4="$WITH_H4" +} + + +# Try locate the Fortran compiler +# This is a hack because there is no consistent fortran compiler name +LOCATE_FORTRAN() +{ + OS=`uname -s` + echo OS=$OS + case "$OS" in + IRIX64) + case "$CC" in + *-n32) + gasspaths=/usr/local/globus-install-1.1.1/development/mips-sgi-irix6.5-n32_nothreads_standard_debug + sslpaths=/usr/local/ssl-n32 + ;; + *) + gasspaths=/usr/local/globus-install-1.1.1/development/mips-sgi-irix6.5-64_nothreads_standard_debug + sslpaths=/usr/local/ssl + ;; + esac + ;; + *) + ;; + esac + echo gasspaths=$gasspaths + echo $sslpaths=$sslpaths + for x in $gasspaths dummy; do + if [ $x != dummy -a -f $x/lib/libglobus_gass_cache.a ]; then + WITH_GASS="--with-gass=$x/include,$x/lib" + break + fi + done + for x in $sslpaths dummy; do + if [ $x != dummy -a -f $x/lib/libssl.a ]; then + WITH_SSL="--with-ssl=$x/lib" + break + fi + done + + echo WITH_GASS="$WITH_GASS" + echo WITH_SSL="$WITH_SSL" + +} + + +# Try locate the GASS software library +# This is a hack because there is no consistent place to find +# the valid HDF library. +LOCATE_GASS() +{ + OS=`uname -s` + echo OS=$OS + case "$OS" in + IRIX64) + case "$CC" in + *-n32) + gasspaths=/usr/local/globus-install-1.1.1/development/mips-sgi-irix6.5-n32_nothreads_standard_debug + sslpaths=/usr/local/ssl-n32 + ;; + *) + gasspaths=/usr/local/globus-install-1.1.1/development/mips-sgi-irix6.5-64_nothreads_standard_debug + sslpaths=/usr/local/ssl + ;; + esac + ;; + *) + ;; + esac + echo gasspaths=$gasspaths + echo $sslpaths=$sslpaths + for x in $gasspaths dummy; do + if [ $x != dummy -a -f $x/lib/libglobus_gass_cache.a ]; then + WITH_GASS="--with-gass=$x/include,$x/lib" + break + fi + done + for x in $sslpaths dummy; do + if [ $x != dummy -a -f $x/lib/libssl.a ]; then + WITH_SSL="--with-ssl=$x/lib" + break + fi + done + + echo WITH_GASS="$WITH_GASS" + echo WITH_SSL="$WITH_SSL" + +} + + +# Configure. Default to do --srcdir. +CONFIG() +{ + INSTALLDIR=`pwd`/installdir + + test -d $INSTALLDIR || ( echo mkdir $INSTALLDIR; \ + test "$NOEXEC" != 'noexec' && mkdir $INSTALLDIR ) + CMD="$SRCDIR/configure --prefix=$INSTALLDIR $*" + echo $CMD + if [ "$NOEXEC" != 'noexec' ]; then + $CMD + else + true # set exit code as 0 + fi +} + +# Main body +TIMESTAMP +trap QUIT 0 + +# +# setup +# +MAKE=${MAKE:-'gmake'} +export MAKE +CONFIGURE="CONFIG" +CONFIG_ONLY=no # default is configure and build +NOEXEC= # default to execute commands +SRCDIRLIST=". ../hdf5" # places to look for configure +nerror=0 + +# parse some options +while [ $# -gt 0 ]; do + case "$1" in + -config) + # do configure only + CONFIG_ONLY=yes + ;; + -gass) + LOCATE_GASS + ;; + -help) + USAGE + exit 0 + ;; + -n) + NOEXEC='noexec' + ;; + -srcdir) + shift + SRCDIRLIST="$1" + ;; + *) # Quit parsing + break + ;; + esac + shift +done + +# Figure out if srcdir is wished. +# Make sure we are at the library root level +# by checking couple typical files. Not bullet-proof. +for SRCDIR in $SRCDIRLIST dummy; do + if [ x-$SRCDIR = x-dummy ]; then + break + fi + if [ -d $SRCDIR/src -a -d $SRCDIR/config -a -f $SRCDIR/configure ] + then + break + fi +done + +if [ x-$SRCDIR = x-dummy ]; then + echo "Could not find the source dir or configure script. Abort." + exit 1 +fi + +# Configure +# no configure if already done. +if [ ! -f config.status ]; then + CONFIGURE="$CONFIGURE $WITH_SSL $WITH_GASS" + STEP "Configure HDF5..." "$CONFIGURE $*" "#config" +else + STEP "Confiugre Skipped" "echo Confiugre Skipped" "#config" +fi + +if [ x-$CONFIG_ONLY = x-yes ]; then + exit 0 +fi + + +# Compile +STEP "Make HDF5..." "$MAKE" "#make" + +# Tests +STEP "Testing HDF5..." "$MAKE check" "#test" + +# all done +echo "No Errors encountered" +TIMESTAMP -- cgit v0.12