From b93c9e2cf93cfa61eb6200e8be9a444f44fe1e86 Mon Sep 17 00:00:00 2001 From: Robb Matzke Date: Fri, 19 Mar 1999 15:09:50 -0500 Subject: [svn-r1151] Changes since 19990318 ---------------------- ./Makefile.in ./configure.in ./configure [REGENERATED] ./src/H5config.h.in [REGENERATED] ./config/commence.in ./config/conclude.in ./config/dec-osf4.x ./config/depend.in ./config/freebsd ./config/linux-gnu ./config/linux-gnulibc1 ./config/linux-gnulibc2 ./config/solaris2.x ./examples/Makefile.in ./src/Makefile.in ./test/Makefile.in ./testpar/Makefile.in ./tools/Makefile.in ./tools/testh5dump.sh Changes that allow hdf5 to be configured and compiled in a directory other than the source directory. This is especially useful if you want to concurrently compile with different compilers and/or compile flags, or if the hdf5 source is on read-only media like a CDROM. The changes were surprisingly easy ;-) Here's what you can do now... $ mkdir /tmp/build1 # or something $ cd /tmp/build1 $ /cdrom/hdf5/configure # where ever the source is $ make Paul, you'll have to change the testh5toh4 script similar to the way I changed testh5dump.sh. I started working on it but then gave up because of a number of problems: (1) I had to comment out all the tests that let h5toh4 choose the output file name because it always tried to put the output file in the same directory as the input file, (2) if path names are used during the h4 dump then they interfere with the diff. The test works fine when run in the source directory, but try this instead: $ gunzip .distdep + -srcdir=$(srcdir) perl -p $(top_srcdir)/bin/distdep .depend >.distdep .depend: $(LIB_SRC) $(TEST_SRC) $(PROG_SRC) @touch .depend @@ -33,12 +33,12 @@ dep depend: .distdep if [ $$dep != "dummy" ]; then \ echo Building dependencies for $$dep; \ obj=`echo $$dep | sed 's/\.c/\\\\.o/'`; \ - sed "/$$obj/,/[^\\]$$/d" <$@ >$@- && mv $@- $@; \ + sed '\%$$obj%,\%[^\\]$$%d' <$@ >$@- && mv $@- $@; \ $(TRACE) $$dep; \ $(CC) -M -MG $(CPPFLAGS) $$dep >>$@; \ fi; \ done; - -perl -p $(ROOT)/bin/distdep .depend >.distdep + -perl -p $(top_srcdir)/bin/distdep .depend >.distdep -include .depend diff --git a/config/freebsd b/config/freebsd index 4d9d221..8608a85 100644 --- a/config/freebsd +++ b/config/freebsd @@ -18,4 +18,4 @@ ARCH= NOFP=${NOFP:=-fomit-frame-pointer} # Figure out compiler flags -. ./config/gnu-flags +. $srcdir/config/gnu-flags diff --git a/config/linux-gnu b/config/linux-gnu index 99335aa..d139966 100644 --- a/config/linux-gnu +++ b/config/linux-gnu @@ -1,4 +1,4 @@ # -*- shell-script -*- # This is the same as linux-gnulibc1 -. config/linux-gnulibc1 +. $srcdir/config/linux-gnulibc1 diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1 index 83389b0..266cd3a 100644 --- a/config/linux-gnulibc1 +++ b/config/linux-gnulibc1 @@ -19,4 +19,4 @@ ARCH=${ARCH:="-mcpu=pentiumpro -march=pentiumpro -malign-double"} NOFP=${NOFP:=-fomit-frame-pointer} # Figure out compiler flags -. ./config/gnu-flags +. $srcdir/config/gnu-flags diff --git a/config/linux-gnulibc2 b/config/linux-gnulibc2 index 67bdfdd..4551fb6 100644 --- a/config/linux-gnulibc2 +++ b/config/linux-gnulibc2 @@ -7,4 +7,4 @@ # See BlankForm in this directory for details. # Same as with gnulibc1 for now -. ./config/linux-gnulibc1 +. $srcdir/config/linux-gnulibc1 diff --git a/config/solaris2.x b/config/solaris2.x index 2ced6cb..7dc50e4 100644 --- a/config/solaris2.x +++ b/config/solaris2.x @@ -13,7 +13,7 @@ if test "X-" = "X-$CC"; then fi # Try gcc compiler flags -. ./config/gnu-flags +. $srcdir/config/gnu-flags # Try solaris native compiler flags if test "X-" = "X-$cc_flags_set"; then diff --git a/configure b/configure index ea6fe7a..2f1a8bc 100755 --- a/configure +++ b/configure @@ -715,8 +715,8 @@ for f in $host_cpu-$host_vendor-$host_os \ $host_cpu ; do echo $ac_n "checking for config $f""... $ac_c" 1>&6 echo "configure:718: checking for config $f" >&5 - if test -f config/$f; then - host_config=config/$f + if test -f $srcdir/config/$f; then + host_config=$srcdir/config/$f echo "$ac_t""found" 1>&6 break fi @@ -3213,7 +3213,7 @@ esac H5TOH4=h5toh4 -TESTH5TOH4=testh5toh4 +TESTH5TOH4='$srcdir/testh5toh4' # Check whether --with-hdf4 or --without-hdf4 was given. if test "${with_hdf4+set}" = set; then @@ -4786,8 +4786,9 @@ else fi ROOT=`$pwd` -touch ./config/stamp1 ./config/stamp2 +rm -f conftest conftest.o conftest.c dummy.o +no_create=yes trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure @@ -5176,3 +5177,8 @@ chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 +sleep 1 +mkdir ./config >/dev/null 2>&1 +touch ./config/stamp1 ./config/stamp2 +sleep 1 +${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 diff --git a/configure.in b/configure.in index a6cad3f..9caff6c 100644 --- a/configure.in +++ b/configure.in @@ -87,8 +87,8 @@ for f in $host_cpu-$host_vendor-$host_os \ $host_vendor \ $host_cpu ; do AC_MSG_CHECKING(for config $f) - if test -f config/$f; then - host_config=config/$f + if test -f $srcdir/config/$f; then + host_config=$srcdir/config/$f AC_MSG_RESULT(found) break fi @@ -288,7 +288,7 @@ dnl AC_SUBST(H5TOH4) H5TOH4=h5toh4 AC_SUBST(TESTH5TOH4) -TESTH5TOH4=testh5toh4 +TESTH5TOH4='$(srcdir)/testh5toh4' AC_ARG_WITH(hdf4,[ --with-hdf4=INC,LIB Use the HDF4 library],,withval=yes) case $withval in @@ -734,10 +734,18 @@ else fi AC_SUBST(ROOT) ROOT=`$pwd` -dnl Touch the time-stamp files for src/H5config.h.in and src/H5config.h -dnl before we generate them or the Makefiles. -touch ./config/stamp1 ./config/stamp2 +dnl Some cleanup stuff +rm -f conftest conftest.o conftest.c dummy.o +dnl Build config.status, then touch the stamp files, then build all +dnl the Makefiles. The order is such that the first `make' does not +dnl need to call config.status. +no_create=yes AC_OUTPUT(config/depend config/commence config/conclude \ Makefile src/Makefile pablo/Makefile test/Makefile \ testpar/Makefile tools/Makefile examples/Makefile) +sleep 1 +mkdir ./config >/dev/null 2>&1 +touch ./config/stamp1 ./config/stamp2 +sleep 1 +${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 diff --git a/examples/Makefile.in b/examples/Makefile.in index 5d24890..1155112 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -1,15 +1,18 @@ -# HDF5 Library Examples Makefile(.in) -*- makefile -*- +# HDF5 Library Examples Makefile(.in) # # Copyright (C) 1997 National Center for Supercomputing Applications. # All rights reserved. # -# +top_srcdir=@top_srcdir@ +top_builddir=.. +srcdir=@srcdir@ +VPATH=.:@srcdir@ @COMMENCE@ # Add include directory to the C preprocessor flags and the hdf5 library # to the library list. -CPPFLAGS=-I. -I../src @CPPFLAGS@ -LIBS=../src/libhdf5.a @LIBS@ +CPPFLAGS=-I. -I$(srcdir) -I../src -I$(top_srcdir)/src @CPPFLAGS@ +LIBHDF5=../src/libhdf5.la # These are the programs that `make all' will build, `make install' # will copy to the binaries directory, and `make uninstall' will @@ -33,29 +36,29 @@ PROG_OBJ=$(PROG_SRC:.c=.o) # How to build the programs... they all depend on the hdf5 library -$(PROGS): ../src/libhdf5.a +$(PROGS): $(LIBHDF5) h5_chunk_read: h5_chunk_read.o - $(CC) $(CFLAGS) -o $@ h5_chunk_read.o $(LDFLAGS) $(LIBS) + @$(LT_LINK_EXE) $(CFLAGS) -o $@ h5_chunk_read.o $(LIBHDF5) $(LDFLAGS) $(LIBS) h5_compound: h5_compound.o - $(CC) $(CFLAGS) -o $@ h5_compound.o $(LDFLAGS) $(LIBS) + @$(LT_LINK_EXE) $(CFLAGS) -o $@ h5_compound.o $(LIBHDF5) $(LDFLAGS) $(LIBS) h5_extend_write: h5_extend_write.o - $(CC) $(CFLAGS) -o $@ h5_extend_write.o $(LDFLAGS) $(LIBS) + @$(LT_LINK_EXE) $(CFLAGS) -o $@ h5_extend_write.o $(LIBHDF5) $(LDFLAGS) $(LIBS) h5_group: h5_group.o - $(CC) $(CFLAGS) -o $@ h5_group.o $(LDFLAGS) $(LIBS) + @$(LT_LINK_EXE) $(CFLAGS) -o $@ h5_group.o $(LIBHDF5) $(LDFLAGS) $(LIBS) h5_write: h5_write.o - $(CC) $(CFLAGS) -o $@ h5_write.o $(LDFLAGS) $(LIBS) + @$(LT_LINK_EXE) $(CFLAGS) -o $@ h5_write.o $(LIBHDF5) $(LDFLAGS) $(LIBS) h5_read: h5_read.o - $(CC) $(CFLAGS) -o $@ h5_read.o $(LDFLAGS) $(LIBS) + @$(LT_LINK_EXE) $(CFLAGS) -o $@ h5_read.o $(LIBHDF5) $(LDFLAGS) $(LIBS) h5_select: h5_select.o - $(CC) $(CFLAGS) -o $@ h5_select.o $(LDFLAGS) $(LIBS) + @$(LT_LINK_EXE) $(CFLAGS) -o $@ h5_select.o $(LIBHDF5) $(LDFLAGS) $(LIBS) h5_attribute: h5_attribute.o - $(CC) $(CFLAGS) -o $@ h5_attribute.o $(LDFLAGS) $(LIBS) + @$(LT_LINK_EXE) $(CFLAGS) -o $@ h5_attribute.o $(LIBHDF5) $(LDFLAGS) $(LIBS) @CONCLUDE@ diff --git a/src/.distdep b/src/.distdep index a611fd6..e02947b 100644 --- a/src/.distdep +++ b/src/.distdep @@ -528,6 +528,667 @@ H5O.o: \ H5HGpublic.h \ H5Tprivate.h \ H5Tpublic.h +H5Oattr.o: \ + H5Oattr.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Zprivate.h \ + H5Zpublic.h \ + H5Apkg.h +H5Ocomp.o: \ + H5Ocomp.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h +H5Ocont.o: \ + H5Ocont.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h +H5Odtype.o: \ + H5Odtype.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Zprivate.h \ + H5Zpublic.h \ + H5Tpkg.h +H5Oefl.o: \ + H5Oefl.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h \ + H5HLprivate.h \ + H5HLpublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Zprivate.h +H5Ofill.o: \ + H5Ofill.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h \ + H5Iprivate.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h +H5Olayout.o: \ + H5Olayout.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Dprivate.h \ + H5Dpublic.h \ + H5Ipublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Zprivate.h +H5Omtime.o: \ + H5Omtime.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h +H5Oname.o: \ + H5Oname.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h +H5Onull.o: \ + H5Onull.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Ipublic.h \ + H5Dpublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h +H5Osdspace.o: \ + H5Osdspace.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h +H5Oshared.o: \ + H5Oshared.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h +H5Ostab.o: \ + H5Ostab.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h +H5P.o: \ + H5P.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Iprivate.h \ + H5Ipublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Dprivate.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Zprivate.h \ + H5Zpublic.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5MMprivate.h +H5R.o: \ + H5R.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Iprivate.h \ + H5Ipublic.h \ + H5Dprivate.h \ + H5Dpublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Zprivate.h \ + H5Zpublic.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5MMprivate.h +H5RA.o: \ + H5RA.c \ + H5RAprivate.h \ + H5RApublic.h \ + H5Ipublic.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Dprivate.h \ + H5Dpublic.h \ + H5private.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Zprivate.h \ + H5Zpublic.h \ + H5Eprivate.h \ + H5Epublic.h +H5S.o: \ + H5S.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Iprivate.h \ + H5Ipublic.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h +H5Sall.o: \ + H5Sall.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h +H5Shyper.o: \ + H5Shyper.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h \ + H5Zprivate.h \ + H5Zpublic.h \ + H5Vprivate.h \ + H5MMprivate.h \ + H5MMpublic.h +H5Smpio.o: \ + H5Smpio.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h +H5Snone.o: \ + H5Snone.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h +H5Spoint.o: \ + H5Spoint.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h \ + H5Zprivate.h \ + H5Zpublic.h \ + H5Vprivate.h +H5Sselect.o: \ + H5Sselect.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h \ + H5Iprivate.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h \ + H5Zprivate.h \ + H5Zpublic.h +H5T.o: \ + H5T.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Dprivate.h \ + H5Dpublic.h \ + H5Ipublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Zprivate.h \ + H5Zpublic.h \ + H5Iprivate.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5MMprivate.h +H5Tbit.o: \ + H5Tbit.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h \ + H5Iprivate.h \ + H5Tpkg.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Rprivate.h \ + H5Rpublic.h \ + H5Tprivate.h +H5Tconv.o: \ + H5Tconv.c \ + H5Iprivate.h \ + H5Ipublic.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5private.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Tpkg.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Rprivate.h \ + H5Rpublic.h \ + H5Tprivate.h H5Tinit.o: \ H5Tinit.c \ H5private.h \ @@ -552,3 +1213,64 @@ H5Tinit.o: \ H5Tpublic.h \ H5Gprivate.h \ H5Gpublic.h +H5TB.o: \ + H5TB.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Iprivate.h \ + H5Ipublic.h \ + H5Eprivate.h +H5V.o: \ + H5V.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h +H5Z.o: \ + H5Z.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Zprivate.h \ + H5Zpublic.h diff --git a/src/H5R.c b/src/H5R.c index 447b7cb..2fa4fd2 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -708,13 +708,14 @@ done: EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -intn +int H5Rget_object_type(hid_t dataset, void *_ref) { H5D_t *dset = NULL; /* dataset object */ hid_t ret_value = FAIL; FUNC_ENTER(H5Rget_object_type, FAIL); + H5TRACE2("Is","ix",dataset,_ref); /* Check args */ if (H5I_DATASET != H5I_get_type(dataset) || NULL == (dset = H5I_object(dataset))) diff --git a/src/H5detect.c b/src/H5detect.c index 0af2e9d..00f8ac4 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -1,30 +1,30 @@ /*keep this here -RPM*/ static const char *FileHeader = "\n\ /*-------------------------------------------------------------------------\n\ - * Copyright (C) 1997 National Center for Supercomputing Applications. \n\ - * All rights reserved. \n\ - * \n\ + * Copyright (C) 1997 National Center for Supercomputing Applications. \n\ + * All rights reserved. \n\ + * \n\ *-------------------------------------------------------------------------"; /* * - * Created: H5detect.c - * 10 Aug 1997 - * Robb Matzke + * Created: H5detect.c + * 10 Aug 1997 + * Robb Matzke * - * Purpose: This code was borrowed heavily from the `detect.c' - * program in the AIO distribution from Lawrence - * Livermore National Laboratory. + * Purpose: This code was borrowed heavily from the `detect.c' + * program in the AIO distribution from Lawrence + * Livermore National Laboratory. * - * Detects machine byte order and floating point - * format and generates a C source file (native.c) - * to describe those paramters. + * Detects machine byte order and floating point + * format and generates a C source file (native.c) + * to describe those paramters. * * Assumptions: We have an ANSI compiler. We're on a Unix like - * system or configure has detected those Unix - * features which aren't available. We're not - * running on a Vax or other machine with mixed - * endianess. - * + * system or configure has detected those Unix + * features which aren't available. We're not + * running on a Vax or other machine with mixed + * endianess. + * * Modifications: * *------------------------------------------------------------------------- @@ -38,15 +38,15 @@ static const char *FileHeader = "\n\ * was detected. */ typedef struct detected_t { - const char *varname; - int size; /*total byte size */ + const char *varname; + int size; /*total byte size */ int precision; /*meaningful bits */ int offset; /*bit offset to meaningful bits */ - int perm[32]; /*byte order */ - int sign; /*location of sign bit */ - int mpos, msize, imp;/*information about mantissa */ - int epos, esize; /*information about exponent */ - unsigned long bias; /*exponent bias for floating pt.*/ + int perm[32]; /*byte order */ + int sign; /*location of sign bit */ + int mpos, msize, imp;/*information about mantissa */ + int epos, esize; /*information about exponent */ + unsigned long bias; /*exponent bias for floating pt.*/ size_t align; /*required byte alignment */ } detected_t; @@ -71,7 +71,7 @@ static jmp_buf jbuf_g; * Return: void * * Programmer: Robb Matzke - * Thursday, June 18, 1998 + * Thursday, June 18, 1998 * * Modifications: * @@ -84,7 +84,7 @@ precision (detected_t *d) if (0==d->msize) { /* - * An integer. The permutation can have negative values at the + * An integer. The permutation can have negative values at the * beginning or end which represent padding of bytes. We must adjust * the precision and offset accordingly. */ @@ -119,132 +119,132 @@ precision (detected_t *d) /*------------------------------------------------------------------------- - * Function: DETECT_I + * Function: DETECT_I * - * Purpose: This macro takes a type like `int' and a base name like - * `nati' and detects the byte order. The VAR is used to - * construct the names of the C variables defined. + * Purpose: This macro takes a type like `int' and a base name like + * `nati' and detects the byte order. The VAR is used to + * construct the names of the C variables defined. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 12 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 12 1996 * * Modifications: * - * Robb Matzke, 4 Nov 1996 - * The INFO.perm now contains `-1' for bytes that aren't used and - * are always zero. This happens on the Cray for `short' where - * sizeof(short) is 8, but only the low-order 4 bytes are ever used. + * Robb Matzke, 4 Nov 1996 + * The INFO.perm now contains `-1' for bytes that aren't used and + * are always zero. This happens on the Cray for `short' where + * sizeof(short) is 8, but only the low-order 4 bytes are ever used. * - * Robb Matzke, 4 Nov 1996 - * Added a `padding' field to indicate how many zero bytes appear to - * the left (N) or right (-N) of the value. + * Robb Matzke, 4 Nov 1996 + * Added a `padding' field to indicate how many zero bytes appear to + * the left (N) or right (-N) of the value. * - * Robb Matzke, 5 Nov 1996 - * Removed HFILE and CFILE arguments. + * Robb Matzke, 5 Nov 1996 + * Removed HFILE and CFILE arguments. * *------------------------------------------------------------------------- */ -#define DETECT_I(TYPE,VAR,INFO) { \ - TYPE _v; \ - int _i, _j; \ - unsigned char *_x; \ - memset (&INFO, 0, sizeof(INFO)); \ - INFO.varname = #VAR; \ - INFO.size = sizeof(TYPE); \ - for (_i=sizeof(TYPE),_v=0; _i>0; --_i) _v = (_v<<8) + _i; \ - for (_i=0,_x=(unsigned char *)&_v; _i<(signed)sizeof(TYPE); _i++) { \ - _j = (*_x++)-1; \ - assert (_j<(signed)sizeof(TYPE)); \ - INFO.perm[_i] = _j; \ - } \ - INFO.sign = ('U'!=*(#VAR)); \ +#define DETECT_I(TYPE,VAR,INFO) { \ + TYPE _v; \ + int _i, _j; \ + unsigned char *_x; \ + memset (&INFO, 0, sizeof(INFO)); \ + INFO.varname = #VAR; \ + INFO.size = sizeof(TYPE); \ + for (_i=sizeof(TYPE),_v=0; _i>0; --_i) _v = (_v<<8) + _i; \ + for (_i=0,_x=(unsigned char *)&_v; _i<(signed)sizeof(TYPE); _i++) { \ + _j = (*_x++)-1; \ + assert (_j<(signed)sizeof(TYPE)); \ + INFO.perm[_i] = _j; \ + } \ + INFO.sign = ('U'!=*(#VAR)); \ ALIGNMENT(TYPE, INFO.align); \ precision (&(INFO)); \ } /*------------------------------------------------------------------------- - * Function: DETECT_F + * Function: DETECT_F * - * Purpose: This macro takes a floating point type like `double' and - * a base name like `natd' and detects byte order, mantissa - * location, exponent location, sign bit location, presence or - * absence of implicit mantissa bit, and exponent bias and - * initializes a detected_t structure with those properties. + * Purpose: This macro takes a floating point type like `double' and + * a base name like `natd' and detects byte order, mantissa + * location, exponent location, sign bit location, presence or + * absence of implicit mantissa bit, and exponent bias and + * initializes a detected_t structure with those properties. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 12 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 12 1996 * * Modifications: * - * Robb Matzke, 14 Aug 1996 - * The byte order detection has been changed because on the Cray - * the last pass causes a rounding to occur that causes the least - * significant mantissa byte to change unexpectedly. + * Robb Matzke, 14 Aug 1996 + * The byte order detection has been changed because on the Cray + * the last pass causes a rounding to occur that causes the least + * significant mantissa byte to change unexpectedly. * - * Robb Matzke, 5 Nov 1996 - * Removed HFILE and CFILE arguments. + * Robb Matzke, 5 Nov 1996 + * Removed HFILE and CFILE arguments. *------------------------------------------------------------------------- */ -#define DETECT_F(TYPE,VAR,INFO) { \ - TYPE _v1, _v2, _v3; \ - int _i, _j, _first=(-1), _last=(-1); \ - char *_mesg; \ - \ - memset (&INFO, 0, sizeof(INFO)); \ - INFO.varname = #VAR; \ - INFO.size = sizeof(TYPE); \ - \ - /* Byte Order */ \ - for (_i=0,_v1=0.0,_v2=1.0; _i<(signed)sizeof(TYPE); _i++) { \ - _v3 = _v1; _v1 += _v2; _v2 /= 256.0; \ - if ((_j=byte_cmp(sizeof(TYPE), &_v3, &_v1))>=0) { \ - if (0==_i || INFO.perm[_i-1]!=_j) { \ - INFO.perm[_i] = _j; \ - _last = _i; \ - if (_first<0) _first = _i; \ - } \ - } \ - } \ +#define DETECT_F(TYPE,VAR,INFO) { \ + TYPE _v1, _v2, _v3; \ + int _i, _j, _first=(-1), _last=(-1); \ + char *_mesg; \ + \ + memset (&INFO, 0, sizeof(INFO)); \ + INFO.varname = #VAR; \ + INFO.size = sizeof(TYPE); \ + \ + /* Byte Order */ \ + for (_i=0,_v1=0.0,_v2=1.0; _i<(signed)sizeof(TYPE); _i++) { \ + _v3 = _v1; _v1 += _v2; _v2 /= 256.0; \ + if ((_j=byte_cmp(sizeof(TYPE), &_v3, &_v1))>=0) { \ + if (0==_i || INFO.perm[_i-1]!=_j) { \ + INFO.perm[_i] = _j; \ + _last = _i; \ + if (_first<0) _first = _i; \ + } \ + } \ + } \ fix_order (sizeof(TYPE), _first, _last, INFO.perm, (const char**)&_mesg); \ - \ - /* Implicit mantissa bit */ \ - _v1 = 0.5; \ - _v2 = 1.0; \ - INFO.imp = imp_bit (sizeof(TYPE), INFO.perm, &_v1, &_v2); \ - \ - /* Sign bit */ \ - _v1 = 1.0; \ - _v2 = -1.0; \ - INFO.sign = bit_cmp (sizeof(TYPE), INFO.perm, &_v1, &_v2); \ - \ - /* Mantissa */ \ - INFO.mpos = 0; \ - \ - _v1 = 1.0; \ - _v2 = 1.5; \ - INFO.msize = bit_cmp (sizeof(TYPE), INFO.perm, &_v1, &_v2); \ - INFO.msize += 1 + (INFO.imp?0:1) - INFO.mpos; \ - \ - /* Exponent */ \ - INFO.epos = INFO.mpos + INFO.msize; \ - \ - INFO.esize = INFO.sign - INFO.epos; \ - \ - _v1 = 1.0; \ - INFO.bias = find_bias (INFO.epos, INFO.esize, INFO.perm, &_v1); \ + \ + /* Implicit mantissa bit */ \ + _v1 = 0.5; \ + _v2 = 1.0; \ + INFO.imp = imp_bit (sizeof(TYPE), INFO.perm, &_v1, &_v2); \ + \ + /* Sign bit */ \ + _v1 = 1.0; \ + _v2 = -1.0; \ + INFO.sign = bit_cmp (sizeof(TYPE), INFO.perm, &_v1, &_v2); \ + \ + /* Mantissa */ \ + INFO.mpos = 0; \ + \ + _v1 = 1.0; \ + _v2 = 1.5; \ + INFO.msize = bit_cmp (sizeof(TYPE), INFO.perm, &_v1, &_v2); \ + INFO.msize += 1 + (INFO.imp?0:1) - INFO.mpos; \ + \ + /* Exponent */ \ + INFO.epos = INFO.mpos + INFO.msize; \ + \ + INFO.esize = INFO.sign - INFO.epos; \ + \ + _v1 = 1.0; \ + INFO.bias = find_bias (INFO.epos, INFO.esize, INFO.perm, &_v1); \ ALIGNMENT(TYPE, INFO.align); \ precision (&(INFO)); \ } #if defined(HAVE_LONGJMP) && defined(HAVE_SIGNAL) #define ALIGNMENT(TYPE,ALIGN) { \ - char *_buf=NULL; \ + char *volatile _buf=NULL; \ volatile TYPE _val=0; \ volatile size_t _ano=0; \ void (*_handler)(int) = signal(SIGBUS, sigbus_handler); \ @@ -253,7 +253,7 @@ precision (detected_t *d) if (setjmp(jbuf_g)) _ano++; \ if (_anostate = H5T_STATE_IMMUTABLE;\n\ H5F_addr_undef (&(dt->ent.header));\n\ @@ -414,20 +414,20 @@ H5T_native_open (void)\n\ dt->u.atomic.prec = %d;\n\ dt->u.atomic.lsb_pad = H5T_PAD_ZERO;\n\ dt->u.atomic.msb_pad = H5T_PAD_ZERO;\n", - d[i].msize ? "FLOAT" : "INTEGER",/*class */ - d[i].size, /*size */ - d[i].perm[0] ? "BE" : "LE", /*byte order */ - d[i].offset, /*offset */ - d[i].precision); /*precision */ - - if (0 == d[i].msize) { - /* The part unique to fixed point types */ - printf("\ + d[i].msize ? "FLOAT" : "INTEGER",/*class */ + d[i].size, /*size */ + d[i].perm[0] ? "BE" : "LE", /*byte order */ + d[i].offset, /*offset */ + d[i].precision); /*precision */ + + if (0 == d[i].msize) { + /* The part unique to fixed point types */ + printf("\ dt->u.atomic.u.i.sign = H5T_SGN_%s;\n", - d[i].sign ? "2" : "NONE"); - } else { - /* The part unique to floating point types */ - printf("\ + d[i].sign ? "2" : "NONE"); + } else { + /* The part unique to floating point types */ + printf("\ dt->u.atomic.u.f.sign = %d;\n\ dt->u.atomic.u.f.epos = %d;\n\ dt->u.atomic.u.f.esize = %d;\n\ @@ -436,24 +436,24 @@ H5T_native_open (void)\n\ dt->u.atomic.u.f.msize = %d;\n\ dt->u.atomic.u.f.norm = H5T_NORM_%s;\n\ dt->u.atomic.u.f.pad = H5T_PAD_ZERO;\n", - d[i].sign, /*sign location */ - d[i].epos, /*exponent loc */ - d[i].esize, /*exponent size */ - (unsigned long)(d[i].bias), /*exponent bias */ - d[i].mpos, /*mantissa loc */ - d[i].msize, /*mantissa size */ - d[i].imp ? "IMPLIED" : "NONE"); /*normalization */ - } - - /* Atomize the type */ - printf("\ + d[i].sign, /*sign location */ + d[i].epos, /*exponent loc */ + d[i].esize, /*exponent size */ + (unsigned long)(d[i].bias), /*exponent bias */ + d[i].mpos, /*mantissa loc */ + d[i].msize, /*mantissa size */ + d[i].imp ? "IMPLIED" : "NONE"); /*normalization */ + } + + /* Atomize the type */ + printf("\ if ((H5T_NATIVE_%s_g = H5I_register (H5I_DATATYPE, dt))<0) {\n\ HRETURN_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL,\n\ - \"can't initialize type system (atom registration \"\n\ - \"failure\");\n\ + \"can't initialize type system (atom registration \"\n\ + \"failure\");\n\ }\n", - d[i].varname); - printf(" H5T_NATIVE_%s_ALIGN_g = %lu;\n", + d[i].varname); + printf(" H5T_NATIVE_%s_ALIGN_g = %lu;\n", d[i].varname, (unsigned long)(d[i].align)); } @@ -462,16 +462,16 @@ H5T_native_open (void)\n\ /*------------------------------------------------------------------------- - * Function: iprint + * Function: iprint * - * Purpose: Prints information about the fields of a floating point - * format. + * Purpose: Prints information about the fields of a floating point + * format. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 13, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 13, 1996 * * Modifications: * @@ -480,26 +480,26 @@ H5T_native_open (void)\n\ static void iprint(detected_t *d) { - int i, j, k, pass; + int i, j, k, pass; for (pass=(d->size-1)/4; pass>=0; --pass) { /* * Print the byte ordering above the bit fields. */ printf(" * "); - for (i=MIN(pass*4+3,d->size-1); i>=pass*4; --i) { - printf ("%4d", d->perm[i]); - if (i>pass*4) fputs (" ", stdout); - } + for (i=MIN(pass*4+3,d->size-1); i>=pass*4; --i) { + printf ("%4d", d->perm[i]); + if (i>pass*4) fputs (" ", stdout); + } /* * Print the bit fields */ printf("\n * "); - for (i=MIN(pass*4+3,d->size-1), - k=MIN(pass*32+31,8*d->size-1); - i>=pass*4; --i) { - for (j=7; j>=0; --j) { + for (i=MIN(pass*4+3,d->size-1), + k=MIN(pass*32+31,8*d->size-1); + i>=pass*4; --i) { + for (j=7; j>=0; --j) { if (k==d->sign && d->msize) { putchar('S'); } else if (k>=d->epos && kepos+d->esize) { @@ -524,36 +524,36 @@ iprint(detected_t *d) * Is there an implicit bit in the mantissa. */ if (d->msize) { - printf(" * Implicit bit? %s\n", d->imp ? "yes" : "no"); + printf(" * Implicit bit? %s\n", d->imp ? "yes" : "no"); } /* * Alignment */ if (0==d->align) { - printf(" * Alignment: NOT CALCULATED\n"); + printf(" * Alignment: NOT CALCULATED\n"); } else if (1==d->align) { - printf(" * Alignment: none\n"); + printf(" * Alignment: none\n"); } else { - printf(" * Alignment: %lu\n", (unsigned long)(d->align)); + printf(" * Alignment: %lu\n", (unsigned long)(d->align)); } } /*------------------------------------------------------------------------- - * Function: byte_cmp + * Function: byte_cmp * - * Purpose: Compares two chunks of memory A and B and returns the - * byte index into those arrays of the first byte that - * differs between A and B. + * Purpose: Compares two chunks of memory A and B and returns the + * byte index into those arrays of the first byte that + * differs between A and B. * - * Return: Success: Index of differing byte. + * Return: Success: Index of differing byte. * - * Failure: -1 if all bytes are the same. + * Failure: -1 if all bytes are the same. * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 12, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 12, 1996 * * Modifications: * @@ -562,9 +562,9 @@ iprint(detected_t *d) static int byte_cmp(int n, void *_a, void *_b) { - register int i; - unsigned char *a = (unsigned char *) _a; - unsigned char *b = (unsigned char *) _b; + register int i; + unsigned char *a = (unsigned char *) _a; + unsigned char *b = (unsigned char *) _b; for (i = 0; i < n; i++) if (a[i] != b[i]) return i; return -1; @@ -572,20 +572,20 @@ byte_cmp(int n, void *_a, void *_b) /*------------------------------------------------------------------------- - * Function: bit_cmp + * Function: bit_cmp * - * Purpose: Compares two bit vectors and returns the index for the - * first bit that differs between the two vectors. The - * size of the vector is NBYTES. PERM is a mapping from - * actual order to little endian. + * Purpose: Compares two bit vectors and returns the index for the + * first bit that differs between the two vectors. The + * size of the vector is NBYTES. PERM is a mapping from + * actual order to little endian. * - * Return: Success: Index of first differing bit. + * Return: Success: Index of first differing bit. * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 13, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 13, 1996 * * Modifications: * @@ -594,41 +594,41 @@ byte_cmp(int n, void *_a, void *_b) static int bit_cmp(int nbytes, int *perm, void *_a, void *_b) { - int i, j; - unsigned char *a = (unsigned char *) _a; - unsigned char *b = (unsigned char *) _b; - unsigned char aa, bb; + int i, j; + unsigned char *a = (unsigned char *) _a; + unsigned char *b = (unsigned char *) _b; + unsigned char aa, bb; for (i = 0; i < nbytes; i++) { - assert(perm[i] < nbytes); - if ((aa = a[perm[i]]) != (bb = b[perm[i]])) { - for (j = 0; j < 8; j++, aa >>= 1, bb >>= 1) { - if ((aa & 1) != (bb & 1)) return i * 8 + j; - } - assert("INTERNAL ERROR" && 0); + assert(perm[i] < nbytes); + if ((aa = a[perm[i]]) != (bb = b[perm[i]])) { + for (j = 0; j < 8; j++, aa >>= 1, bb >>= 1) { + if ((aa & 1) != (bb & 1)) return i * 8 + j; + } + assert("INTERNAL ERROR" && 0); abort(); - } + } } return -1; } /*------------------------------------------------------------------------- - * Function: fix_order + * Function: fix_order * - * Purpose: Given an array PERM with elements FIRST through LAST - * initialized with zero origin byte numbers, this function - * creates a permutation vector that maps the actual order - * of a floating point number to little-endian. + * Purpose: Given an array PERM with elements FIRST through LAST + * initialized with zero origin byte numbers, this function + * creates a permutation vector that maps the actual order + * of a floating point number to little-endian. * - * This function assumes that the mantissa byte ordering - * implies the total ordering. + * This function assumes that the mantissa byte ordering + * implies the total ordering. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 13, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 13, 1996 * * Modifications: * @@ -637,92 +637,92 @@ bit_cmp(int nbytes, int *perm, void *_a, void *_b) static void fix_order(int n, int first, int last, int *perm, const char **mesg) { - int i; + int i; if (first + 1 < last) { - /* - * We have at least three points to consider. - */ - if (perm[last] < perm[last - 1] && perm[last - 1] < perm[last - 2]) { - /* - * Little endian. - */ - if (mesg) *mesg = "Little-endian"; - for (i = 0; i < n; i++) perm[i] = i; - - } else if (perm[last] > perm[last-1] && perm[last-1] > perm[last-2]) { - /* - * Big endian. - */ - if (mesg) *mesg = "Big-endian"; - for (i = 0; i < n; i++) perm[i] = (n - 1) - i; - - } else { - /* - * Bi-endian machines like VAX. - */ - assert(0 == n / 2); - if (mesg) *mesg = "VAX"; - for (i = 0; i < n; i += 2) { - perm[i] = (n - 2) - i; - perm[i + 1] = (n - 1) - i; - } - } + /* + * We have at least three points to consider. + */ + if (perm[last] < perm[last - 1] && perm[last - 1] < perm[last - 2]) { + /* + * Little endian. + */ + if (mesg) *mesg = "Little-endian"; + for (i = 0; i < n; i++) perm[i] = i; + + } else if (perm[last] > perm[last-1] && perm[last-1] > perm[last-2]) { + /* + * Big endian. + */ + if (mesg) *mesg = "Big-endian"; + for (i = 0; i < n; i++) perm[i] = (n - 1) - i; + + } else { + /* + * Bi-endian machines like VAX. + */ + assert(0 == n / 2); + if (mesg) *mesg = "VAX"; + for (i = 0; i < n; i += 2) { + perm[i] = (n - 2) - i; + perm[i + 1] = (n - 1) - i; + } + } } else { - fprintf(stderr, - "Failed to detect byte order of %d-byte floating point.\n", n); - exit(1); + fprintf(stderr, + "Failed to detect byte order of %d-byte floating point.\n", n); + exit(1); } } /*------------------------------------------------------------------------- - * Function: imp_bit - * - * Purpose: Looks for an implicit bit in the mantissa. The value - * of _A should be 1.0 and the value of _B should be 0.5. - * Some floating-point formats discard the most significant - * bit of the mantissa after normalizing since it will always - * be a one (except for 0.0). If this is true for the native - * floating point values stored in _A and _B then the function - * returns non-zero. - * - * This function assumes that the exponent occupies higher - * order bits than the mantissa and that the most significant - * bit of the mantissa is next to the least signficant bit - * of the exponent. - * - * - * Return: Success: Non-zero if the most significant bit - * of the mantissa is discarded (ie, the - * mantissa has an implicit `one' as the - * most significant bit). Otherwise, - * returns zero. - * - * Failure: exit(1) - * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 13, 1996 + * Function: imp_bit + * + * Purpose: Looks for an implicit bit in the mantissa. The value + * of _A should be 1.0 and the value of _B should be 0.5. + * Some floating-point formats discard the most significant + * bit of the mantissa after normalizing since it will always + * be a one (except for 0.0). If this is true for the native + * floating point values stored in _A and _B then the function + * returns non-zero. + * + * This function assumes that the exponent occupies higher + * order bits than the mantissa and that the most significant + * bit of the mantissa is next to the least signficant bit + * of the exponent. + * + * + * Return: Success: Non-zero if the most significant bit + * of the mantissa is discarded (ie, the + * mantissa has an implicit `one' as the + * most significant bit). Otherwise, + * returns zero. + * + * Failure: exit(1) + * + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 13, 1996 * * Modifications: * - * Robb Matzke, 6 Nov 1996 - * Fixed a bug that occurs with non-implicit architectures. + * Robb Matzke, 6 Nov 1996 + * Fixed a bug that occurs with non-implicit architectures. * *------------------------------------------------------------------------- */ static int imp_bit(int n, int *perm, void *_a, void *_b) { - unsigned char *a = (unsigned char *) _a; - unsigned char *b = (unsigned char *) _b; - int changed, major, minor; - int msmb; /*most significant mantissa bit */ + unsigned char *a = (unsigned char *) _a; + unsigned char *b = (unsigned char *) _b; + int changed, major, minor; + int msmb; /*most significant mantissa bit */ /* * Look for the least significant bit that has changed between - * A and B. This is the least significant bit of the exponent. + * A and B. This is the least significant bit of the exponent. */ changed = bit_cmp(n, perm, a, b); assert(changed >= 0); @@ -741,58 +741,58 @@ imp_bit(int n, int *perm, void *_a, void *_b) /*------------------------------------------------------------------------- - * Function: find_bias + * Function: find_bias * - * Purpose: Determines the bias of the exponent. This function should - * be called with _A having a value of `1'. + * Purpose: Determines the bias of the exponent. This function should + * be called with _A having a value of `1'. * - * Return: Success: The exponent bias. + * Return: Success: The exponent bias. * - * Failure: + * Failure: * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 13, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 13, 1996 * * Modifications: * - * Robb Matzke, 6 Nov 1996 - * Fixed a bug with non-implicit architectures returning the - * wrong exponent bias. + * Robb Matzke, 6 Nov 1996 + * Fixed a bug with non-implicit architectures returning the + * wrong exponent bias. * *------------------------------------------------------------------------- */ static unsigned long find_bias(int epos, int esize, int *perm, void *_a) { - unsigned char *a = (unsigned char *) _a; - unsigned char mask; - unsigned long b, shift = 0, nbits, bias = 0; + unsigned char *a = (unsigned char *) _a; + unsigned char mask; + unsigned long b, shift = 0, nbits, bias = 0; while (esize > 0) { - nbits = MIN(esize, (8 - epos % 8)); - mask = (1 << nbits) - 1; - b = (a[perm[epos / 8]] >> (epos % 8)) & mask; - bias |= b << shift; - - shift += nbits; - esize -= nbits; - epos += nbits; + nbits = MIN(esize, (8 - epos % 8)); + mask = (1 << nbits) - 1; + b = (a[perm[epos / 8]] >> (epos % 8)) & mask; + bias |= b << shift; + + shift += nbits; + esize -= nbits; + epos += nbits; } return bias; } /*------------------------------------------------------------------------- - * Function: print_header + * Function: print_header * - * Purpose: Prints the C file header for the generated file. + * Purpose: Prints the C file header for the generated file. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Mar 12 1997 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Mar 12 1997 * * Modifications: * @@ -802,22 +802,22 @@ static void print_header(void) { - time_t now = time(NULL); - struct tm *tm = localtime(&now); - char real_name[30]; - char host_name[256]; - int i; - const char *s; + time_t now = time(NULL); + struct tm *tm = localtime(&now); + char real_name[30]; + char host_name[256]; + int i; + const char *s; #ifdef HAVE_GETPWUID - struct passwd *pwd = NULL; + struct passwd *pwd = NULL; #else int pwd = 1; #endif - static const char *month_name[] = + static const char *month_name[] = { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; - static const char *purpose = "\ + "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; + static const char *purpose = "\ This machine-generated source code contains\n\ information about the various integer and\n\ floating point numeric formats found on this\n\ @@ -829,7 +829,7 @@ Each of the numeric formats listed below are\n\ printed from most significant bit to least\n\ significant bit even though the actual bytes\n\ might be stored in a different order in\n\ -memory. The integers above each binary byte\n\ +memory. The integers above each binary byte\n\ indicate the relative order of the bytes in\n\ memory; little-endian machines have\n\ decreasing numbers while big-endian machines\n\ @@ -840,8 +840,8 @@ letters with `S' for the mantissa sign bit,\n\ `M' for the mantissa magnitude, and `E' for\n\ the exponent. The exponent has an associated\n\ bias which can be subtracted to find the\n\ -true exponent. The radix point is assumed\n\ -to be before the first `M' bit. Any bit\n\ +true exponent. The radix point is assumed\n\ +to be before the first `M' bit. Any bit\n\ of a floating-point value not falling into one\n\ of these categories is printed as a question\n\ mark. Bits of integer types are printed as\n\ @@ -860,20 +860,20 @@ bit.\n"; */ #ifdef HAVE_GETPWUID { - size_t n; - char *comma; - if ((pwd = getpwuid(getuid()))) { - if ((comma = strchr(pwd->pw_gecos, ','))) { - n = MIN(sizeof(real_name)-1, (unsigned)(comma-pwd->pw_gecos)); - strncpy(real_name, pwd->pw_gecos, n); - real_name[n] = '\0'; - } else { - strncpy(real_name, pwd->pw_gecos, sizeof(real_name)); - real_name[sizeof(real_name) - 1] = '\0'; - } - } else { - real_name[0] = '\0'; - } + size_t n; + char *comma; + if ((pwd = getpwuid(getuid()))) { + if ((comma = strchr(pwd->pw_gecos, ','))) { + n = MIN(sizeof(real_name)-1, (unsigned)(comma-pwd->pw_gecos)); + strncpy(real_name, pwd->pw_gecos, n); + real_name[n] = '\0'; + } else { + strncpy(real_name, pwd->pw_gecos, sizeof(real_name)); + real_name[sizeof(real_name) - 1] = '\0'; + } + } else { + real_name[0] = '\0'; + } } #else real_name[0] = '\0'; @@ -884,7 +884,7 @@ bit.\n"; */ #ifdef HAVE_GETHOSTNAME if (gethostname(host_name, sizeof(host_name)) < 0) { - host_name[0] = '\0'; + host_name[0] = '\0'; } #else host_name[0] = '\0'; @@ -894,24 +894,24 @@ bit.\n"; * The file header: warning, copyright notice, build information. */ printf("/* Generated automatically by H5detect -- do not edit */\n\n\n"); - puts(FileHeader); /*the copyright notice--see top of this file */ + puts(FileHeader); /*the copyright notice--see top of this file */ printf(" *\n * Created:\t\t%s %2d, %4d\n", - month_name[tm->tm_mon], tm->tm_mday, 1900 + tm->tm_year); + month_name[tm->tm_mon], tm->tm_mday, 1900 + tm->tm_year); if (pwd || real_name[0] || host_name[0]) { - printf(" *\t\t\t"); - if (real_name[0]) printf("%s <", real_name); + printf(" *\t\t\t"); + if (real_name[0]) printf("%s <", real_name); #ifdef HAVE_GETPWUID - if (pwd) fputs(pwd->pw_name, stdout); + if (pwd) fputs(pwd->pw_name, stdout); #endif - if (host_name[0]) printf("@%s", host_name); - if (real_name[0]) printf(">"); - putchar('\n'); + if (host_name[0]) printf("@%s", host_name); + if (real_name[0]) printf(">"); + putchar('\n'); } printf(" *\n * Purpose:\t\t"); for (s = purpose; *s; s++) { - putchar(*s); - if ('\n' == *s && s[1]) printf(" *\t\t\t"); + putchar(*s); + if ('\n' == *s && s[1]) printf(" *\t\t\t"); } printf(" *\n * Modifications:\n *\n"); @@ -926,17 +926,17 @@ bit.\n"; /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Main entry point. + * Purpose: Main entry point. * - * Return: Success: exit(0) + * Return: Success: exit(0) * - * Failure: exit(1) + * Failure: exit(1) * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 12, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 12, 1996 * * Modifications: * @@ -945,8 +945,8 @@ bit.\n"; int main(void) { - detected_t d[MAXDETECT]; - int nd = 0; + detected_t d[MAXDETECT]; + volatile int nd = 0; #if defined(HAVE_SETSYSINFO) && defined(SSI_NVPAIRS) #if defined(UAC_NOPRINT) && defined(UAC_SIGBUS) @@ -976,15 +976,15 @@ main(void) DETECT_I(unsigned long, ULONG, d[nd]); nd++; #if SIZEOF_LONG_LONG>0 - DETECT_I(long_long, LLONG, d[nd]); nd++; + DETECT_I(long_long, LLONG, d[nd]); nd++; DETECT_I(unsigned long_long, ULLONG, d[nd]); nd++; #else /* * This architecture doesn't support an integer type larger than `long' * so we'll just make H5T_NATIVE_LLONG the same as H5T_NATIVE_LONG. */ - DETECT_I(long, LLONG, d[nd]); nd++; - DETECT_I(unsigned long, ULLONG, d[nd]); nd++; + DETECT_I(long, LLONG, d[nd]); nd++; + DETECT_I(unsigned long, ULLONG, d[nd]); nd++; #endif DETECT_F(float, FLOAT, d[nd]); nd++; @@ -996,7 +996,7 @@ main(void) * isn't supported and use `double' instead. This suppresses warnings on * some systems. */ - DETECT_F(double, LDOUBLE, d[nd]); nd++; + DETECT_F(double, LDOUBLE, d[nd]); nd++; #else DETECT_F(long double, LDOUBLE, d[nd]); nd++; #endif diff --git a/src/Makefile.in b/src/Makefile.in index 42e8b99..6eb4786 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -4,12 +4,16 @@ # All rights reserved. # # -@COMMENCE@ top_srcdir=@top_srcdir@ -TRACE=perl ../bin/trace +top_builddir=.. +srcdir=@srcdir@ +VPATH=.:@srcdir@ +@COMMENCE@ + +TRACE=perl $(top_srcdir)/bin/trace # Add `-I.' to the C preprocessor flags. -CPPFLAGS=-I. @CPPFLAGS@ +CPPFLAGS=-I. -I@srcdir@ @CPPFLAGS@ # This is our main target: LIB=libhdf5.la diff --git a/test/Makefile.in b/test/Makefile.in index 372ba0e..c8d880b 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -4,12 +4,15 @@ # All rights reserved. # # -@COMMENCE@ top_srcdir=@top_srcdir@ +top_builddir=.. +srcdir=@srcdir@ +VPATH=.:@srcdir@ +@COMMENCE@ # Add include directory to the C preprocessor flags and the h5test and hdf5 # libraries to the library list. -CPPFLAGS=-I. -I../src @CPPFLAGS@ +CPPFLAGS=-I. -I$(srcdir) -I../src -I$(top_srcdir)/src @CPPFLAGS@ # These are our main targets. They should be listed in the order to be # executed, generally most specific tests to least specific tests. diff --git a/testpar/Makefile.in b/testpar/Makefile.in index cf20ddd..edad712 100644 --- a/testpar/Makefile.in +++ b/testpar/Makefile.in @@ -4,12 +4,15 @@ # All rights reserved # # -@COMMENCE@ top_srcdir=@top_srcdir@ +top_builddir=.. +srcdir=@srcdir@ +VPATH=.:@srcdir@ +@COMMENCE@ # Add the include directory to the C preprocessor flags the the hdf5 library # to the library list. -CPPFLAGS=-I. -I../src @CPPFLAGS@ +CPPFLAGS=-I. -I$(srcdir) -I../src -I$(top_srcdir)/src @CPPFLAGS@ LIBHDF5=../src/libhdf5.la # These tests are parallel diff --git a/tools/Makefile.in b/tools/Makefile.in index 28ea50b..daed201 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -4,16 +4,19 @@ # All rights reserved. # # -@COMMENCE@ top_srcdir=@top_srcdir@ +top_builddir=.. +srcdir=@srcdir@ +VPATH=.:@srcdir@ +@COMMENCE@ # Add include directory to the C preprocessor flags, add -lh5tools and # -lhdf5 to the list of libraries. -CPPFLAGS=-I../src -I. @CPPFLAGS@ +CPPFLAGS=-I. -I$(srcdir) -I../src -I$(top_srcdir)/src @CPPFLAGS@ # Test programs and scripts. TEST_PROGS= -TEST_SCRIPTS=testh5dump.sh @TESTH5TOH4@ +TEST_SCRIPTS=$(srcdir)/testh5dump.sh @TESTH5TOH4@ # These are our main targets: library and tools. We link this library # statically because some systems can only link executables to a single diff --git a/tools/h5toh4.c b/tools/h5toh4.c index 1568e5b..34cc1c8 100644 --- a/tools/h5toh4.c +++ b/tools/h5toh4.c @@ -78,6 +78,7 @@ main(int argc, char **argv) int status = 0; int status2 = 0; + optind = 1; fargv = argv + optind; argc -= optind; diff --git a/tools/h5tools.c b/tools/h5tools.c index d69a280..1067494 100644 --- a/tools/h5tools.c +++ b/tools/h5tools.c @@ -111,7 +111,9 @@ static void h5dump_sprint(char *s/*out*/, const h5dump_t *info, hid_t type, void *vp) { size_t i, n, offset, size, dims[H5S_MAX_RANK], nelmts; +#ifndef NDEBUG unsigned overflow = 0xaaaaaaaa; +#endif char temp[8192]; char *name, quote='\0'; hid_t memb; diff --git a/tools/testh5dump.sh b/tools/testh5dump.sh index b33987c..c8026cd 100755 --- a/tools/testh5dump.sh +++ b/tools/testh5dump.sh @@ -7,6 +7,12 @@ diff='diff -c' nerrors=0 verbose=yes +# The build (current) directory might be different than the source directory. +if test "X$srcdir" = X; then + srcdir=. +fi +mkdir testfiles >/dev/null 2>&1 + # Print a line-line message left justified in a field of 70 characters # beginning with the word "Testing". TESTING() @@ -27,6 +33,7 @@ DUMP() expect=testfiles/$1 actual="testfiles/`basename $1 .ddl`.out" shift + full=`pwd`/$h5dump # Run test. TESTING $h5dump $@ @@ -34,8 +41,8 @@ DUMP() echo "#############################" echo "Expected output for '$h5dump $@'" echo "#############################" - cd testfiles - ../$h5dump "$@" 2>/dev/null + cd $srcdir/testfiles + $full "$@" 2>/dev/null ) >$actual # Results. We normalize the result to account for different output @@ -43,7 +50,7 @@ DUMP() # differences are in white space. We have to do this the hard way # because diff isn't always smart enough. tr '\n' ' ' <$actual |tr -s ' \t' |fold >$actual-norm - tr '\n' ' ' <$expect |tr -s ' \t' |fold >$expect-norm + tr '\n' ' ' <$srcdir/$expect |tr -s ' \t' |fold >$expect-norm if $cmp $expect-norm $actual-norm; then echo " PASSED" @@ -51,7 +58,7 @@ DUMP() echo "*FAILED*" echo " Actual result (*.out) differs from expected result (*.ddl)" nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $diff $expect $actual |sed 's/^/ /' + test yes = "$verbose" && $diff $srcdir/$expect $actual |sed 's/^/ /' fi # Clean up output file -- cgit v0.12