From 51fd7c574f80ba3031be63c1a88fb08876bf1d93 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 23 Jul 2009 18:10:30 -0500 Subject: [svn-r17233] Description: Bring r17209:17230 from trunk to revise_chunks branch. Tested on: Mac OS X/32 10.5.7 (amazon) debug h5committest not required on this branch --- c++/src/H5Attribute.cpp | 241 +++++++++++++++++++--------------- c++/src/H5Attribute.h | 4 + c++/test/tvlstr.cpp | 74 +++++++++++ configure | 2 +- fortran/test/fortranlib_test.f90 | 2 +- fortran/test/fortranlib_test_1_8.f90 | 2 +- fortran/test/tH5F.f90 | 5 +- hl/tools/gif2h5/Makefile.am | 4 + hl/tools/gif2h5/Makefile.in | 14 +- perform/Makefile.am | 4 + perform/Makefile.in | 14 +- release_docs/RELEASE.txt | 3 + src/H5Dbtree.c | 6 +- src/H5Dchunk.c | 56 ++++++-- src/H5Dearray.c | 15 ++- src/H5Dfarray.c | 1 + src/H5Dpkg.h | 11 +- src/H5I.c | 27 ++-- src/H5Iprivate.h | 2 +- src/H5Ipublic.h | 2 +- src/H5Olayout.c | 23 +--- tools/h5copy/Makefile.am | 3 + tools/h5copy/Makefile.in | 8 +- tools/h5diff/Makefile.am | 3 + tools/h5diff/Makefile.in | 8 +- tools/h5dump/Makefile.am | 3 + tools/h5dump/Makefile.in | 8 +- tools/h5import/Makefile.am | 3 + tools/h5import/Makefile.in | 8 +- tools/h5jam/Makefile.am | 4 + tools/h5jam/Makefile.in | 14 +- tools/h5ls/Makefile.am | 3 + tools/h5ls/Makefile.in | 8 +- tools/h5repack/Makefile.am | 3 + tools/h5repack/Makefile.in | 8 +- tools/h5stat/Makefile.am | 3 + tools/h5stat/Makefile.in | 8 +- tools/lib/h5tools_str.c | 68 +++++----- tools/misc/Makefile.am | 5 + tools/misc/Makefile.in | 20 ++- vms/tools/h5diff/check_h5diff.com | 4 +- vms/tools/h5import/check_h5import.com | 6 +- 42 files changed, 484 insertions(+), 226 deletions(-) diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index a844b77..b1ab73e 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -150,50 +150,6 @@ void Attribute::read( const DataType& mem_type, void *buf ) const } //-------------------------------------------------------------------------- -// Function: Attribute::getInMemDataSize -///\brief Gets the size in memory of the attribute's data. -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -size_t Attribute::getInMemDataSize() const -{ - // Get the data type of this attribute - hid_t mem_type_id = H5Aget_type(id); - if (mem_type_id <= 0) - { - throw AttributeIException("Attribute::getDataSize", "H5Aget_type failed"); - } - - // Get the data type's size - hid_t native_type = H5Tget_native_type(mem_type_id, H5T_DIR_DEFAULT); - if (native_type < 0) - { - throw AttributeIException("Attribute::read", "H5Tget_native_type failed"); - } - size_t type_size = H5Tget_size(native_type); - if (type_size == 0) - { - throw AttributeIException("Attribute::read", "H5Tget_size failed"); - } - - // Get number of elements of the attribute - hid_t space_id = H5Aget_space(id); - if (space_id < 0) - { - throw AttributeIException("Attribute::read", "H5Aget_space failed"); - } - hssize_t num_elements = H5Sget_simple_extent_npoints(space_id); - if (num_elements < 0) - { - throw AttributeIException("Attribute::read", "H5Sget_simple_extent_npoints failed"); - } - - // Calculate and return the size of the data - size_t data_size = type_size * num_elements; - return(data_size); -} - -//-------------------------------------------------------------------------- // Function: Attribute::read ///\brief This is an overloaded member function, provided for convenience. /// It reads a \a H5std_string from this attribute. @@ -206,73 +162,76 @@ size_t Attribute::getInMemDataSize() const // Corrected a misunderstanding that H5Aread would allocate // space for the buffer. Obtained the attribute size and // allocated memory properly. - BMR +// Apr 2009 +// Used getInMemDataSize to get attribute data size. - BMR +// Jul 2009 +// Divided into specific private functions for fixed- and +// variable-len string data: p_read_fixed_len and +// p_read_variable_len. This should improve readability. //-------------------------------------------------------------------------- void Attribute::read(const DataType& mem_type, H5std_string& strg) const { - // Check if this attribute has variable-len string or fixed-len string and // proceed appropriately. htri_t is_variable_len = H5Tis_variable_str(mem_type.getId()); if (is_variable_len < 0) { - throw AttributeIException("Attribute::write", "H5Tis_variable_str failed"); + throw AttributeIException("Attribute::read", "H5Tis_variable_str failed"); } - // Prepare and call C API to read attribute. - char *strg_C; - herr_t ret_value = 0; - size_t attr_size; - if (!is_variable_len) // only allocate for fixed-len string + if (!is_variable_len) // only allocate for fixed-len string { - // Get the size of the attribute's data - attr_size = getInMemDataSize(); - - if (attr_size > 0) - { - strg_C = new char [(size_t)attr_size+1]; - if (strg_C == NULL) - { - throw AttributeIException("Attribute::read", - "Unable to allocate buffer to read the attribute"); - } - ret_value = H5Aread(id, mem_type.getId(), strg_C); - } - else - HDstrcpy(strg_C, ""); + p_read_fixed_len(mem_type, strg); } else { - // no allocation for variable-len string; C library will - ret_value = H5Aread(id, mem_type.getId(), &strg_C); + p_read_variable_len(mem_type, strg); } - if( ret_value < 0 ) +} + +//-------------------------------------------------------------------------- +// Function: Attribute::getInMemDataSize +///\brief Gets the size in memory of the attribute's data. +///\return Size of data (in memory) +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Apr 2009 +//-------------------------------------------------------------------------- +size_t Attribute::getInMemDataSize() const +{ + // Get the data type of this attribute + hid_t mem_type_id = H5Aget_type(id); + if (mem_type_id <= 0) { - if (!is_variable_len) // only de-allocate for fixed-len string - delete []strg_C; - throw AttributeIException("Attribute::read", "H5Aread failed"); + throw AttributeIException("Attribute::getInMemDataSize", "H5Aget_type failed"); } - if( ret_value < 0 ) + // Get the data type's size + hid_t native_type = H5Tget_native_type(mem_type_id, H5T_DIR_DEFAULT); + if (native_type < 0) { - if (!is_variable_len) // only de-allocate for fixed-len string - delete []strg_C; - throw AttributeIException("Attribute::read", "H5Aread failed"); + throw AttributeIException("Attribute::getInMemDataSize", "H5Tget_native_type failed"); + } + size_t type_size = H5Tget_size(native_type); + if (type_size == 0) + { + throw AttributeIException("Attribute::getInMemDataSize", "H5Tget_size failed"); } - // Get string from the C char* and release resource allocated locally - if (!is_variable_len) + // Get number of elements of the attribute + hid_t space_id = H5Aget_space(id); + if (space_id < 0) { - if (strg_C != "") - strg_C[attr_size] = '\0'; - strg = strg_C; - delete []strg_C; + throw AttributeIException("Attribute::getInMemDataSize", "H5Aget_space failed"); } - // Get string from the C char* and release resource allocated by C API - else + hssize_t num_elements = H5Sget_simple_extent_npoints(space_id); + if (num_elements < 0) { - strg = strg_C; - HDfree(strg_C); + throw AttributeIException("Attribute::getInMemDataSize", "H5Sget_simple_extent_npoints failed"); } + + // Calculate and return the size of the data + size_t data_size = type_size * num_elements; + return(data_size); } //-------------------------------------------------------------------------- @@ -300,26 +259,6 @@ DataSpace Attribute::getSpace() const } //-------------------------------------------------------------------------- -// Function: Attribute::p_get_type (private) -// Purpose Gets the datatype of this attribute. -// Return Id of the datatype -// Exception H5::AttributeIException -// Description -// This private function is used in AbstractDs. -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -hid_t Attribute::p_get_type() const -{ - hid_t type_id = H5Aget_type( id ); - if( type_id > 0 ) - return( type_id ); - else - { - throw AttributeIException("", "H5Aget_type failed"); - } -} - -//-------------------------------------------------------------------------- // Function: Attribute::getFileName ///\brief Gets the name of the file, in which this attribute belongs. ///\return File name @@ -441,6 +380,96 @@ hid_t Attribute::getId() const } //-------------------------------------------------------------------------- +// Function: Attribute::p_get_type (private) +// Purpose Gets the datatype of this attribute. +// Return Id of the datatype +// Exception H5::AttributeIException +// Description +// This private function is used in AbstractDs. +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +hid_t Attribute::p_get_type() const +{ + hid_t type_id = H5Aget_type( id ); + if( type_id > 0 ) + return( type_id ); + else + { + throw AttributeIException("", "H5Aget_type failed"); + } +} + +//-------------------------------------------------------------------------- +// Function: Attribute::p_read_fixed_len (private) +// brief Reads a fixed length \a H5std_string from an attribute. +// param mem_type - IN: Attribute datatype (in memory) +// param strg - IN: Buffer for read string +// exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Jul, 2009 +// Modification +// Jul 2009 +// Separated the fixed length case from the original +// Attribute::read +//-------------------------------------------------------------------------- +void Attribute::p_read_fixed_len(const DataType& mem_type, H5std_string& strg) const +{ + // Only allocate for fixed-len string. + + // Get the size of the attribute's data + size_t attr_size = getInMemDataSize(); + + // If there is data, allocate buffer and read it. + if (attr_size > 0) + { + char *strg_C = NULL; + + strg_C = new char [(size_t)attr_size+1]; + herr_t ret_value = H5Aread(id, mem_type.getId(), strg_C); + + if( ret_value < 0 ) + { + delete []strg_C; // de-allocate for fixed-len string + throw AttributeIException("Attribute::read", "H5Aread failed"); + } + + // Get string from the C char* and release resource allocated locally + strg = strg_C; + delete []strg_C; + } +} + +//-------------------------------------------------------------------------- +// Function: Attribute::p_read_variable_len (private) +// brief Reads a variable length \a H5std_string from an attribute. +// param mem_type - IN: Attribute datatype (in memory) +// param strg - IN: Buffer for read string +// exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Jul, 2009 +// Modification +// Jul 2009 +// Separated the variable length case from the original +// Attribute::read +//-------------------------------------------------------------------------- +void Attribute::p_read_variable_len(const DataType& mem_type, H5std_string& strg) const +{ + + // Prepare and call C API to read attribute. + char *strg_C; + + // Read attribute, no allocation for variable-len string; C library will + herr_t ret_value = H5Aread(id, mem_type.getId(), &strg_C); + + if( ret_value < 0 ) + { + throw AttributeIException("Attribute::read", "H5Aread failed"); + } + + // Get string from the C char* and release resource allocated by C API + strg = strg_C; + HDfree(strg_C); +} + +//-------------------------------------------------------------------------- // Function: Attribute::p_setId ///\brief Sets the identifier of this object to a new value. /// diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index 00a08a5..abece10 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -82,6 +82,10 @@ class H5_DLLCPP Attribute : public AbstractDs, public IdComponent { // sub-types virtual hid_t p_get_type() const; + // Reads variable or fixed len strings + void p_read_variable_len(const DataType& mem_type, H5std_string& strg) const; + void p_read_fixed_len(const DataType& mem_type, H5std_string& strg) const; + // do not inherit H5Object::iterateAttrs int iterateAttrs() { return 0; } diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp index 2c22903..0abab1b 100644 --- a/c++/test/tvlstr.cpp +++ b/c++/test/tvlstr.cpp @@ -670,6 +670,77 @@ static void test_read_vl_string_attribute() } } // test_read_vl_string_attribute + +/*------------------------------------------------------------------------- + * Function: test_vl_stringarray_attribute + * + * Purpose: Test writing/reading VL string array to/from attributes. + * + * Return: None + * + * Programmer: Binh-Minh Ribler + * July, 2009 + * + *------------------------------------------------------------------------- + */ +const H5std_string ATTRSTRARR_NAME("StringArray_attr"); + +static void test_vl_stringarray_attribute() +{ + const char *string_att_array[SPACE1_DIM1]= { + "Line 1", "Line 2", "Line 3", "Line 4" + }; // Information to write + + // Output message about test being performed + SUBTEST("Testing writing/reading VL String Array on attribute"); + + try { + // Open the file + H5File file1(FILENAME, H5F_ACC_RDWR); + + // Create a datatype to refer to. + StrType tid1(0, H5T_VARIABLE); + + // Open the root group. + Group root = file1.openGroup("/"); + + // Create dataspace for datasets. + hsize_t dims1[] = {SPACE1_DIM1}; + DataSpace att_space(SPACE1_RANK, dims1); + + // Create an attribute for the root group. + Attribute gr_attr = root.createAttribute(ATTRSTRARR_NAME, tid1, att_space); + + // Write data to the attribute. + gr_attr.write(tid1, string_att_array); + + // Read and verify the attribute string as a string of chars. + // Note: reading by array of H5std_string doesn't work yet. + char *string_att_check[SPACE1_DIM1]; + gr_attr.read(tid1, &string_att_check); + + int ii; + for (ii = 0; ii < SPACE1_DIM1; ii++) + { + if(HDstrcmp(string_att_check[ii], string_att_array[ii])!=0) + TestErrPrintf("Line %d: Attribute data different: written=%s,read=%s\n",__LINE__, string_att_check[ii], string_att_check[ii]); + + HDfree(string_att_check[ii]); // note: no need for std::string test + } + + // Close group's attribute. + gr_attr.close(); + file1.close(); + + PASSED(); + } // end try block + + // Catch all exceptions. + catch (Exception E) { + issue_fail_msg("test_string_attr()", __LINE__, __FILE__, E.getCDetailMsg()); + } +} // test_vl_stringarray_attribute() + /* Helper routine for test_vl_rewrite() */ static void write_scalar_dset(H5File& file, DataType& type, DataSpace& space, char *name, char *data) @@ -823,6 +894,9 @@ void test_vlstrings() test_write_vl_string_attribute(); test_read_vl_string_attribute(); + // Test using VL string array in attributes + test_vl_stringarray_attribute(); + // Test writing VL datasets in files with lots of unlinking test_vl_rewrite(); diff --git a/configure b/configure index 0510b08..a46186c 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Id: configure.in 17135 2009-07-01 17:23:31Z lrknox . +# From configure.in Id: configure.in 17159 2009-07-06 15:42:14Z lrknox . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for HDF5 1.9.44-FA_a2. # diff --git a/fortran/test/fortranlib_test.f90 b/fortran/test/fortranlib_test.f90 index 742e98b..f44e373 100644 --- a/fortran/test/fortranlib_test.f90 +++ b/fortran/test/fortranlib_test.f90 @@ -75,7 +75,7 @@ PROGRAM fortranlibtest 8 CONTINUE ret_total_error = 0 - CALL file_space(cleanup, ret_total_error) + CALL file_space("file_space",cleanup, ret_total_error) CALL write_test_status(ret_total_error, ' File free space test', total_error) ! write(*,*) diff --git a/fortran/test/fortranlib_test_1_8.f90 b/fortran/test/fortranlib_test_1_8.f90 index 6158c16..9ab6743 100644 --- a/fortran/test/fortranlib_test_1_8.f90 +++ b/fortran/test/fortranlib_test_1_8.f90 @@ -51,7 +51,7 @@ PROGRAM fortranlibtest WRITE(*,*) ret_total_error = 0 - CALL file_space(cleanup, ret_total_error) + CALL file_space("file_space_1_8",cleanup, ret_total_error) CALL write_test_status(ret_total_error, & ' Testing file free space', & total_error) diff --git a/fortran/test/tH5F.f90 b/fortran/test/tH5F.f90 index e39d0ee..af2d7d6 100644 --- a/fortran/test/tH5F.f90 +++ b/fortran/test/tH5F.f90 @@ -691,15 +691,14 @@ ! The following subroutine tests h5fget_freespace_f ! - SUBROUTINE file_space(cleanup, total_error) + SUBROUTINE file_space(filename, cleanup, total_error) USE HDF5 ! This module contains all necessary modules IMPLICIT NONE + CHARACTER(*), INTENT(IN) :: filename LOGICAL, INTENT(IN) :: cleanup INTEGER, INTENT(OUT) :: total_error INTEGER :: error - ! - CHARACTER(LEN=10), PARAMETER :: filename = "file_space" CHARACTER(LEN=3), PARAMETER :: grpname = "grp" CHARACTER(LEN=80) :: fix_filename diff --git a/hl/tools/gif2h5/Makefile.am b/hl/tools/gif2h5/Makefile.am index 076b915..f1cec06 100644 --- a/hl/tools/gif2h5/Makefile.am +++ b/hl/tools/gif2h5/Makefile.am @@ -31,6 +31,10 @@ check_SCRIPTS=$(TEST_SCRIPT) bin_PROGRAMS=gif2h5 h52gif noinst_PROGRAMS=h52gifgentst +# Add h52gif and gif2h5 specific linker flags here +h52gif_LDFLAGS = $(LT_STATIC_EXEC) +gif2h5_LDFLAGS = $(LT_STATIC_EXEC) + gif2h5_SOURCES=gif2hdf.c gif2mem.c decompress.c gifread.c writehdf.c h52gif_SOURCES=hdf2gif.c hdfgifwr.c diff --git a/hl/tools/gif2h5/Makefile.in b/hl/tools/gif2h5/Makefile.in index a3de89d..f1ab9e5 100644 --- a/hl/tools/gif2h5/Makefile.in +++ b/hl/tools/gif2h5/Makefile.in @@ -71,10 +71,16 @@ am_gif2h5_OBJECTS = gif2hdf.$(OBJEXT) gif2mem.$(OBJEXT) \ gif2h5_OBJECTS = $(am_gif2h5_OBJECTS) gif2h5_LDADD = $(LDADD) gif2h5_DEPENDENCIES = $(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5) +gif2h5_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(gif2h5_LDFLAGS) \ + $(LDFLAGS) -o $@ am_h52gif_OBJECTS = hdf2gif.$(OBJEXT) hdfgifwr.$(OBJEXT) h52gif_OBJECTS = $(am_h52gif_OBJECTS) h52gif_LDADD = $(LDADD) h52gif_DEPENDENCIES = $(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5) +h52gif_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(h52gif_LDFLAGS) \ + $(LDFLAGS) -o $@ am_h52gifgentst_OBJECTS = h52gifgentst.$(OBJEXT) h52gifgentst_OBJECTS = $(am_h52gifgentst_OBJECTS) h52gifgentst_LDADD = $(LDADD) @@ -352,6 +358,10 @@ INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/tools/lib -I$(top_srcdir)/hl/src # These are our main targets, the tools TEST_SCRIPT = $(srcdir)/h52giftest.sh check_SCRIPTS = $(TEST_SCRIPT) + +# Add h52gif and gif2h5 specific linker flags here +h52gif_LDFLAGS = $(LT_STATIC_EXEC) +gif2h5_LDFLAGS = $(LT_STATIC_EXEC) gif2h5_SOURCES = gif2hdf.c gif2mem.c decompress.c gifread.c writehdf.c h52gif_SOURCES = hdf2gif.c hdfgifwr.c h52gifgentst_SOURCES = h52gifgentst.c @@ -445,10 +455,10 @@ clean-noinstPROGRAMS: done gif2h5$(EXEEXT): $(gif2h5_OBJECTS) $(gif2h5_DEPENDENCIES) @rm -f gif2h5$(EXEEXT) - $(LINK) $(gif2h5_OBJECTS) $(gif2h5_LDADD) $(LIBS) + $(gif2h5_LINK) $(gif2h5_OBJECTS) $(gif2h5_LDADD) $(LIBS) h52gif$(EXEEXT): $(h52gif_OBJECTS) $(h52gif_DEPENDENCIES) @rm -f h52gif$(EXEEXT) - $(LINK) $(h52gif_OBJECTS) $(h52gif_LDADD) $(LIBS) + $(h52gif_LINK) $(h52gif_OBJECTS) $(h52gif_LDADD) $(LIBS) h52gifgentst$(EXEEXT): $(h52gifgentst_OBJECTS) $(h52gifgentst_DEPENDENCIES) @rm -f h52gifgentst$(EXEEXT) $(LINK) $(h52gifgentst_OBJECTS) $(h52gifgentst_LDADD) $(LIBS) diff --git a/perform/Makefile.am b/perform/Makefile.am index 603175d..255275e 100644 --- a/perform/Makefile.am +++ b/perform/Makefile.am @@ -30,6 +30,10 @@ else bin_PROGRAMS=h5perf_serial endif +# Add h5perf and h5perf_serial specific linker flags here +h5perf_LDFLAGS = $(LT_STATIC_EXEC) +h5perf_serial_LDFLAGS = $(LT_STATIC_EXEC) + # Some programs are not built or run by default, but can be built by hand or by # specifying --enable-build-all at configure time. # Also, some of these programs should only be built in parallel. diff --git a/perform/Makefile.in b/perform/Makefile.in index 0d4815d..ee0f090 100644 --- a/perform/Makefile.in +++ b/perform/Makefile.in @@ -88,10 +88,16 @@ am_h5perf_OBJECTS = pio_perf.$(OBJEXT) pio_engine.$(OBJEXT) \ pio_timer.$(OBJEXT) h5perf_OBJECTS = $(am_h5perf_OBJECTS) h5perf_DEPENDENCIES = $(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) +h5perf_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(h5perf_LDFLAGS) \ + $(LDFLAGS) -o $@ am_h5perf_serial_OBJECTS = sio_perf.$(OBJEXT) sio_engine.$(OBJEXT) \ sio_timer.$(OBJEXT) h5perf_serial_OBJECTS = $(am_h5perf_serial_OBJECTS) h5perf_serial_DEPENDENCIES = $(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) +h5perf_serial_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(h5perf_serial_LDFLAGS) $(LDFLAGS) -o $@ iopipe_SOURCES = iopipe.c iopipe_OBJECTS = iopipe.$(OBJEXT) iopipe_DEPENDENCIES = $(LIBH5TEST) $(LIBHDF5) @@ -384,6 +390,10 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/test -I$(top_srcdir)/tools/lib @BUILD_PARALLEL_CONDITIONAL_TRUE@TEST_PROG_PARA = h5perf perf +# Add h5perf and h5perf_serial specific linker flags here +h5perf_LDFLAGS = $(LT_STATIC_EXEC) +h5perf_serial_LDFLAGS = $(LT_STATIC_EXEC) + # Some programs are not built or run by default, but can be built by hand or by # specifying --enable-build-all at configure time. # Also, some of these programs should only be built in parallel. @@ -501,10 +511,10 @@ chunk$(EXEEXT): $(chunk_OBJECTS) $(chunk_DEPENDENCIES) $(LINK) $(chunk_OBJECTS) $(chunk_LDADD) $(LIBS) h5perf$(EXEEXT): $(h5perf_OBJECTS) $(h5perf_DEPENDENCIES) @rm -f h5perf$(EXEEXT) - $(LINK) $(h5perf_OBJECTS) $(h5perf_LDADD) $(LIBS) + $(h5perf_LINK) $(h5perf_OBJECTS) $(h5perf_LDADD) $(LIBS) h5perf_serial$(EXEEXT): $(h5perf_serial_OBJECTS) $(h5perf_serial_DEPENDENCIES) @rm -f h5perf_serial$(EXEEXT) - $(LINK) $(h5perf_serial_OBJECTS) $(h5perf_serial_LDADD) $(LIBS) + $(h5perf_serial_LINK) $(h5perf_serial_OBJECTS) $(h5perf_serial_LDADD) $(LIBS) iopipe$(EXEEXT): $(iopipe_OBJECTS) $(iopipe_DEPENDENCIES) @rm -f iopipe$(EXEEXT) $(LINK) $(iopipe_OBJECTS) $(iopipe_LDADD) $(LIBS) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 4c4f645..ac2fd4e 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -287,6 +287,9 @@ Bug Fixes since HDF5-1.8.0 release Configuration ------------- + - The --enable-static-exec flag has been fixed and will now generate + static executables within the installed bin directory when used. + MAM - 2009/07/23 - BZ #1583 - The --includedir=DIR configuration option now works as intended, and can be used to specify the location to install C header files. The default location remains unchanged, residing at ${prefix}/include. diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index ae96613..63d750a 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -136,7 +136,7 @@ static herr_t H5D_btree_debug_key(FILE *stream, H5F_t *f, hid_t dxpl_id, /* Chunked layout indexing callbacks */ static herr_t H5D_btree_idx_init(const H5D_chk_idx_info_t *idx_info, - haddr_t dset_ohdr_addr); + const H5S_t *space, haddr_t dset_ohdr_addr); static herr_t H5D_btree_idx_create(const H5D_chk_idx_info_t *idx_info); static hbool_t H5D_btree_idx_is_space_alloc(const H5O_layout_t *layout); static herr_t H5D_btree_idx_insert(const H5D_chk_idx_info_t *idx_info, @@ -172,6 +172,7 @@ const H5D_chunk_ops_t H5D_COPS_BTREE[1] = {{ H5D_btree_idx_is_space_alloc, H5D_btree_idx_insert, H5D_btree_idx_get_addr, + NULL, H5D_btree_idx_iterate, H5D_btree_idx_remove, H5D_btree_idx_delete, @@ -846,7 +847,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_btree_idx_init(const H5D_chk_idx_info_t *idx_info, haddr_t UNUSED dset_ohdr_addr) +H5D_btree_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t UNUSED *space, + haddr_t UNUSED dset_ohdr_addr) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index b21c48a..794d678 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -143,7 +143,7 @@ typedef struct H5D_chunk_it_ud3_t { hid_t tid_src; /* Datatype ID for source datatype */ hid_t tid_dst; /* Datatype ID for destination datatype */ hid_t tid_mem; /* Datatype ID for memory datatype */ - H5T_t *dt_src; /* Source datatype */ + const H5T_t *dt_src; /* Source datatype */ H5T_path_t *tpath_src_mem; /* Datatype conversion path from source file to memory */ H5T_path_t *tpath_mem_dst; /* Datatype conversion path from memory to dest. file */ void *reclaim_buf; /* Buffer for reclaiming data */ @@ -152,7 +152,7 @@ typedef struct H5D_chunk_it_ud3_t { H5S_t *buf_space; /* Dataspace describing buffer */ /* needed for compressed variable-length data */ - H5O_pline_t *pline; /* Filter pipeline */ + const H5O_pline_t *pline; /* Filter pipeline */ /* needed for copy object pointed by refs */ H5O_copy_t *cpy_info; /* Copy options */ @@ -190,6 +190,8 @@ H5D_nonexistent_readvv(const H5D_io_info_t *io_info, size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); /* Helper routines */ +static herr_t H5D_chunk_set_info_real(H5O_layout_t *layout, unsigned ndims, + const hsize_t *curr_dims); static void *H5D_chunk_alloc(size_t size, const H5O_pline_t *pline); static void *H5D_chunk_xfree(void *chk, const H5O_pline_t *pline); static herr_t H5D_chunk_cinfo_cache_update(H5D_chunk_cached_t *last, @@ -340,10 +342,14 @@ H5D_chunk_set_info(const H5D_t *dset) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataspace dimensions") H5_ASSIGN_OVERFLOW(ndims, sndims, int, unsigned); - /* Set the layout information */ + /* Set the base layout information */ if(H5D_chunk_set_info_real(&dset->shared->layout, ndims, curr_dims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set layout's chunk info") + /* Call the index's "resize" callback */ + if(dset->shared->layout.u.chunk.ops->resize && (dset->shared->layout.u.chunk.ops->resize)(&dset->shared->layout) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to resize chunk index information") + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_chunk_set_info() */ @@ -497,10 +503,6 @@ H5D_chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id) H5D_chunk_cinfo_cache_reset(&(rdcc->last)); } /* end else */ - /* Set the number of chunks in dataset */ - if(H5D_chunk_set_info(dset) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set # of chunks for dataset") - /* Compose chunked index info struct */ idx_info.f = f; idx_info.dxpl_id = dxpl_id; @@ -508,9 +510,13 @@ H5D_chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id) idx_info.layout = &dset->shared->layout; /* Allocate any indexing structures */ - if(dset->shared->layout.u.chunk.ops->init && (dset->shared->layout.u.chunk.ops->init)(&idx_info, dset->oloc.addr) < 0) + if(dset->shared->layout.u.chunk.ops->init && (dset->shared->layout.u.chunk.ops->init)(&idx_info, dset->shared->space, dset->oloc.addr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize indexing information") + /* Set the number of chunks in dataset */ + if(H5D_chunk_set_info(dset) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set # of chunks for dataset") + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_chunk_init() */ @@ -4186,7 +4192,7 @@ H5D_chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) void *bkg = udata->bkg; /* Background buffer for datatype conversion */ void *buf = udata->buf; /* Chunk buffer for I/O & datatype conversions */ size_t buf_size = udata->buf_size; /* Size of chunk buffer */ - H5O_pline_t *pline = udata->pline; /* I/O pipeline for applying filters */ + const H5O_pline_t *pline = udata->pline; /* I/O pipeline for applying filters */ /* needed for commpressed variable length data */ hbool_t has_filters = FALSE; /* Whether chunk has filters */ @@ -4348,14 +4354,15 @@ done: */ herr_t H5D_chunk_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, - H5O_layout_t *layout_dst, H5T_t *dt_src, H5O_copy_t *cpy_info, - H5O_pline_t *pline_src, hid_t dxpl_id) + H5O_layout_t *layout_dst, const H5S_extent_t *ds_extent_src, + const H5T_t *dt_src, const H5O_pline_t *pline_src, + H5O_copy_t *cpy_info, hid_t dxpl_id) { H5D_chunk_it_ud3_t udata; /* User data for iteration callback */ H5D_chk_idx_info_t idx_info_dst; /* Dest. chunked index info */ H5D_chk_idx_info_t idx_info_src; /* Source chunked index info */ H5O_pline_t _pline; /* Temporary pipeline info */ - H5O_pline_t *pline; /* Pointer to pipeline info to use */ + const H5O_pline_t *pline; /* Pointer to pipeline info to use */ H5T_path_t *tpath_src_mem = NULL, *tpath_mem_dst = NULL; /* Datatype conversion paths */ hid_t tid_src = -1; /* Datatype ID for source datatype */ hid_t tid_dst = -1; /* Datatype ID for destination datatype */ @@ -4391,6 +4398,7 @@ H5D_chunk_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, H5D_COPS_FARRAY == layout_dst->u.chunk.ops) || (H5D_CHUNK_IDX_BTREE == layout_dst->u.chunk.idx_type && H5D_COPS_BTREE == layout_dst->u.chunk.ops)); + HDassert(ds_extent_src); HDassert(dt_src); /* Initialize the temporary pipeline info */ @@ -4401,6 +4409,30 @@ H5D_chunk_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, else pline = pline_src; + /* Layout is not created in the destination file, reset index address */ + if(H5D_chunk_idx_reset(layout_dst, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to reset chunked storage index in dest") + + /* Initialize layout information */ + { + hsize_t curr_dims[H5O_LAYOUT_NDIMS]; /* Curr. size of dataset dimensions */ + int sndims; /* Rank of dataspace */ + unsigned ndims; /* Rank of dataspace */ + + /* Get the dim info for dataset */ + if((sndims = H5S_extent_get_dims(ds_extent_src, curr_dims, NULL)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataspace dimensions") + H5_ASSIGN_OVERFLOW(ndims, sndims, int, unsigned); + + /* Set the source layout chunk information */ + if(H5D_chunk_set_info_real(layout_src, ndims, curr_dims) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set layout's chunk info") + + /* Set the dest. layout chunk info also */ + if(H5D_chunk_set_info_real(layout_dst, ndims, curr_dims) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set layout's chunk info") + } /* end block */ + /* Compose source & dest chunked index info structs */ idx_info_src.f = f_src; idx_info_src.dxpl_id = dxpl_id; diff --git a/src/H5Dearray.c b/src/H5Dearray.c index 9379a87..f859c1c 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -115,7 +115,7 @@ static herr_t H5D_earray_filt_debug(FILE *stream, int indent, int fwidth, /* Chunked layout indexing callbacks */ static herr_t H5D_earray_idx_init(const H5D_chk_idx_info_t *idx_info, - haddr_t dset_ohdr_addr); + const H5S_t *space, haddr_t dset_ohdr_addr); static herr_t H5D_earray_idx_create(const H5D_chk_idx_info_t *idx_info); static hbool_t H5D_earray_idx_is_space_alloc(const H5O_layout_t *layout); static herr_t H5D_earray_idx_insert(const H5D_chk_idx_info_t *idx_info, @@ -155,6 +155,7 @@ const H5D_chunk_ops_t H5D_COPS_EARRAY[1] = {{ H5D_earray_idx_is_space_alloc, H5D_earray_idx_insert, H5D_earray_idx_get_addr, + NULL, H5D_earray_idx_iterate, H5D_earray_idx_remove, H5D_earray_idx_delete, @@ -776,7 +777,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_earray_idx_init(const H5D_chk_idx_info_t *idx_info, haddr_t dset_ohdr_addr) +H5D_earray_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t *space, + haddr_t dset_ohdr_addr) { FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_earray_idx_init) @@ -785,6 +787,7 @@ H5D_earray_idx_init(const H5D_chk_idx_info_t *idx_info, haddr_t dset_ohdr_addr) HDassert(idx_info->f); HDassert(idx_info->pline); HDassert(idx_info->layout); + HDassert(space); HDassert(H5F_addr_defined(dset_ohdr_addr)); /* Store the dataset's object header address for later */ @@ -1760,15 +1763,17 @@ H5D_earray_idx_dest(const H5D_chk_idx_info_t *idx_info) /* Check if the extensible array is open */ if(idx_info->layout->u.chunk.u.earray.ea) { - /* Sanity check */ - HDassert(H5F_addr_defined(idx_info->layout->u.chunk.u.earray.dset_ohdr_addr)); - /* Check for SWMR writes to the file */ if(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE) { + /* Sanity check */ + HDassert(H5F_addr_defined(idx_info->layout->u.chunk.u.earray.dset_ohdr_addr)); + + /* Remove flush dependency between extensible array and dataset' object header */ if(H5D_earray_idx_undepend(idx_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTUNDEPEND, FAIL, "unable to remove flush dependency on object header") } /* end if */ + /* Close extensible array */ if(H5EA_close(idx_info->layout->u.chunk.u.earray.ea, idx_info->dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close extensible array") idx_info->layout->u.chunk.u.earray.ea = NULL; diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c index e5464c6..ba0d64e 100644 --- a/src/H5Dfarray.c +++ b/src/H5Dfarray.c @@ -159,6 +159,7 @@ const H5D_chunk_ops_t H5D_COPS_FARRAY[1] = {{ H5D_farray_idx_is_space_alloc, H5D_farray_idx_insert, H5D_farray_idx_get_addr, + NULL, H5D_farray_idx_iterate, H5D_farray_idx_remove, H5D_farray_idx_delete, diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 1188d36..4479dd0 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -266,13 +266,14 @@ typedef int (*H5D_chunk_cb_func_t)(const H5D_chunk_rec_t *chunk_rec, /* Typedefs for chunk operations */ typedef herr_t (*H5D_chunk_init_func_t)(const H5D_chk_idx_info_t *idx_info, - haddr_t dset_ohdr_addr); + const H5S_t *space, haddr_t dset_ohdr_addr); typedef herr_t (*H5D_chunk_create_func_t)(const H5D_chk_idx_info_t *idx_info); typedef hbool_t (*H5D_chunk_is_space_alloc_func_t)(const H5O_layout_t *layout); typedef herr_t (*H5D_chunk_insert_func_t)(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata); typedef herr_t (*H5D_chunk_get_addr_func_t)(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata); +typedef herr_t (*H5D_chunk_resize_func_t)(H5O_layout_t *layout); typedef int (*H5D_chunk_iterate_func_t)(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t chunk_cb, void *chunk_udata); typedef herr_t (*H5D_chunk_remove_func_t)(const H5D_chk_idx_info_t *idx_info, @@ -301,6 +302,7 @@ typedef struct H5D_chunk_ops_t { H5D_chunk_is_space_alloc_func_t is_space_alloc; /* Query routine to determine if storage/index is allocated */ H5D_chunk_insert_func_t insert; /* Routine to insert a chunk into an index */ H5D_chunk_get_addr_func_t get_addr; /* Routine to retrieve address of chunk in file */ + H5D_chunk_resize_func_t resize; /* Routine to update chunk index info after resizing dataset */ H5D_chunk_iterate_func_t iterate; /* Routine to iterate over chunks */ H5D_chunk_remove_func_t remove; /* Routine to remove a chunk from an index */ H5D_chunk_delete_func_t idx_delete; /* Routine to delete index & all chunks from file*/ @@ -595,8 +597,6 @@ H5_DLL htri_t H5D_chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr, H5_DLL herr_t H5D_chunk_cinfo_cache_reset(H5D_chunk_cached_t *last); H5_DLL herr_t H5D_chunk_create(H5D_t *dset /*in,out*/, hid_t dxpl_id); H5_DLL herr_t H5D_chunk_set_info(const H5D_t *dset); -H5_DLL herr_t H5D_chunk_set_info_real(H5O_layout_t *layout, unsigned ndims, - const hsize_t *curr_dims); H5_DLL herr_t H5D_chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id); H5_DLL hbool_t H5D_chunk_is_space_alloc(const H5O_layout_t *layout); @@ -619,8 +619,9 @@ H5_DLL herr_t H5D_chunk_addrmap(const H5D_io_info_t *io_info, haddr_t chunk_addr #endif /* H5_HAVE_PARALLEL */ H5_DLL herr_t H5D_chunk_update_cache(H5D_t *dset, hid_t dxpl_id); H5_DLL herr_t H5D_chunk_copy(H5F_t *f_src, H5O_layout_t *layout_src, - H5F_t *f_dst, H5O_layout_t *layout_dst, H5T_t *src_dtype, - H5O_copy_t *cpy_info, H5O_pline_t *pline, hid_t dxpl_id); + H5F_t *f_dst, H5O_layout_t *layout_dst, const H5S_extent_t *ds_extent_src, + const H5T_t *dt_src, const H5O_pline_t *pline_src, + H5O_copy_t *cpy_info, hid_t dxpl_id); H5_DLL herr_t H5D_chunk_bh_info(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout, const H5O_pline_t *pline, hsize_t *btree_size); H5_DLL herr_t H5D_chunk_dump_index(H5D_t *dset, hid_t dxpl_id, FILE *stream); diff --git a/src/H5I.c b/src/H5I.c index 841b491..b116424 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -91,7 +91,7 @@ typedef struct H5I_id_info_t { hid_t id; /* ID for this info */ unsigned count; /* ref. count for this atom */ unsigned app_count; /* ref. count of application visible atoms */ - void *obj_ptr; /* pointer associated with the atom */ + const void *obj_ptr; /* pointer associated with the atom */ struct H5I_id_info_t *next; /* link to next atom (in case of hash-clash)*/ } H5I_id_info_t; @@ -609,7 +609,8 @@ H5I_clear_type(H5I_type_t type, hbool_t force, hbool_t app_ref) } /* end if */ /* Check for a 'free' function and call it, if it exists */ - if(type_ptr->free_func && (type_ptr->free_func)(cur->obj_ptr) < 0) { + /* (Casting away const OK -QAK) */ + if(type_ptr->free_func && (type_ptr->free_func)((void *)cur->obj_ptr) < 0) { if(force) { #ifdef H5I_DEBUG if(H5DEBUG(I)) { @@ -782,7 +783,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5Iregister(H5I_type_t type, void *object) +H5Iregister(H5I_type_t type, const void *object) { hid_t ret_value; /* Return value */ @@ -826,7 +827,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5I_register(H5I_type_t type, void *object, hbool_t app_ref) +H5I_register(H5I_type_t type, const void *object, hbool_t app_ref) { H5I_id_type_t *type_ptr; /*ptr to the type */ H5I_id_info_t *id_ptr; /*ptr to the new ID information */ @@ -949,7 +950,8 @@ H5I_object(hid_t id) /* General lookup of the ID */ if(NULL != (id_ptr = H5I_find_id(id))) { /* Get the object pointer to return */ - ret_value = id_ptr->obj_ptr; + /* (Casting away const OK -QAK) */ + ret_value = (void *)id_ptr->obj_ptr; } /* end if */ done: @@ -1028,7 +1030,8 @@ H5I_object_verify(hid_t id, H5I_type_t id_type) /* Verify that the type of the ID is correct & lookup the ID */ if(id_type == H5I_TYPE(id) && NULL != (id_ptr = H5I_find_id(id))) { /* Get the object pointer to return */ - ret_value = id_ptr->obj_ptr; + /* (Casting away const OK -QAK) */ + ret_value = (void *)id_ptr->obj_ptr; } /* end if */ done: @@ -1244,7 +1247,8 @@ H5I_remove(hid_t id) } else { last_id->next = curr_id->next; } - ret_value = curr_id->obj_ptr; + /* (Casting away const OK -QAK) */ + ret_value = (void *)curr_id->obj_ptr; (void)H5FL_FREE(H5I_id_info_t, curr_id); } else { /* couldn't find the ID in the proper place */ @@ -1376,7 +1380,8 @@ H5I_dec_ref(hid_t id, hbool_t app_ref) * Beware: the free method may call other H5I functions. */ if(1 == id_ptr->count) { - if(!type_ptr->free_func || (type_ptr->free_func)(id_ptr->obj_ptr) >= 0) { + /* (Casting away const OK -QAK) */ + if(!type_ptr->free_func || (type_ptr->free_func)((void *)id_ptr->obj_ptr) >= 0) { H5I_remove(id); ret_value = 0; } else { @@ -1982,8 +1987,10 @@ H5I_search(H5I_type_t type, H5I_search_func_t func, void *key, hbool_t app_ref) id_ptr = type_ptr->id_list[i]; while(id_ptr) { next_id = id_ptr->next; /* Protect against ID being deleted in callback */ - if((!app_ref || id_ptr->app_count) && (*func)(id_ptr->obj_ptr, id_ptr->id, key)) - HGOTO_DONE(id_ptr->obj_ptr); /*found the item*/ + /* (Casting away const OK -QAK) */ + if((!app_ref || id_ptr->app_count) && (*func)((void *)id_ptr->obj_ptr, id_ptr->id, key)) + /* (Casting away const OK -QAK) */ + HGOTO_DONE((void *)id_ptr->obj_ptr); /*found the item*/ id_ptr = next_id; } /* end while */ } /* end for */ diff --git a/src/H5Iprivate.h b/src/H5Iprivate.h index 0923af7..475871b 100644 --- a/src/H5Iprivate.h +++ b/src/H5Iprivate.h @@ -54,7 +54,7 @@ H5_DLL H5I_type_t H5I_register_type(H5I_type_t type_id, size_t hash_size, unsign H5_DLL int H5I_nmembers(H5I_type_t type); H5_DLL herr_t H5I_clear_type(H5I_type_t type, hbool_t force, hbool_t app_ref); H5_DLL int H5I_destroy_type(H5I_type_t type); -H5_DLL hid_t H5I_register(H5I_type_t type, void *object, hbool_t app_ref); +H5_DLL hid_t H5I_register(H5I_type_t type, const void *object, hbool_t app_ref); H5_DLL void *H5I_object(hid_t id); H5_DLL void *H5I_object_verify(hid_t id, H5I_type_t id_type); H5_DLL H5I_type_t H5I_get_type(hid_t id); diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h index 608bc9c..d630556 100644 --- a/src/H5Ipublic.h +++ b/src/H5Ipublic.h @@ -77,7 +77,7 @@ extern "C" { /* Public API functions */ -H5_DLL hid_t H5Iregister(H5I_type_t type, void *object); +H5_DLL hid_t H5Iregister(H5I_type_t type, const void *object); H5_DLL void *H5Iobject_verify(hid_t id, H5I_type_t id_type); H5_DLL void *H5Iremove_verify(hid_t id, H5I_type_t id_type); H5_DLL H5I_type_t H5Iget_type(hid_t id); diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 9807488..1c7f3f7 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -738,29 +738,8 @@ H5O_layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, case H5D_CHUNKED: if(H5D_chunk_is_space_alloc(layout_src)) { - hsize_t curr_dims[H5O_LAYOUT_NDIMS]; /* Curr. size of dataset dimensions */ - int sndims; /* Rank of dataspace */ - unsigned ndims; /* Rank of dataspace */ - - /* Layout is not created in the destination file, reset index address */ - if(H5D_chunk_idx_reset(layout_dst, TRUE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to reset chunked storage index in dest") - - /* Get the dim info for dataset */ - if((sndims = H5S_extent_get_dims(udata->src_space_extent, curr_dims, NULL)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, NULL, "can't get dataspace dimensions") - H5_ASSIGN_OVERFLOW(ndims, sndims, int, unsigned); - - /* Set the source layout chunk information */ - if(H5D_chunk_set_info_real(layout_src, ndims, curr_dims) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, NULL, "can't set layout's chunk info") - - /* Set the dest. layout chunk info also */ - if(H5D_chunk_set_info_real(layout_dst, ndims, curr_dims) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, NULL, "can't set layout's chunk info") - /* Create chunked layout */ - if(H5D_chunk_copy(file_src, layout_src, file_dst, layout_dst, udata->src_dtype, cpy_info, udata->src_pline, dxpl_id) < 0) + if(H5D_chunk_copy(file_src, layout_src, file_dst, layout_dst, udata->src_space_extent, udata->src_dtype, udata->src_pline, cpy_info, dxpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to copy chunked storage") } /* if ( H5F_addr_defined(layout_srct->u.chunk.addr)) */ break; diff --git a/tools/h5copy/Makefile.am b/tools/h5copy/Makefile.am index 23432eb..1848972 100644 --- a/tools/h5copy/Makefile.am +++ b/tools/h5copy/Makefile.am @@ -33,6 +33,9 @@ SCRIPT_DEPEND=h5copy$(EXEEXT) bin_PROGRAMS=h5copy check_PROGRAMS=$(TEST_PROG) +# Add h5copy specific linker flags here +h5copy_LDFLAGS = $(LT_STATIC_EXEC) + # source file for the test file generator h5copygentest_SOURCES=h5copygentest.c diff --git a/tools/h5copy/Makefile.in b/tools/h5copy/Makefile.in index 958b30f..8f141a5 100644 --- a/tools/h5copy/Makefile.in +++ b/tools/h5copy/Makefile.in @@ -71,6 +71,9 @@ h5copy_SOURCES = h5copy.c h5copy_OBJECTS = h5copy.$(OBJEXT) h5copy_LDADD = $(LDADD) h5copy_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5) +h5copy_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(h5copy_LDFLAGS) \ + $(LDFLAGS) -o $@ am_h5copygentest_OBJECTS = h5copygentest.$(OBJEXT) h5copygentest_OBJECTS = $(am_h5copygentest_OBJECTS) h5copygentest_LDADD = $(LDADD) @@ -353,6 +356,9 @@ TEST_SCRIPT = $(srcdir)/testh5copy.sh check_SCRIPTS = $(TEST_SCRIPT) SCRIPT_DEPEND = h5copy$(EXEEXT) +# Add h5copy specific linker flags here +h5copy_LDFLAGS = $(LT_STATIC_EXEC) + # source file for the test file generator h5copygentest_SOURCES = h5copygentest.c @@ -444,7 +450,7 @@ clean-checkPROGRAMS: done h5copy$(EXEEXT): $(h5copy_OBJECTS) $(h5copy_DEPENDENCIES) @rm -f h5copy$(EXEEXT) - $(LINK) $(h5copy_OBJECTS) $(h5copy_LDADD) $(LIBS) + $(h5copy_LINK) $(h5copy_OBJECTS) $(h5copy_LDADD) $(LIBS) h5copygentest$(EXEEXT): $(h5copygentest_OBJECTS) $(h5copygentest_DEPENDENCIES) @rm -f h5copygentest$(EXEEXT) $(LINK) $(h5copygentest_OBJECTS) $(h5copygentest_LDADD) $(LIBS) diff --git a/tools/h5diff/Makefile.am b/tools/h5diff/Makefile.am index ed1d106..b56284b 100644 --- a/tools/h5diff/Makefile.am +++ b/tools/h5diff/Makefile.am @@ -33,6 +33,9 @@ endif # Our main target, h5diff bin_PROGRAMS=h5diff $(H5PDIFF) +# Add h5diff specific linker flags here +h5diff_LDFLAGS = $(LT_STATIC_EXEC) + # Test programs and scripts TEST_PROG=h5diffgentest TEST_SCRIPT=$(srcdir)/testh5diff.sh diff --git a/tools/h5diff/Makefile.in b/tools/h5diff/Makefile.in index b83d6ef..e8f4e2f 100644 --- a/tools/h5diff/Makefile.in +++ b/tools/h5diff/Makefile.in @@ -72,6 +72,9 @@ am_h5diff_OBJECTS = h5diff_main.$(OBJEXT) h5diff_common.$(OBJEXT) h5diff_OBJECTS = $(am_h5diff_OBJECTS) h5diff_LDADD = $(LDADD) h5diff_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5) +h5diff_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(h5diff_LDFLAGS) \ + $(LDFLAGS) -o $@ am_h5diffgentest_OBJECTS = h5diffgentest.$(OBJEXT) h5diffgentest_OBJECTS = $(am_h5diffgentest_OBJECTS) h5diffgentest_LDADD = $(LDADD) @@ -360,6 +363,9 @@ INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/tools/lib @BUILD_PARALLEL_CONDITIONAL_TRUE@H5PDIFF = ph5diff @BUILD_PARALLEL_CONDITIONAL_TRUE@TEST_SCRIPT_PARA = $(srcdir)/testph5diff.sh +# Add h5diff specific linker flags here +h5diff_LDFLAGS = $(LT_STATIC_EXEC) + # Test programs and scripts TEST_PROG = h5diffgentest TEST_SCRIPT = $(srcdir)/testh5diff.sh @@ -460,7 +466,7 @@ clean-checkPROGRAMS: done h5diff$(EXEEXT): $(h5diff_OBJECTS) $(h5diff_DEPENDENCIES) @rm -f h5diff$(EXEEXT) - $(LINK) $(h5diff_OBJECTS) $(h5diff_LDADD) $(LIBS) + $(h5diff_LINK) $(h5diff_OBJECTS) $(h5diff_LDADD) $(LIBS) h5diffgentest$(EXEEXT): $(h5diffgentest_OBJECTS) $(h5diffgentest_DEPENDENCIES) @rm -f h5diffgentest$(EXEEXT) $(LINK) $(h5diffgentest_OBJECTS) $(h5diffgentest_LDADD) $(LIBS) diff --git a/tools/h5dump/Makefile.am b/tools/h5dump/Makefile.am index 599c203..992586b 100644 --- a/tools/h5dump/Makefile.am +++ b/tools/h5dump/Makefile.am @@ -34,6 +34,9 @@ SCRIPT_DEPEND=h5dump$(EXEEXT) # Our main target, the h5dump tool. bin_PROGRAMS=h5dump +# Add h5dump specific linker flags here +h5dump_LDFLAGS = $(LT_STATIC_EXEC) + # All the programs depend on the hdf5 and h5tools libraries LDADD=$(LIBH5TOOLS) $(LIBHDF5) diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in index 0d77850..3da4333 100644 --- a/tools/h5dump/Makefile.in +++ b/tools/h5dump/Makefile.in @@ -76,6 +76,9 @@ h5dump_SOURCES = h5dump.c h5dump_OBJECTS = h5dump.$(OBJEXT) h5dump_LDADD = $(LDADD) h5dump_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5) +h5dump_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(h5dump_LDFLAGS) \ + $(LDFLAGS) -o $@ h5dumpgentest_SOURCES = h5dumpgentest.c h5dumpgentest_OBJECTS = h5dumpgentest.$(OBJEXT) h5dumpgentest_LDADD = $(LDADD) @@ -358,6 +361,9 @@ TEST_SCRIPT = testh5dump.sh testh5dumpxml.sh check_SCRIPTS = $(TEST_SCRIPT) SCRIPT_DEPEND = h5dump$(EXEEXT) +# Add h5dump specific linker flags here +h5dump_LDFLAGS = $(LT_STATIC_EXEC) + # All the programs depend on the hdf5 and h5tools libraries LDADD = $(LIBH5TOOLS) $(LIBHDF5) DISTCLEANFILES = testh5dump.sh @@ -454,7 +460,7 @@ binread$(EXEEXT): $(binread_OBJECTS) $(binread_DEPENDENCIES) $(LINK) $(binread_OBJECTS) $(binread_LDADD) $(LIBS) h5dump$(EXEEXT): $(h5dump_OBJECTS) $(h5dump_DEPENDENCIES) @rm -f h5dump$(EXEEXT) - $(LINK) $(h5dump_OBJECTS) $(h5dump_LDADD) $(LIBS) + $(h5dump_LINK) $(h5dump_OBJECTS) $(h5dump_LDADD) $(LIBS) h5dumpgentest$(EXEEXT): $(h5dumpgentest_OBJECTS) $(h5dumpgentest_DEPENDENCIES) @rm -f h5dumpgentest$(EXEEXT) $(LINK) $(h5dumpgentest_OBJECTS) $(h5dumpgentest_LDADD) $(LIBS) diff --git a/tools/h5import/Makefile.am b/tools/h5import/Makefile.am index a88cb36..2202f5f 100644 --- a/tools/h5import/Makefile.am +++ b/tools/h5import/Makefile.am @@ -34,6 +34,9 @@ SCRIPT_DEPEND=h5import$(EXEEXT) # Our main targets bin_PROGRAMS=h5import +# Add h5import specific linker flags here +h5import_LDFLAGS = $(LT_STATIC_EXEC) + # All programs depend on the main hdf5 library and the tools library LDADD=$(LIBH5TOOLS) $(LIBHDF5) diff --git a/tools/h5import/Makefile.in b/tools/h5import/Makefile.in index 9314d90..938a8dd 100755 --- a/tools/h5import/Makefile.in +++ b/tools/h5import/Makefile.in @@ -71,6 +71,9 @@ h5import_SOURCES = h5import.c h5import_OBJECTS = h5import.$(OBJEXT) h5import_LDADD = $(LDADD) h5import_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5) +h5import_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(h5import_LDFLAGS) \ + $(LDFLAGS) -o $@ h5importtest_SOURCES = h5importtest.c h5importtest_OBJECTS = h5importtest.$(OBJEXT) h5importtest_LDADD = $(LDADD) @@ -350,6 +353,9 @@ TEST_SCRIPT = $(srcdir)/h5importtestutil.sh check_SCRIPT = h5importtestutil.sh SCRIPT_DEPEND = h5import$(EXEEXT) +# Add h5import specific linker flags here +h5import_LDFLAGS = $(LT_STATIC_EXEC) + # All programs depend on the main hdf5 library and the tools library LDADD = $(LIBH5TOOLS) $(LIBHDF5) @@ -438,7 +444,7 @@ clean-checkPROGRAMS: done h5import$(EXEEXT): $(h5import_OBJECTS) $(h5import_DEPENDENCIES) @rm -f h5import$(EXEEXT) - $(LINK) $(h5import_OBJECTS) $(h5import_LDADD) $(LIBS) + $(h5import_LINK) $(h5import_OBJECTS) $(h5import_LDADD) $(LIBS) h5importtest$(EXEEXT): $(h5importtest_OBJECTS) $(h5importtest_DEPENDENCIES) @rm -f h5importtest$(EXEEXT) $(LINK) $(h5importtest_OBJECTS) $(h5importtest_LDADD) $(LIBS) diff --git a/tools/h5jam/Makefile.am b/tools/h5jam/Makefile.am index 2fd7e86..d89a2d2 100644 --- a/tools/h5jam/Makefile.am +++ b/tools/h5jam/Makefile.am @@ -27,6 +27,10 @@ bin_PROGRAMS=h5jam h5unjam check_PROGRAMS=tellub h5jamgentest getub TEST_SCRIPT=testh5jam.sh +# Add h5jam and h5unjam specific linker flags here +h5jam_LDFLAGS = $(LT_STATIC_EXEC) +h5unjam_LDFLAGS = $(LT_STATIC_EXEC) + check_SCRIPTS=$(TEST_SCRIPT) SCRIPT_DEPEND=h5jam$(EXEEXT) h5unjam$(EXEEXT) diff --git a/tools/h5jam/Makefile.in b/tools/h5jam/Makefile.in index 87d1c6b..f2dec7d 100644 --- a/tools/h5jam/Makefile.in +++ b/tools/h5jam/Makefile.in @@ -74,6 +74,9 @@ h5jam_SOURCES = h5jam.c h5jam_OBJECTS = h5jam.$(OBJEXT) h5jam_LDADD = $(LDADD) h5jam_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5) +h5jam_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(h5jam_LDFLAGS) \ + $(LDFLAGS) -o $@ h5jamgentest_SOURCES = h5jamgentest.c h5jamgentest_OBJECTS = h5jamgentest.$(OBJEXT) h5jamgentest_LDADD = $(LDADD) @@ -82,6 +85,9 @@ h5unjam_SOURCES = h5unjam.c h5unjam_OBJECTS = h5unjam.$(OBJEXT) h5unjam_LDADD = $(LDADD) h5unjam_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5) +h5unjam_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(h5unjam_LDFLAGS) \ + $(LDFLAGS) -o $@ tellub_SOURCES = tellub.c tellub_OBJECTS = tellub.$(OBJEXT) tellub_LDADD = $(LDADD) @@ -358,6 +364,10 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 *.txt # Include src and tools/lib directories INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/tools/lib TEST_SCRIPT = testh5jam.sh + +# Add h5jam and h5unjam specific linker flags here +h5jam_LDFLAGS = $(LT_STATIC_EXEC) +h5unjam_LDFLAGS = $(LT_STATIC_EXEC) check_SCRIPTS = $(TEST_SCRIPT) SCRIPT_DEPEND = h5jam$(EXEEXT) h5unjam$(EXEEXT) @@ -455,13 +465,13 @@ getub$(EXEEXT): $(getub_OBJECTS) $(getub_DEPENDENCIES) $(LINK) $(getub_OBJECTS) $(getub_LDADD) $(LIBS) h5jam$(EXEEXT): $(h5jam_OBJECTS) $(h5jam_DEPENDENCIES) @rm -f h5jam$(EXEEXT) - $(LINK) $(h5jam_OBJECTS) $(h5jam_LDADD) $(LIBS) + $(h5jam_LINK) $(h5jam_OBJECTS) $(h5jam_LDADD) $(LIBS) h5jamgentest$(EXEEXT): $(h5jamgentest_OBJECTS) $(h5jamgentest_DEPENDENCIES) @rm -f h5jamgentest$(EXEEXT) $(LINK) $(h5jamgentest_OBJECTS) $(h5jamgentest_LDADD) $(LIBS) h5unjam$(EXEEXT): $(h5unjam_OBJECTS) $(h5unjam_DEPENDENCIES) @rm -f h5unjam$(EXEEXT) - $(LINK) $(h5unjam_OBJECTS) $(h5unjam_LDADD) $(LIBS) + $(h5unjam_LINK) $(h5unjam_OBJECTS) $(h5unjam_LDADD) $(LIBS) tellub$(EXEEXT): $(tellub_OBJECTS) $(tellub_DEPENDENCIES) @rm -f tellub$(EXEEXT) $(LINK) $(tellub_OBJECTS) $(tellub_LDADD) $(LIBS) diff --git a/tools/h5ls/Makefile.am b/tools/h5ls/Makefile.am index 439ef07..64e89f1 100644 --- a/tools/h5ls/Makefile.am +++ b/tools/h5ls/Makefile.am @@ -31,6 +31,9 @@ SCRIPT_DEPEND=h5ls$(EXEEXT) # This is our main target, the h5ls tool bin_PROGRAMS=h5ls +# Add h5ls specific linker flags here +h5ls_LDFLAGS = $(LT_STATIC_EXEC) + # All programs depend on the hdf5 and h5tools libraries LDADD=$(LIBH5TOOLS) $(LIBHDF5) diff --git a/tools/h5ls/Makefile.in b/tools/h5ls/Makefile.in index 72fc0bf..c668ecc 100644 --- a/tools/h5ls/Makefile.in +++ b/tools/h5ls/Makefile.in @@ -69,6 +69,9 @@ h5ls_SOURCES = h5ls.c h5ls_OBJECTS = h5ls.$(OBJEXT) h5ls_LDADD = $(LDADD) h5ls_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5) +h5ls_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(h5ls_LDFLAGS) \ + $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles @@ -343,6 +346,9 @@ TEST_SCRIPT = testh5ls.sh check_SCRIPTS = $(TEST_SCRIPT) SCRIPT_DEPEND = h5ls$(EXEEXT) +# Add h5ls specific linker flags here +h5ls_LDFLAGS = $(LT_STATIC_EXEC) + # All programs depend on the hdf5 and h5tools libraries LDADD = $(LIBH5TOOLS) $(LIBHDF5) @@ -426,7 +432,7 @@ clean-binPROGRAMS: done h5ls$(EXEEXT): $(h5ls_OBJECTS) $(h5ls_DEPENDENCIES) @rm -f h5ls$(EXEEXT) - $(LINK) $(h5ls_OBJECTS) $(h5ls_LDADD) $(LIBS) + $(h5ls_LINK) $(h5ls_OBJECTS) $(h5ls_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) diff --git a/tools/h5repack/Makefile.am b/tools/h5repack/Makefile.am index 2c0c0c2..1f811f0 100644 --- a/tools/h5repack/Makefile.am +++ b/tools/h5repack/Makefile.am @@ -36,6 +36,9 @@ SCRIPT_DEPEND=h5repack$(EXEEXT) # Our main target, h5repack tool bin_PROGRAMS=h5repack +# Add h5repack specific linker flags here +h5repack_LDFLAGS = $(LT_STATIC_EXEC) + # Depend on the hdf5 library, the tools library, the test library LDADD=$(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in index 9b559ad..07f8110 100644 --- a/tools/h5repack/Makefile.in +++ b/tools/h5repack/Makefile.in @@ -76,6 +76,9 @@ am_h5repack_OBJECTS = $(am__objects_1) h5repack_main.$(OBJEXT) h5repack_OBJECTS = $(am_h5repack_OBJECTS) h5repack_LDADD = $(LDADD) h5repack_DEPENDENCIES = $(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) +h5repack_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(h5repack_LDFLAGS) \ + $(LDFLAGS) -o $@ am_h5repacktst_OBJECTS = $(am__objects_1) h5repacktst.$(OBJEXT) h5repacktst_OBJECTS = $(am_h5repacktst_OBJECTS) h5repacktst_LDADD = $(LDADD) @@ -367,6 +370,9 @@ TEST_PROG = h5repacktst check_SCRIPTS = $(TEST_SCRIPT) SCRIPT_DEPEND = h5repack$(EXEEXT) +# Add h5repack specific linker flags here +h5repack_LDFLAGS = $(LT_STATIC_EXEC) + # Depend on the hdf5 library, the tools library, the test library LDADD = $(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) @@ -474,7 +480,7 @@ clean-noinstPROGRAMS: done h5repack$(EXEEXT): $(h5repack_OBJECTS) $(h5repack_DEPENDENCIES) @rm -f h5repack$(EXEEXT) - $(LINK) $(h5repack_OBJECTS) $(h5repack_LDADD) $(LIBS) + $(h5repack_LINK) $(h5repack_OBJECTS) $(h5repack_LDADD) $(LIBS) h5repacktst$(EXEEXT): $(h5repacktst_OBJECTS) $(h5repacktst_DEPENDENCIES) @rm -f h5repacktst$(EXEEXT) $(LINK) $(h5repacktst_OBJECTS) $(h5repacktst_LDADD) $(LIBS) diff --git a/tools/h5stat/Makefile.am b/tools/h5stat/Makefile.am index b1c2024..a14172d 100644 --- a/tools/h5stat/Makefile.am +++ b/tools/h5stat/Makefile.am @@ -35,6 +35,9 @@ SCRIPT_DEPEND=h5stat$(EXEEXT) bin_PROGRAMS=h5stat bin_SCRIPTS= +# Add h5stat specific linker flags here +h5stat_LDFLAGS = $(LT_STATIC_EXEC) + # Tell automake to clean h5redeploy script CLEANFILES= diff --git a/tools/h5stat/Makefile.in b/tools/h5stat/Makefile.in index 48957c9..1a0848d 100644 --- a/tools/h5stat/Makefile.in +++ b/tools/h5stat/Makefile.in @@ -72,6 +72,9 @@ h5stat_SOURCES = h5stat.c h5stat_OBJECTS = h5stat.$(OBJEXT) h5stat_LDADD = $(LDADD) h5stat_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5) +h5stat_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(h5stat_LDFLAGS) \ + $(LDFLAGS) -o $@ h5stat_gentest_SOURCES = h5stat_gentest.c h5stat_gentest_OBJECTS = h5stat_gentest.$(OBJEXT) h5stat_gentest_LDADD = $(LDADD) @@ -359,6 +362,9 @@ check_SCRIPTS = $(TEST_SCRIPT) SCRIPT_DEPEND = h5stat$(EXEEXT) bin_SCRIPTS = +# Add h5stat specific linker flags here +h5stat_LDFLAGS = $(LT_STATIC_EXEC) + # Tell automake to clean h5redeploy script CLEANFILES = @@ -455,7 +461,7 @@ clean-checkPROGRAMS: done h5stat$(EXEEXT): $(h5stat_OBJECTS) $(h5stat_DEPENDENCIES) @rm -f h5stat$(EXEEXT) - $(LINK) $(h5stat_OBJECTS) $(h5stat_LDADD) $(LIBS) + $(h5stat_LINK) $(h5stat_OBJECTS) $(h5stat_LDADD) $(LIBS) h5stat_gentest$(EXEEXT): $(h5stat_gentest_OBJECTS) $(h5stat_gentest_DEPENDENCIES) @rm -f h5stat_gentest$(EXEEXT) $(LINK) $(h5stat_gentest_OBJECTS) $(h5stat_gentest_LDADD) $(LIBS) diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index a339acf..08ec5d7 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -125,57 +125,55 @@ h5tools_str_append(h5tools_str_t *str/*in,out*/, const char *fmt, ...) { va_list ap; - va_start(ap, fmt); - /* Make sure we have some memory into which to print */ if (!str->s || str->nalloc <= 0) { - str->nalloc = STR_INIT_LEN; - str->s = malloc(str->nalloc); - assert(str->s); - str->s[0] = '\0'; - str->len = 0; + str->nalloc = STR_INIT_LEN; + str->s = malloc(str->nalloc); + assert(str->s); + str->s[0] = '\0'; + str->len = 0; } if (strlen(fmt) == 0) { /* nothing to print */ - va_end(ap); return str->s; } - /* Format the arguments and append to the value already in `str' */ - while (1) { + /* Format the arguments and append to the value already in `str' */ + while (1) { /* How many bytes available for new value, counting the new NUL */ - size_t avail = str->nalloc - str->len; + size_t avail = str->nalloc - str->len; + int nchars = -1; - int nchars = HDvsnprintf(str->s + str->len, avail, fmt, ap); + va_start(ap, fmt); + nchars = HDvsnprintf(str->s + str->len, avail, fmt, ap); + va_end(ap); - if (nchars<0) { + if (nchars < 0) { /* failure, such as bad format */ - va_end(ap); - return NULL; + return NULL; } - if ((size_t)nchars>=avail || - (0==nchars && (strcmp(fmt,"%s") ))) { - /* Truncation return value as documented by C99, or zero return value with either of the - * following conditions, each of which indicates that the proper C99 return value probably - * should have been positive when the format string is - * something other than "%s" - * Alocate at least twice as much space and try again. - */ - size_t newsize = MAX(str->len+nchars+1, 2*str->nalloc); - assert(newsize > str->nalloc); /*overflow*/ - str->s = realloc(str->s, newsize); - assert(str->s); - str->nalloc = newsize; - } else { - /* Success */ - str->len += nchars; - break; + if ((size_t) nchars >= avail || (0 == nchars && (strcmp(fmt, "%s")))) { + /* Truncation return value as documented by C99, or zero return value with either of the + * following conditions, each of which indicates that the proper C99 return value probably + * should have been positive when the format string is + * something other than "%s" + * Alocate at least twice as much space and try again. + */ + size_t newsize = MAX(str->len+nchars+1, 2*str->nalloc); + assert(newsize > str->nalloc); /*overflow*/ + str->s = realloc(str->s, newsize); + assert(str->s); + str->nalloc = newsize; } - } - va_end(ap); - return str->s; + else { + /* Success */ + str->len += nchars; + break; + } + } + return str->s; } /*------------------------------------------------------------------------- diff --git a/tools/misc/Makefile.am b/tools/misc/Makefile.am index bf180f8..7f78465 100644 --- a/tools/misc/Makefile.am +++ b/tools/misc/Makefile.am @@ -35,6 +35,11 @@ SCRIPT_DEPEND=h5repart$(EXEEXT) h5mkgrp$(EXEEXT) bin_PROGRAMS=h5debug h5repart h5mkgrp bin_SCRIPTS=h5redeploy +# Add h5debug, h5repart, and h5mkgrp specific linker flags here +h5debug_LDFLAGS = $(LT_STATIC_EXEC) +h5repart_LDFLAGS = $(LT_STATIC_EXEC) +h5mkgrp_LDFLAGS = $(LT_STATIC_EXEC) + # Tell automake to clean h5redeploy script CLEANFILES=h5redeploy diff --git a/tools/misc/Makefile.in b/tools/misc/Makefile.in index 4e95b43..d5af2f3 100644 --- a/tools/misc/Makefile.in +++ b/tools/misc/Makefile.in @@ -73,14 +73,23 @@ h5debug_SOURCES = h5debug.c h5debug_OBJECTS = h5debug.$(OBJEXT) h5debug_LDADD = $(LDADD) h5debug_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5) +h5debug_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(h5debug_LDFLAGS) \ + $(LDFLAGS) -o $@ h5mkgrp_SOURCES = h5mkgrp.c h5mkgrp_OBJECTS = h5mkgrp.$(OBJEXT) h5mkgrp_LDADD = $(LDADD) h5mkgrp_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5) +h5mkgrp_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(h5mkgrp_LDFLAGS) \ + $(LDFLAGS) -o $@ h5repart_SOURCES = h5repart.c h5repart_OBJECTS = h5repart.$(OBJEXT) h5repart_LDADD = $(LDADD) h5repart_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5) +h5repart_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(h5repart_LDFLAGS) \ + $(LDFLAGS) -o $@ h5repart_gentest_SOURCES = h5repart_gentest.c h5repart_gentest_OBJECTS = h5repart_gentest.$(OBJEXT) h5repart_gentest_LDADD = $(LDADD) @@ -374,6 +383,11 @@ check_SCRIPTS = $(TEST_SCRIPT) SCRIPT_DEPEND = h5repart$(EXEEXT) h5mkgrp$(EXEEXT) bin_SCRIPTS = h5redeploy +# Add h5debug, h5repart, and h5mkgrp specific linker flags here +h5debug_LDFLAGS = $(LT_STATIC_EXEC) +h5repart_LDFLAGS = $(LT_STATIC_EXEC) +h5mkgrp_LDFLAGS = $(LT_STATIC_EXEC) + # Tell automake to clean h5redeploy script CLEANFILES = h5redeploy @@ -477,13 +491,13 @@ clean-checkPROGRAMS: done h5debug$(EXEEXT): $(h5debug_OBJECTS) $(h5debug_DEPENDENCIES) @rm -f h5debug$(EXEEXT) - $(LINK) $(h5debug_OBJECTS) $(h5debug_LDADD) $(LIBS) + $(h5debug_LINK) $(h5debug_OBJECTS) $(h5debug_LDADD) $(LIBS) h5mkgrp$(EXEEXT): $(h5mkgrp_OBJECTS) $(h5mkgrp_DEPENDENCIES) @rm -f h5mkgrp$(EXEEXT) - $(LINK) $(h5mkgrp_OBJECTS) $(h5mkgrp_LDADD) $(LIBS) + $(h5mkgrp_LINK) $(h5mkgrp_OBJECTS) $(h5mkgrp_LDADD) $(LIBS) h5repart$(EXEEXT): $(h5repart_OBJECTS) $(h5repart_DEPENDENCIES) @rm -f h5repart$(EXEEXT) - $(LINK) $(h5repart_OBJECTS) $(h5repart_LDADD) $(LIBS) + $(h5repart_LINK) $(h5repart_OBJECTS) $(h5repart_LDADD) $(LIBS) h5repart_gentest$(EXEEXT): $(h5repart_gentest_OBJECTS) $(h5repart_gentest_DEPENDENCIES) @rm -f h5repart_gentest$(EXEEXT) $(LINK) $(h5repart_gentest_OBJECTS) $(h5repart_gentest_LDADD) $(LIBS) diff --git a/vms/tools/h5diff/check_h5diff.com b/vms/tools/h5diff/check_h5diff.com index 0773c16..5a0ef46 100644 --- a/vms/tools/h5diff/check_h5diff.com +++ b/vms/tools/h5diff/check_h5diff.com @@ -243,8 +243,8 @@ $! $!# ############################################################################## $!# 6.29 non valid files $!# ############################################################################## -$! -$ CALL TOOLTEST h5diff_629.txt "file1.h6 file2.h6" +$! This test is disabled in the C test script. +$! CALL TOOLTEST h5diff_629.txt "file1.h6 file2.h6" $! $!# ############################################################################## $!# 7. attributes diff --git a/vms/tools/h5import/check_h5import.com b/vms/tools/h5import/check_h5import.com index f25b297..96c2d07 100644 --- a/vms/tools/h5import/check_h5import.com +++ b/vms/tools/h5import/check_h5import.com @@ -64,7 +64,7 @@ $ CALL TOOLTEST "txtuin32.txt -c txtuin32.conf -o" txtuin32.h5 $ ! $ type sys$input Testing ASCII UI16 - rank 2 - Output LE+Chunked+Compressed -$ CALL TOOLTEST "txtuin32.txt -c txtuin16.conf -o" txtuin32.h5 +$ CALL TOOLTEST "txtuin32.txt -c txtuin16.conf -o" txtuin16.h5 $ ! $ type sys$input Testing ASCII F32 - rank 3 - Output LE @@ -115,8 +115,8 @@ $ $ ! Delete temporary files $ del *_out.h5;* $ del *.h5importtxt;* -$ del b*.;* -$ del txti*.;* +$ del b*.h5;* +$ del txti*.h5;* $ del *.dif;* $ ! $ -- cgit v0.12