summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2015-05-07 21:05:14 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2015-05-07 21:05:14 (GMT)
commit984ecb72c2fa62d233383b24047e04061754ae34 (patch)
treea0a1ce905153a08466dae1354e14d426c86b3849 /bin
parented599421c5ef01347368d50b1b7dbed3b323c43f (diff)
parent8f82c9b8be875cd28e18402e920f8e162d8f8d38 (diff)
downloadhdf5-984ecb72c2fa62d233383b24047e04061754ae34.zip
hdf5-984ecb72c2fa62d233383b24047e04061754ae34.tar.gz
hdf5-984ecb72c2fa62d233383b24047e04061754ae34.tar.bz2
[svn-r27038] Merge of r26393-27031 from the trunk.
Tested on 64-bit linux VM w/ C++ and Fortran 2003
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cmakehdf583
-rwxr-xr-xbin/h5vers47
-rwxr-xr-xbin/release26
-rwxr-xr-xbin/snapshot4
4 files changed, 140 insertions, 20 deletions
diff --git a/bin/cmakehdf5 b/bin/cmakehdf5
index c092545..715d6d7 100755
--- a/bin/cmakehdf5
+++ b/bin/cmakehdf5
@@ -23,6 +23,7 @@ makelog="#${progname}_2build.log"
testlog="#${progname}_3test.log"
packlog="#${progname}_4pack.log"
installlog="#${progname}_5install.log"
+config_summary=libhdf5.settings
exit_code=0
# This command should be in the source directory's bin/
@@ -45,9 +46,13 @@ fi
cacheinit=$srcdir/config/cmake/cacheinit.cmake
build_cpp_lib=-DHDF5_BUILD_CPP_LIB:BOOL=OFF # C++ interface default off
build_fortran=-DHDF5_BUILD_FORTRAN:BOOL=OFF # Fortran interface default off
+enable_f2003=-DHDF5_ENABLE_F2003:BOOL=OFF # Fortran2003 interface default off
build_hl_lib=-DHDF5_BUILD_HL_LIB:BOOL=ON # High Level interface default on
build_testing=-DBUILD_TESTING:BOOL=ON # Build tests default on
build_tools=-DHDF5_BUILD_TOOLS:BOOL=ON # Build tools default on
+with_zlib=-DHDF5_ENABLE_Z_LIB_SUPPORT=ON # enable zlib filter default on
+with_szlib=-DHDF5_ENABLE_SZIP_SUPPORT=OFF # enables zlib filter default off
+shared_lib=-DBUILD_SHARED_LIBS:BOOL=ON # enables shared lib; default on
#=============
@@ -71,14 +76,20 @@ Usage: $progname [<options>]
where options are:
--enable-fortran | --disable-fortran:
enable or disable fortran API. Default is off.
+ --enable-fortran2003 | --disable-fortran2003:
+ enable or disable fortran2003 API. Default is off.
--enable-cxx | --disable-cxx:
enable or disable c++ API. Default is off.
--enable-hl | --disable-hl:
enable or disable high level API. Default is on.
+ --enable-shared | --disable-shared:
+ enable or disable shared lib. Default is on.
--enable-tools | --disable-tools:
enable or disable building tools. Default is on.
--enable-testing | --disable-testing:
enable or disable building tests. Default is on.
+ --with-zlib | --without-zlib:
+ Use zlib library for external deflate I/O filter. Default is on.
--help: shows details help page
EOF
}
@@ -106,7 +117,7 @@ STEP()
(TIMESTAMP; nerror=0 ;
echo "eval $command"
eval $command || nerror=1 ;
- TIMESTAMP; exit $nerror) < /dev/null >> "$logfile" 2>&1
+ TIMESTAMP; exit $nerror) < /dev/null > "$logfile" 2>&1
if [ $? -ne 0 ]; then
echo "error in '$banner'. $progname aborted."
exit 1
@@ -114,6 +125,40 @@ STEP()
}
+# Install the generated installation image file. Different platform uses
+# different image files.
+# Linux: HDF5-<version>-Linux.sh file
+# Mac OS X: Not implemented yet
+# Others: Not implemented yet
+INSTALL_HDF5()
+{
+ myos="`uname -s`"
+ case "$myos" in
+ Linux)
+ install_file=./HDF5-${version}-Linux.sh
+ $install_file --skip-license $*
+ ;;
+ Darwin) # Mac OSX DMG file
+ install_file=HDF5-${version}-Darwin.dmg
+ test -d hdf5 || mkdir hdf5
+ basename=`basename $install_file .dmg`
+ # mount the DMG file as /Volumes/$basename
+ # echo 'Y' as yes for license.
+ echo Y | hdiutil mount $install_file
+ # copy the contents to the install location
+ cp -R "/Volumes/$basename/HDF_Group" hdf5
+ # unmount the DMG file
+ hdiutil unmount /Volumes/$basename
+ ;;
+ *) # unknown/unsupported OS.
+ echo "INSTALL_HDF5: Error--unknown/unsupported OS($myos)"
+ return 1
+ ;;
+ esac
+ return 0
+}
+
+
#==========
# main
#==========
@@ -137,6 +182,12 @@ while [ $# -gt 0 ]; do
--disable-fortran)
build_fortran=-DHDF5_BUILD_FORTRAN:BOOL=OFF
;;
+ --enable-fortran2003)
+ enable_f2003=-DHDF5_ENABLE_F2003:BOOL=ON
+ ;;
+ --disable-fortran2003)
+ enable_f2003=-DHDF5_ENABLE_F2003:BOOL=OFF
+ ;;
--enable-cxx)
build_cpp_lib=-DHDF5_BUILD_CPP_LIB:BOOL=ON
;;
@@ -149,6 +200,12 @@ while [ $# -gt 0 ]; do
--disable-hl)
build_hl_lib=-DHDF5_BUILD_HL_LIB:BOOL=OFF
;;
+ --enable-shared)
+ shared_lib=-DBUILD_SHARED_LIBS:BOOL=ON
+ ;;
+ --disable-shared)
+ shared_lib=-DBUILD_SHARED_LIBS:BOOL=OFF
+ ;;
--enable-tools)
build_tools=-DHDF5_BUILD_TOOLS:BOOL=ON
;;
@@ -161,14 +218,21 @@ while [ $# -gt 0 ]; do
--disable-testing)
build_testing=-DBUILD_TESTING:BOOL=OFF
;;
+ --with-zlib)
+ with_zlib=-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON
+ ;;
+ --without-zlib)
+ with_zlib=-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF
+ ;;
--help)
# print the detail help page and exit
HELP
exit 0
;;
*)
- echo "Unknown options"
+ echo "Unknown options: $1"
HELP
+ exit 1
;;
esac
shift
@@ -194,16 +258,22 @@ if [ $? != 0 ]; then
echo $vers failed. Aborted.
exit 1
fi
-echo Running Cmake for HDF5-${version} ...
-
+echo Running Cmake for HDF5-${version} ...
# 4. Configure the C library, tools and tests with this command:
+# If successful, append the configure summary to the configure logfile.
STEP "Configure..." "cmake \
+ -C $cacheinit \
$build_cpp_lib \
$build_fortran \
+ $enable_f2003 \
$build_hl_lib \
+ $shared_lib \
$build_testing \
$build_tools \
- $srcdir" $configlog
+ $with_zlib \
+ $with_szlib \
+ $srcdir" $configlog &&\
+ cat $config_summary >> $configlog
# 5. Build the C library, tools and tests with this command:
STEP "Build the library, tools and tests, ..." "cmake --build . --config Release" $makelog
@@ -215,7 +285,8 @@ STEP "Test the library and tools..." "ctest . -C Release" $testlog
STEP "Create an install image..." "cpack -C Release CPackConfig.cmake" $packlog
# 8. Install with this command:
-STEP "Install..." "./HDF5-${version}-Linux.sh --skip-license" $installlog
+#STEP "Install..." "./HDF5-${version}-Linux.sh --skip-license" $installlog
+STEP "Install..." "INSTALL_HDF5" $installlog
# save the last exit code
exit_code=$?
diff --git a/bin/h5vers b/bin/h5vers
index cb4b9e0..2aa8023 100755
--- a/bin/h5vers
+++ b/bin/h5vers
@@ -187,6 +187,10 @@ die "unable to read file: $RELEASE\n" unless -r $file;
my $CONFIGURE = $file;
$CONFIGURE =~ s/[^\/]*$/..\/configure.ac/;
die "unable to read file: $CONFIGURE\n" unless -r $file;
+# cpp_doc_config
+my $CPP_DOC_CONFIG = $file;
+$CPP_DOC_CONFIG =~ s/[^\/]*$/..\/c++\/src\/cpp_doc_config/;
+die "unable to read file: $CPP_DOC_CONFIG\n" unless -r $file;
# Get the current version number.
open FILE, $file or die "unable to open $file: $!\n";
@@ -234,7 +238,8 @@ if ($set) {
$README = "";
$RELEASE = "";
$CONFIGURE = "";
- $LT_VERS = "";
+ $CPP_DOC_CONFIG = "";
+ $LT_VERS = "";
@newver = @curver;
}
@@ -309,6 +314,46 @@ if ($RELEASE) {
close FILE;
}
+# Update the c++/src/cpp_doc_config file
+if ($CPP_DOC_CONFIG) {
+ my $data = read_file($CPP_DOC_CONFIG);
+ my $version_string = sprintf("HDF5 version %d.%d.%d%s %s",
+ @newver[0,1,2],
+ $newver[3] eq "" ? "" : "-".$newver[3],
+ "currently under development");
+
+ $data =~ s/PROJECT_NUMBER\s*=.*/PROJECT_NUMBER = $version_string/;
+
+ write_file($CPP_DOC_CONFIG, $data);
+}
+
+# helper function to read the file for updating c++/src/cpp_doc_config file.
+# The version string in that file is not at the top, so the string replacement
+# is not for the first line, and reading/writing the entire file as one string
+# facilitates the substring replacement.
+sub read_file {
+ my ($filename) = @_;
+
+ open my $in, $filename or die "Could not open '$filename' for reading $!";
+ local $/ = undef;
+ my $all = <$in>;
+ close $in;
+
+ return $all;
+}
+
+# helper function to write the file for updating c++/src/cpp_doc_config file.
+sub write_file {
+ my ($filename, $content) = @_;
+
+ open my $out, ">$filename" or die "Could not open '$filename' for writing $!";;
+ print $out $content;
+ close $out;
+
+ return;
+}
+
+
sub gen_configure {
my ($name, $conf) = @_;
diff --git a/bin/release b/bin/release
index d771db6..703916b 100755
--- a/bin/release
+++ b/bin/release
@@ -50,31 +50,33 @@ Usage: $0 -d <dir> [-h] [--nocheck] [--private] <methods> ...
This must be run at the top level of the source directory.
The other command-line options are the names of the programs to use
for compressing the resulting tar archive (if none are given then
-"tar md5" is assumed):
+"tar" is assumed):
tar -- use tar and don't do any compressing.
gzip -- use gzip with "-9" and append ".gz" to the output name.
bzip2 -- use bzip2 with "-9" and append ".bz2" to the output name.
zip -- convert all text files to DOS style and form a zip file for Windows use.
- md5 -- produce a md5 checksum in addition to the archive.
doc -- produce the latest doc tree in addition to the archive.
+An md5 checksum is produced for each archive created and stored in the md5 file.
+
Examples:
$ bin/release -d /tmp
/tmp/hdf5-1.8.13-RELEASE.txt
+ /tmp/hdf5-1.8.13.md5
/tmp/hdf5-1.8.13.tar
- /tmp/hdf5-1.8.13.tar.md5
$ bin/release -d /tmp gzip
/tmp/hdf5-1.8.13-RELEASE.txt
+ /tmp/hdf5-1.8.13.md5
/tmp/hdf5-1.8.13.tar.gz
- $ bin/release -d /tmp tar gzip zip md5
+ $ bin/release -d /tmp tar gzip zip
/tmp/hdf5-1.8.13-RELEASE.txt
+ /tmp/hdf5-1.8.13.md5
/tmp/hdf5-1.8.13.tar
/tmp/hdf5-1.8.13.tar.gz
- /tmp/hdf5-1.8.13.tar.md5
/tmp/hdf5-1.8.13.tar.zip
EOF
@@ -212,9 +214,9 @@ while [ -n "$1" ]; do
esac
done
-# Default methods are tar and md5
+# Default method is tar
if [ "X$methods" = "X" ]; then
- methods="tar md5"
+ methods="tar"
fi
# Create the temporay work directory.
@@ -289,26 +291,28 @@ test "$verbose" && echo " Running tar..." 1>&2
)
# Compress
+MD5file=$HDF5_VERS.md5
+cp /dev/null $DEST/$MD5file
for comp in $methods; do
case $comp in
tar)
cp -p $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.tar
+ (cd $DEST; md5sum $HDF5_VERS.tar >> $MD5file)
;;
gzip)
test "$verbose" && echo " Running gzip..." 1>&2
gzip -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.gz
+ (cd $DEST; md5sum $HDF5_VERS.tar.gz >> $MD5file)
;;
bzip2)
test "$verbose" && echo " Running bzip2..." 1>&2
bzip2 -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.bz2
+ (cd $DEST; md5sum $HDF5_VERS.tar.bz2 >> $MD5file)
;;
zip)
test "$verbose" && echo " Creating zip ball..." 1>&2
tar2zip $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.zip 1>&2
- ;;
- md5)
- test "$verbose" && echo " Creating checksum..." 1>&2
- (cd $tmpdir; md5sum $HDF5_VERS.tar ) > $DEST/$HDF5_VERS.tar.md5
+ (cd $DEST; md5sum $HDF5_VERS.zip >> $MD5file)
;;
doc)
test "$verbose" && echo " Creating docs..." 1>&2
diff --git a/bin/snapshot b/bin/snapshot
index b4adf5e..a496edd 100755
--- a/bin/snapshot
+++ b/bin/snapshot
@@ -67,8 +67,8 @@ ReleaseDir_default=release_dir
ZLIB_default=
ZLIB=$ZLIB_default
-# What compression methods to use? (md5 does checksum).
-METHODS="gzip zip bzip2 md5 doc"
+# What compression methods to use?
+METHODS="gzip zip bzip2 doc"
# Use User's MAKE if set. Else use generic make.
MAKE=${MAKE:-make}