From 10f1e6acf8916a429f2cc925f49518cfc0015b6c Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 30 Sep 2014 13:20:36 -0500 Subject: [svn-r25640] Purpose: Fixed HDFFV-4259 Description: - Used H5I_INVALID_HID instead of 0 to initialized member "id" in classes that represent HDF5 objects. For PropList, H5P_DEFAULT has to be used instead of H5I_INVALID_HID. - Added try/catch block to some dynamically allocating memory code and re-throw the bad_alloc exception with a message informing the location of the failure. Platforms tested: Linux/ppc64 (ostrich) Linux/32 2.6 (jam) SunOS 5.11 (emu) --- c++/src/H5ArrayType.cpp | 55 ++++++++++++++++++++++++++++++----------------- c++/src/H5Attribute.cpp | 12 +++++------ c++/src/H5CommonFG.cpp | 3 +++ c++/src/H5DataSet.cpp | 8 +++---- c++/src/H5DataSpace.cpp | 2 +- c++/src/H5DataSpace.h | 12 +++++------ c++/src/H5DataType.cpp | 8 +++---- c++/src/H5File.cpp | 8 +++---- c++/src/H5Group.cpp | 8 +++---- c++/src/H5IdComponent.cpp | 4 ++-- c++/src/H5Location.cpp | 3 +++ c++/src/H5PropList.cpp | 6 +++--- 12 files changed, 75 insertions(+), 54 deletions(-) diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index 852658b..5a3f860 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -54,15 +54,18 @@ ArrayType::ArrayType( const hid_t existing_id ) : DataType( existing_id ) rank = H5Tget_array_ndims(existing_id); if (rank < 0) { - throw DataTypeIException("ArrayType overloaded constructor", "H5Tget_array_ndims failed"); + throw DataTypeIException("ArrayType constructor (existing id)", "H5Tget_array_ndims failed"); } - // Get the dimensions of the existing array and store it in this array - dimensions = new hsize_t[rank]; - //hsize_t rdims2[H5S_MAX_RANK]; - int ret_value = H5Tget_array_dims2(id, dimensions); - if (ret_value < 0) - throw DataTypeIException("ArrayType::getArrayDims", "H5Tget_array_dims2 failed"); + // Get the dimensions of the existing array and store it in this array + try { + dimensions = new hsize_t[rank]; + } catch (const std::bad_alloc&) { + throw DataTypeIException("ArrayType constructor (existing id)", "Memory allocation failed"); + } + int ret_value = H5Tget_array_dims2(id, dimensions); + if (ret_value < 0) + throw DataTypeIException("ArrayType constructor (existing id)", "H5Tget_array_dims2 failed"); } //-------------------------------------------------------------------------- @@ -72,10 +75,14 @@ ArrayType::ArrayType( const hid_t existing_id ) : DataType( existing_id ) //-------------------------------------------------------------------------- ArrayType::ArrayType( const ArrayType& original ) : DataType( original ) { - rank = original.rank; - dimensions = new hsize_t[rank]; - for (int i = 0; i < rank; i++) - dimensions[i] = original.dimensions[i]; + rank = original.rank; + try { + dimensions = new hsize_t[rank]; + } catch (const std::bad_alloc&) { + throw DataTypeIException("ArrayType constructor (existing id)", "Memory allocation failed"); + } + for (int i = 0; i < rank; i++) + dimensions[i] = original.dimensions[i]; } //-------------------------------------------------------------------------- @@ -90,14 +97,18 @@ ArrayType::ArrayType( const ArrayType& original ) : DataType( original ) //-------------------------------------------------------------------------- ArrayType::ArrayType(const DataType& base_type, int ndims, const hsize_t* dims) : DataType() { - hid_t new_type_id = H5Tarray_create2(base_type.getId(), ndims, dims); - if (new_type_id < 0) - throw DataTypeIException("ArrayType constructor", "H5Tarray_create2 failed"); - id = new_type_id; - rank = ndims; - dimensions = new hsize_t[rank]; - for (int i = 0; i < rank; i++) - dimensions[i] = dims[i]; + hid_t new_type_id = H5Tarray_create2(base_type.getId(), ndims, dims); + if (new_type_id < 0) + throw DataTypeIException("ArrayType constructor", "H5Tarray_create2 failed"); + id = new_type_id; + rank = ndims; + try { + dimensions = new hsize_t[rank]; + } catch (const std::bad_alloc&) { + throw DataTypeIException("ArrayType constructor (existing id)", "Memory allocation failed"); + } + for (int i = 0; i < rank; i++) + dimensions[i] = dims[i]; } //-------------------------------------------------------------------------- @@ -140,7 +151,11 @@ int ArrayType::getArrayDims(hsize_t* dims) throw DataTypeIException("ArrayType::getArrayDims", "H5Tget_array_dims2 failed"); // store the array's info in memory rank = ndims; - dimensions = new hsize_t[rank]; + try { + dimensions = new hsize_t[rank]; + } catch (const std::bad_alloc&) { + throw DataTypeIException("ArrayType constructor (existing id)", "Memory allocation failed"); + } for (int i = 0; i < rank; i++) dimensions[i] = dims[i]; } diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index bdd0ac0..a9e928d 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -50,7 +50,7 @@ class H5_DLLCPP H5Object; // forward declaration for UserData4Aiterate ///\brief Default constructor: Creates a stub attribute // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- -Attribute::Attribute() : AbstractDs(), IdComponent(), id(0) {} +Attribute::Attribute() : AbstractDs(), IdComponent(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- // Function: Attribute copy constructor @@ -162,13 +162,13 @@ void Attribute::read( const DataType& mem_type, void *buf ) const // Mar 2008 // Corrected a misunderstanding that H5Aread would allocate // space for the buffer. Obtained the attribute size and -// allocated memory properly. - BMR +// allocated memory properly. -BMR // Apr 2009 -// Used getInMemDataSize to get attribute data size. - BMR +// 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. +// p_read_variable_len. This should improve readability. -BMR //-------------------------------------------------------------------------- void Attribute::read(const DataType& mem_type, H5std_string& strg) const { @@ -586,7 +586,7 @@ void Attribute::p_read_fixed_len(const DataType& mem_type, H5std_string& strg) c // Modification // Jul 2009 // Separated the variable length case from the original -// Attribute::read +// Attribute::read. -BMR //-------------------------------------------------------------------------- void Attribute::p_read_variable_len(const DataType& mem_type, H5std_string& strg) const { @@ -650,7 +650,7 @@ void Attribute::close() throw AttributeIException("Attribute::close", "H5Aclose failed"); } // reset the id - id = 0; + id = H5I_INVALID_HID; } } diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index d296db4..8ee88d6 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -33,6 +33,9 @@ #include "H5Alltypes.h" #include "H5private.h" // for HDstrcpy +#include +using namespace std; + // There are a few comments that are common to most of the functions // defined in this file so they are listed here. // - getLocId is called by all functions, that call a C API, to get diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index c34769e..6728264 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -52,7 +52,7 @@ namespace H5 { ///\brief Default constructor: creates a stub DataSet. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataSet::DataSet() : AbstractDs(), H5Object(), id(0) {} +DataSet::DataSet() : AbstractDs(), H5Object(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- // Function: DataSet overloaded constructor @@ -95,7 +95,7 @@ DataSet::DataSet(const DataSet& original) : AbstractDs(original), H5Object(origi // Jul, 2008 // Added for application convenience. //-------------------------------------------------------------------------- -DataSet::DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : AbstractDs(), H5Object(), id(0) +DataSet::DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : AbstractDs(), H5Object(), id(H5I_INVALID_HID) { id = H5Location::p_dereference(loc.getId(), ref, ref_type, plist, "constructor - by dereferenced"); } @@ -114,7 +114,7 @@ DataSet::DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type, co // Jul, 2008 // Added for application convenience. //-------------------------------------------------------------------------- -DataSet::DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : AbstractDs(), H5Object(), id(0) +DataSet::DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : AbstractDs(), H5Object(), id(H5I_INVALID_HID) { id = H5Location::p_dereference(attr.getId(), ref, ref_type, plist, "constructor - by dereference"); } @@ -788,7 +788,7 @@ void DataSet::close() throw DataSetIException("DataSet::close", "H5Dclose failed"); } // reset the id - id = 0; + id = H5I_INVALID_HID; } } diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp index 6ad8c8d..20b4e5e 100644 --- a/c++/src/H5DataSpace.cpp +++ b/c++/src/H5DataSpace.cpp @@ -630,7 +630,7 @@ void DataSpace::close() throw DataSpaceIException("DataSpace::close", "H5Sclose failed"); } // reset the id - id = 0; + id = H5I_INVALID_HID; } } diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h index 9efecdf..b007fd0 100644 --- a/c++/src/H5DataSpace.h +++ b/c++/src/H5DataSpace.h @@ -33,6 +33,12 @@ class H5_DLLCPP DataSpace : public IdComponent { // Creates a simple dataspace DataSpace(int rank, const hsize_t * dims, const hsize_t * maxdims = NULL); + // Creates a DataSpace object using an existing dataspace id. + DataSpace(const hid_t space_id); + + // Copy constructor: makes a copy of the original DataSpace object. + DataSpace(const DataSpace& original); + // Assignment operator DataSpace& operator=( const DataSpace& rhs ); @@ -109,12 +115,6 @@ class H5_DLLCPP DataSpace : public IdComponent { ///\brief Returns this class name. virtual H5std_string fromClass () const { return("DataSpace"); } - // Creates a DataSpace object using an existing dataspace id. - DataSpace(const hid_t space_id); - - // Copy constructor: makes a copy of the original DataSpace object. - DataSpace(const DataSpace& original); - // Gets the dataspace id. virtual hid_t getId() const; diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index afc5678..a435b4e 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -53,7 +53,7 @@ namespace H5 { ///\brief Default constructor: Creates a stub datatype // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataType::DataType() : H5Object(), id(0) {} +DataType::DataType() : H5Object(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- // Function: DataType overloaded constructor @@ -105,7 +105,7 @@ DataType::DataType( const H5T_class_t type_class, size_t size ) : H5Object() // Jul, 2008 // Added for application convenience. //-------------------------------------------------------------------------- -DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(0) +DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID) { id = H5Location::p_dereference(loc.getId(), ref, ref_type, plist, "constructor - by dereference"); } @@ -124,7 +124,7 @@ DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, // Jul, 2008 // Added for application convenience. //-------------------------------------------------------------------------- -DataType::DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(0) +DataType::DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID) { id = H5Location::p_dereference(attr.getId(), ref, ref_type, plist, "constructor - by dereference"); } @@ -710,7 +710,7 @@ void DataType::close() throw DataTypeIException(inMemFunc("close"), "H5Tclose failed"); } // reset the id - id = 0; + id = H5I_INVALID_HID; } } diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index ff00e3b..45e08b2 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -50,7 +50,7 @@ namespace H5 { ///\brief Default constructor: creates a stub H5File object. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5File::H5File() : H5Location(), id(0) {} +H5File::H5File() : H5Location(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- // Function: H5File overloaded constructor @@ -86,7 +86,7 @@ H5File::H5File() : H5Location(), id(0) {} // to catch then re-throw it. -BMR 2013/03/21 // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : H5Location(), id(0) +H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : H5Location(), id(H5I_INVALID_HID) { try { p_get_file(name, flags, create_plist, access_plist); @@ -111,7 +111,7 @@ H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& c // to catch then re-throw it. -BMR 2013/03/21 // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5File::H5File( const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : H5Location(), id(0) +H5File::H5File( const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : H5Location(), id(H5I_INVALID_HID) { try { p_get_file(name.c_str(), flags, create_plist, access_plist); @@ -604,7 +604,7 @@ void H5File::close() throw FileIException("H5File::close", "H5Fclose failed"); } // reset the id - id = 0; + id = H5I_INVALID_HID; } } diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index 7679315..cad5e29 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -51,7 +51,7 @@ namespace H5 { ///\brief Default constructor: creates a stub Group. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Group::Group() : H5Object(), id(0) {} +Group::Group() : H5Object(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- // Function: Group copy constructor @@ -100,7 +100,7 @@ Group::Group(const hid_t existing_id) : H5Object() /// is a datatype that has been named by DataType::commit. // Programmer Binh-Minh Ribler - Oct, 2006 //-------------------------------------------------------------------------- -Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(0) +Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID) { id = H5Location::p_dereference(loc.getId(), ref, ref_type, plist, "constructor - by dereference"); } @@ -115,7 +115,7 @@ Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type, const ///\exception H5::ReferenceException // Programmer Binh-Minh Ribler - Oct, 2006 //-------------------------------------------------------------------------- -Group::Group(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(0) +Group::Group(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID) { id = H5Location::p_dereference(attr.getId(), ref, ref_type, plist, "constructor - by dereference"); } @@ -181,7 +181,7 @@ void Group::close() throw GroupIException("Group::close", "H5Gclose failed"); } // reset the id - id = 0; + id = H5I_INVALID_HID; } } diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index 99a8dc4..64297ee 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -145,7 +145,7 @@ int IdComponent::getCounter() const //-------------------------------------------------------------------------- H5I_type_t IdComponent::getHDFObjType(const hid_t obj_id) { - if (obj_id == 0) + if (obj_id <= 0) return H5I_BADID; // invalid H5I_type_t id_type = H5Iget_type(obj_id); if (id_type <= H5I_BADID || id_type >= H5I_NTYPES) @@ -339,7 +339,7 @@ H5std_string IdComponent::p_get_file_name() const //-------------------------------------------------------------------------- bool IdComponent::p_valid_id(const hid_t obj_id) { - if (obj_id == 0) + if (obj_id <= 0) return false; H5I_type_t id_type = H5Iget_type(obj_id); diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 9d3d7bf..89f10b5 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -33,6 +33,9 @@ #include "H5DataSet.h" #include "H5Attribute.h" #include "H5private.h" // for HDmemset +#include +using namespace std; + #ifndef H5_NO_NAMESPACE namespace H5 { diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index 0b740d8..56743f7 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -46,7 +46,7 @@ const PropList PropList::DEFAULT; ///\brief Default constructor: creates a stub property list object. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -PropList::PropList() : IdComponent(), id(0) {} +PropList::PropList() : IdComponent(), id(H5P_DEFAULT) {} //-------------------------------------------------------------------------- // Function: PropList copy constructor @@ -74,7 +74,7 @@ PropList::PropList(const PropList& original) : IdComponent(original) //-------------------------------------------------------------------------- PropList::PropList( const hid_t plist_id ) : IdComponent() { - if (plist_id == 0) + if (plist_id <= 0) id = H5P_DEFAULT; H5I_type_t id_type = H5Iget_type(plist_id); @@ -277,7 +277,7 @@ void PropList::close() throw PropListIException(inMemFunc("close"), "H5Pclose failed"); } // reset the id - id = 0; + id = H5I_INVALID_HID; } } -- cgit v0.12 From 22d0d32716a588063970a7e412d69a2937118034 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 30 Sep 2014 23:05:57 -0500 Subject: [svn-r25644] Purpose: Fixed HDFFV-8928 Description: Followed hints on the JIRA issue to remove several potential memory leaks. Platforms tested: Linux/ppc64 (ostrich) Linux/32 2.6 (jam) SunOS 5.11 (emu) --- c++/src/H5CommonFG.cpp | 14 ++++++++++++++ c++/src/H5EnumType.cpp | 1 + c++/src/H5Exception.cpp | 6 ++++++ c++/src/H5IdComponent.cpp | 1 + c++/src/H5Location.cpp | 1 + c++/src/H5PropList.cpp | 1 + c++/test/tfile.cpp | 2 +- 7 files changed, 25 insertions(+), 1 deletion(-) diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index 8ee88d6..3aa0386 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -443,7 +443,10 @@ H5std_string CommonFG::getLinkval( const char* name, size_t size ) const ret_value = H5Lget_val(getLocId(), name, value_C, val_size, H5P_DEFAULT); if( ret_value < 0 ) + { + delete []value_C; throwException("getLinkval", "H5Lget_val failed"); + } value = H5std_string(value_C); delete []value_C; @@ -916,6 +919,12 @@ H5std_string CommonFG::getObjnameByIdx(hsize_t idx) const name_len = H5Lget_name_by_idx(getLocId(), ".", H5_INDEX_NAME, H5_ITER_INC, idx, name_C, name_len+1, H5P_DEFAULT); + if (name_len < 0) + { + delete []name_C; + throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); + } + // clean up and return the string H5std_string name = H5std_string(name_C); delete []name_C; @@ -960,10 +969,15 @@ ssize_t CommonFG::getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) char* name_C = new char[size+1]; // temporary C-string for object name HDmemset(name_C, 0, size+1); // clear buffer + // call overloaded function to get the name ssize_t name_len = getObjnameByIdx(idx, name_C, size+1); if(name_len < 0) + { + delete []name_C; throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); + } + // clean up and return the string name = H5std_string(name_C); delete []name_C; return (name_len); diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index 04bb9e0..a91c053 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -159,6 +159,7 @@ H5std_string EnumType::nameOf( void *value, size_t size ) const // If H5Tenum_nameof returns a negative value, raise an exception, if( ret_value < 0 ) { + delete []name_C; throw DataTypeIException("EnumType::nameOf", "H5Tenum_nameof failed"); } // otherwise, create the string to hold the datatype name and return it diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index 5e7ccd4..f153c92 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -80,8 +80,11 @@ H5std_string Exception::getMajorString( hid_t err_major ) const // Check for failure again if( mesg_size < 0 ) + { + delete []mesg_C; throw IdComponentException("Exception::getMajorString", "H5Eget_msg failed"); + } // Convert the C error description and return H5std_string major_str(mesg_C); @@ -116,8 +119,11 @@ H5std_string Exception::getMinorString( hid_t err_minor ) const // Check for failure again if( mesg_size < 0 ) + { + delete []mesg_C; throw IdComponentException("Exception::getMinorString", "H5Eget_msg failed"); + } // Convert the C error description and return H5std_string minor_str(mesg_C); diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index 64297ee..4a9dcac 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -317,6 +317,7 @@ H5std_string IdComponent::p_get_file_name() const // Check for failure again if( name_size < 0 ) { + delete []name_C; throw IdComponentException("", "H5Fget_name failed"); } diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 89f10b5..cd733c4 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -554,6 +554,7 @@ H5std_string H5Location::getComment(const char* name, size_t buf_size) const ssize_t comment_len = getComment(name, tmp_len+1, comment_C); if (comment_len < 0) { + delete []comment_C; throw LocationException("H5Location::getComment", "H5Oget_comment_by_name failed"); } diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index 56743f7..5afe80f 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -402,6 +402,7 @@ H5std_string PropList::getProperty(const char* name) const // Throw exception if H5Pget returns failure if (ret_value < 0) { + delete []prop_strg_C; throw PropListIException(inMemFunc("getProperty"), "H5Pget failed"); } diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp index ecfa8d0..ad5e6fc 100644 --- a/c++/test/tfile.cpp +++ b/c++/test/tfile.cpp @@ -598,7 +598,7 @@ static void test_file_attribute() } // end of try block catch (Exception E) { - issue_fail_msg("test_file_name()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_file_attribute()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_file_attribute() -- cgit v0.12 From 1df7b415ab51697c3e5af31fcfc799c07c0b82b6 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 30 Sep 2014 23:31:37 -0500 Subject: [svn-r25645] Description: Removed the try/block with new/bad_alloc that were unintentionally committed previously. Platforms tested: Linux/ppc64 (ostrich) Linux/32 2.6 (jam) SunOS 5.11 (emu) --- c++/src/H5ArrayType.cpp | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index 5a3f860..8807dca 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -57,12 +57,10 @@ ArrayType::ArrayType( const hid_t existing_id ) : DataType( existing_id ) throw DataTypeIException("ArrayType constructor (existing id)", "H5Tget_array_ndims failed"); } + // Allocate space for the dimensions + dimensions = new hsize_t[rank]; + // Get the dimensions of the existing array and store it in this array - try { - dimensions = new hsize_t[rank]; - } catch (const std::bad_alloc&) { - throw DataTypeIException("ArrayType constructor (existing id)", "Memory allocation failed"); - } int ret_value = H5Tget_array_dims2(id, dimensions); if (ret_value < 0) throw DataTypeIException("ArrayType constructor (existing id)", "H5Tget_array_dims2 failed"); @@ -75,12 +73,11 @@ ArrayType::ArrayType( const hid_t existing_id ) : DataType( existing_id ) //-------------------------------------------------------------------------- ArrayType::ArrayType( const ArrayType& original ) : DataType( original ) { + // Copy the rank of the original array rank = original.rank; - try { - dimensions = new hsize_t[rank]; - } catch (const std::bad_alloc&) { - throw DataTypeIException("ArrayType constructor (existing id)", "Memory allocation failed"); - } + + // Allocate space then copy the dimensions from the original array + dimensions = new hsize_t[rank]; for (int i = 0; i < rank; i++) dimensions[i] = original.dimensions[i]; } @@ -97,16 +94,17 @@ ArrayType::ArrayType( const ArrayType& original ) : DataType( original ) //-------------------------------------------------------------------------- ArrayType::ArrayType(const DataType& base_type, int ndims, const hsize_t* dims) : DataType() { + // Call C API to create an array data type hid_t new_type_id = H5Tarray_create2(base_type.getId(), ndims, dims); if (new_type_id < 0) throw DataTypeIException("ArrayType constructor", "H5Tarray_create2 failed"); + + // Set the id and rank for this object id = new_type_id; rank = ndims; - try { - dimensions = new hsize_t[rank]; - } catch (const std::bad_alloc&) { - throw DataTypeIException("ArrayType constructor (existing id)", "Memory allocation failed"); - } + + // Allocate space then set the dimensions as provided by caller + dimensions = new hsize_t[rank]; for (int i = 0; i < rank; i++) dimensions[i] = dims[i]; } @@ -143,23 +141,19 @@ int ArrayType::getArrayNDims() //-------------------------------------------------------------------------- int ArrayType::getArrayDims(hsize_t* dims) { - // if the array's dimensions have not been stored, retrieve them via C API + // If the array's dimensions have not been stored, retrieve them via C API if (dimensions == NULL) { int ndims = H5Tget_array_dims2(id, dims); if (ndims < 0) throw DataTypeIException("ArrayType::getArrayDims", "H5Tget_array_dims2 failed"); - // store the array's info in memory + // Store the array's info in memory rank = ndims; - try { - dimensions = new hsize_t[rank]; - } catch (const std::bad_alloc&) { - throw DataTypeIException("ArrayType constructor (existing id)", "Memory allocation failed"); - } + dimensions = new hsize_t[rank]; for (int i = 0; i < rank; i++) dimensions[i] = dims[i]; } - // otherwise, simply copy what's in 'dimensions' to 'dims' + // Otherwise, simply copy what's in 'dimensions' to 'dims' for (int i = 0; i < rank; i++) dims[i] = dimensions[i]; return(rank); -- cgit v0.12 From bfdf66356924857ed6b515bbc6a0bc150b2a221e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 1 Oct 2014 09:29:42 -0500 Subject: [svn-r25646] Fix missing endif --- config/cmake/hdf5-config-version.cmake.in | 38 +++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/config/cmake/hdf5-config-version.cmake.in b/config/cmake/hdf5-config-version.cmake.in index 63a730f..5911fa7 100644 --- a/config/cmake/hdf5-config-version.cmake.in +++ b/config/cmake/hdf5-config-version.cmake.in @@ -13,26 +13,26 @@ set (PACKAGE_VERSION "@HDF5_VERSION_STRING@") if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) set(PACKAGE_VERSION_COMPATIBLE FALSE) else() - -if ("${PACKAGE_FIND_VERSION_MAJOR}" STREQUAL "@H5_VERS_MAJOR@") - - # exact match for version @H5_VERS_MAJOR@.@H5_VERS_MINOR@ - if ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@") - - # compatible with any version @H5_VERS_MAJOR@.@H5_VERS_MINOR@.x - set (PACKAGE_VERSION_COMPATIBLE TRUE) + if ("${PACKAGE_FIND_VERSION_MAJOR}" STREQUAL "@H5_VERS_MAJOR@") - if ("${PACKAGE_FIND_VERSION_PATCH}" STREQUAL "@H5_VERS_RELEASE@") - set (PACKAGE_VERSION_EXACT TRUE) - - if ("${PACKAGE_FIND_VERSION_TWEAK}" STREQUAL "@H5_VERS_SUBRELEASE@") - # not using this yet - endif ("${PACKAGE_FIND_VERSION_TWEAK}" STREQUAL "@H5_VERS_SUBRELEASE@") - endif ("${PACKAGE_FIND_VERSION_PATCH}" STREQUAL "@H5_VERS_RELEASE@") - else ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@") - set (PACKAGE_VERSION_COMPATIBLE FALSE) - endif ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@") -endif ("${PACKAGE_FIND_VERSION_MAJOR}" STREQUAL "@H5_VERS_MAJOR@") + # exact match for version @H5_VERS_MAJOR@.@H5_VERS_MINOR@ + if ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@") + + # compatible with any version @H5_VERS_MAJOR@.@H5_VERS_MINOR@.x + set (PACKAGE_VERSION_COMPATIBLE TRUE) + + if ("${PACKAGE_FIND_VERSION_PATCH}" STREQUAL "@H5_VERS_RELEASE@") + set (PACKAGE_VERSION_EXACT TRUE) + + if ("${PACKAGE_FIND_VERSION_TWEAK}" STREQUAL "@H5_VERS_SUBRELEASE@") + # not using this yet + endif ("${PACKAGE_FIND_VERSION_TWEAK}" STREQUAL "@H5_VERS_SUBRELEASE@") + endif ("${PACKAGE_FIND_VERSION_PATCH}" STREQUAL "@H5_VERS_RELEASE@") + else ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@") + set (PACKAGE_VERSION_COMPATIBLE FALSE) + endif ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@") + endif ("${PACKAGE_FIND_VERSION_MAJOR}" STREQUAL "@H5_VERS_MAJOR@") +endif() # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") -- cgit v0.12 From 87bed2c75284cfb13a1e88f34e48103d6614eedc Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Wed, 1 Oct 2014 17:02:41 -0500 Subject: [svn-r25651] Fix for: HDFFV-8715 HDF5_PARAPREFIX is ignored in parallel dense attribute and performance tests. tested on Jam w/ parallel. --- perform/perf.c | 25 +++++++++++++++++++++++-- testpar/t_dset.c | 7 ++++++- testpar/testphdf5.c | 2 +- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/perform/perf.c b/perform/perf.c index f006afb..b7898ff 100644 --- a/perform/perf.c +++ b/perform/perf.c @@ -46,6 +46,9 @@ # include #endif +#ifndef HDF5_PARAPREFIX +# define HDF5_PARAPREFIX "" +#endif /* !HDF5_PARAPREFIX */ /* Macro definitions */ /* Verify: @@ -114,6 +117,8 @@ int main(int argc, char **argv) MPI_File fh; MPI_Status status; int nchars; + const char *prefix; + char *fullname=NULL; herr_t ret; /* Generic return value */ /* startup MPI and determine the rank of this process */ @@ -126,6 +131,20 @@ int main(int argc, char **argv) if (mynod == 0) printf("# Using hdf5-io calls.\n"); + /* create filename with correct prefix using HDF5_PARAPREFIX */ + prefix = HDgetenv("HDF5_PARAPREFIX"); + +#ifdef HDF5_PARAPREFIX + if (!prefix) + prefix = HDF5_PARAPREFIX; +#endif /* HDF5_PARAPREFIX */ + fullname = (char*) malloc(strlen(prefix) + strlen(opt_file) + 2); + if (strlen(prefix) > 0) + { + strcpy(fullname, prefix); + strcat(fullname, "/"); + } + strcat(fullname, opt_file); /* kindof a weird hack- if the location of the pvfstab file was * specified on the command line, then spit out this location into @@ -199,7 +218,7 @@ int main(int argc, char **argv) } /* create the parallel file */ - fid = H5Fcreate(opt_file, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); + fid = H5Fcreate(fullname, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); VRFY((fid >= 0), "H5Fcreate succeeded", H5FATAL); /* define a contiquous dataset of opt_iter*nprocs*opt_block chars */ @@ -261,7 +280,7 @@ int main(int argc, char **argv) MPI_Barrier(MPI_COMM_WORLD); /* reopen the file for reading */ - fid=H5Fopen(opt_file,H5F_ACC_RDONLY,acc_tpl); + fid=H5Fopen(fullname,H5F_ACC_RDONLY,acc_tpl); VRFY((fid >= 0), "", H5FATAL); /* open the dataset */ @@ -382,6 +401,8 @@ die_jar_jar_die: free(tmp); if (opt_correct) free(tmp2); + if(fullname) free(fullname); + MPI_Finalize(); return(0); diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 2bc3b09..281b1c0 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -4365,6 +4365,11 @@ test_dense_attr(void) hid_t atFileSpace, atid; hsize_t atDims[1] = {10000}; herr_t status; + const char *filename; + + /* get filename */ + filename = (const char *)GetTestParameters(); + HDassert( filename != NULL ); /* set up MPI parameters */ MPI_Comm_size(MPI_COMM_WORLD,&mpi_size); @@ -4376,7 +4381,7 @@ test_dense_attr(void) VRFY((status >= 0), "H5Pset_libver_bounds succeeded"); status = H5Pset_fapl_mpio(fpid, MPI_COMM_WORLD, MPI_INFO_NULL); VRFY((status >= 0), "H5Pset_fapl_mpio succeeded"); - fid = H5Fcreate("ph5Dense.h5", H5F_ACC_TRUNC, H5P_DEFAULT, fpid); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fpid); VRFY((fid > 0), "H5Fcreate succeeded"); status = H5Pclose(fpid); VRFY((status >= 0), "H5Pclose succeeded"); diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index df6257f..c55e2de 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -528,7 +528,7 @@ int main(int argc, char **argv) } AddTest("denseattr", test_dense_attr, NULL, - "Store Dense Attributes", NULL); + "Store Dense Attributes", PARATESTFILE); /* Display testing information */ -- cgit v0.12 From cbd0112b16e4da4811226beb03144db4c5ed10d2 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 1 Oct 2014 23:30:53 -0500 Subject: [svn-r25654] Bug fix: HDFFV-8933 Description: Mac has changed to use the clang/clang++ compilers but compiler settings for production, debug and profile were not setup. Solution: Setup default values for PROD_CFLAGS, PROD_CPPFLAGS, DEBUG_CFLAGS, DEBUG_CPPFLAGS. PROFILE_CFLAGS and PROFILE_CPPFLAGS were set too but clang does not -pg or such for profiling. Need to fix it later. Tested: duck, swallow, and quail using --enable-production. --- config/apple | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/config/apple b/config/apple index ac93ea5..be0e9f9 100644 --- a/config/apple +++ b/config/apple @@ -31,6 +31,20 @@ if test "X-" = "X-$CC"; then *) CC=clang CC_BASENAME=clang + + # Production + PROD_CFLAGS="-O3" + PROD_CPPFLAGS="-O3" + + # Debug + DEBUG_CFLAGS="-g -O0" + DEBUG_CPPFLAGS="-g -O0" + + # Profile + # Use this for profiling with gprof + # Just "-g" for now. More later. + PROFILE_CFLAGS="-g" + PROFILE_CPPFLAGS="-g" ;; esac fi -- cgit v0.12 From bd9c6d829acd95ba78b07c8d286eae81d74cd1c9 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Thu, 2 Oct 2014 09:59:01 -0500 Subject: [svn-r25658] Purpose: Fixed HDFFV-8922 Description: Added notes regarding UTF-8 and extended ASCII, provided in HDFFV-8899, to C++ API. Platforms tested: Linux/32 2.6 (jam) - only in comments --- c++/src/H5StrType.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index a906b72..5195bba 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -146,6 +146,13 @@ StrType::StrType( const DataSet& dataset ) : AtomType () ///\brief Retrieves the character set type of this string datatype. ///\return Character set type, which can be: /// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII. +///\note +/// ASCII and UTF-8 Unicode are the only currently supported character +/// encodings. Extended ASCII encodings (for example, ISO 8859) are not +/// supported. This encoding policy is not enforced by the HDF5 Library. +/// Using encodings other than ASCII and UTF-8 can lead to compatibility +/// and usability problems. See the C API entry H5Pset_char_encoding for +/// more information. ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -166,6 +173,13 @@ H5T_cset_t StrType::getCset() const ///\brief Sets character set to be used. ///\param cset - IN: character set type, which can be: /// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII. +///\note +/// ASCII and UTF-8 Unicode are the only currently supported character +/// encodings. Extended ASCII encodings (for example, ISO 8859) are not +/// supported. This encoding policy is not enforced by the HDF5 Library. +/// Using encodings other than ASCII and UTF-8 can lead to compatibility +/// and usability problems. See the C API entry H5Pset_char_encoding for +/// more information. ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -- cgit v0.12 From 26400c392b45a86e385905fd377e34603a31377a Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Thu, 2 Oct 2014 10:56:09 -0500 Subject: [svn-r25659] fix filename generation with prefix for perf test. tested h5commitest, jam & platypus parallel. --- perform/perf.c | 37 ++++++++--------------- test/h5test.c | 94 +++++++++++++++++++++++++++++++++++++++++++++------------- test/h5test.h | 4 +-- 3 files changed, 89 insertions(+), 46 deletions(-) diff --git a/perform/perf.c b/perform/perf.c index b7898ff..7d329f0 100644 --- a/perform/perf.c +++ b/perform/perf.c @@ -46,10 +46,6 @@ # include #endif -#ifndef HDF5_PARAPREFIX -# define HDF5_PARAPREFIX "" -#endif /* !HDF5_PARAPREFIX */ - /* Macro definitions */ /* Verify: * if val is false (0), print mesg and if fatal is true (non-zero), die. @@ -67,6 +63,8 @@ } \ } while(0) #define RANK 1 +#define MAX_PATH 1024 + hsize_t dims[RANK]; /* dataset dim sizes */ hsize_t block[RANK], stride[RANK], count[RANK]; hssize_t start[RANK]; @@ -93,6 +91,11 @@ char opt_file[256] = "perftest.out"; char opt_pvfstab[256] = "notset"; int opt_pvfstab_set = 0; +const char *FILENAME[] = { + opt_file, + NULL +}; + /* function prototypes */ static int parse_args(int argc, char **argv); @@ -117,8 +120,7 @@ int main(int argc, char **argv) MPI_File fh; MPI_Status status; int nchars; - const char *prefix; - char *fullname=NULL; + char filename[MAX_PATH]; herr_t ret; /* Generic return value */ /* startup MPI and determine the rank of this process */ @@ -131,21 +133,6 @@ int main(int argc, char **argv) if (mynod == 0) printf("# Using hdf5-io calls.\n"); - /* create filename with correct prefix using HDF5_PARAPREFIX */ - prefix = HDgetenv("HDF5_PARAPREFIX"); - -#ifdef HDF5_PARAPREFIX - if (!prefix) - prefix = HDF5_PARAPREFIX; -#endif /* HDF5_PARAPREFIX */ - fullname = (char*) malloc(strlen(prefix) + strlen(opt_file) + 2); - if (strlen(prefix) > 0) - { - strcpy(fullname, prefix); - strcat(fullname, "/"); - } - strcat(fullname, opt_file); - /* kindof a weird hack- if the location of the pvfstab file was * specified on the command line, then spit out this location into * the appropriate environment variable: */ @@ -217,8 +204,10 @@ int main(int argc, char **argv) } } + h5_fixname_no_suffix(FILENAME[0], acc_tpl, filename, sizeof filename); + /* create the parallel file */ - fid = H5Fcreate(fullname, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); VRFY((fid >= 0), "H5Fcreate succeeded", H5FATAL); /* define a contiquous dataset of opt_iter*nprocs*opt_block chars */ @@ -280,7 +269,7 @@ int main(int argc, char **argv) MPI_Barrier(MPI_COMM_WORLD); /* reopen the file for reading */ - fid=H5Fopen(fullname,H5F_ACC_RDONLY,acc_tpl); + fid=H5Fopen(filename,H5F_ACC_RDONLY,acc_tpl); VRFY((fid >= 0), "", H5FATAL); /* open the dataset */ @@ -401,7 +390,6 @@ die_jar_jar_die: free(tmp); if (opt_correct) free(tmp2); - if(fullname) free(fullname); MPI_Finalize(); @@ -426,6 +414,7 @@ parse_args(int argc, char **argv) break; case 'f': /* filename */ strncpy(opt_file, optarg, 255); + FILENAME[0] = opt_file; break; case 'p': /* pvfstab file */ strncpy(opt_pvfstab, optarg, 255); diff --git a/test/h5test.c b/test/h5test.c index d25b455..61a9ae0 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -92,6 +92,8 @@ MPI_Info h5_io_info_g=MPI_INFO_NULL;/* MPI INFO object for IO */ static const char *multi_letters = "msbrglo"; static herr_t h5_errors(hid_t estack, void *client_data); +static char * h5_fixname_real(const char *base_name, hid_t fapl, const char *suffix, + char *fullname, size_t size); /*------------------------------------------------------------------------- @@ -268,9 +270,59 @@ h5_reset(void) char * h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) { + return (h5_fixname_real(base_name, fapl, ".h5", fullname, size)); +} + + +/*------------------------------------------------------------------------- + * Function: h5_fixname_no_suffix + * + * Purpose: Same as h5_fixname but with no suffix appended + * + * Return: Success: The FULLNAME pointer. + * + * Failure: NULL if BASENAME or FULLNAME is the null + * pointer or if FULLNAME isn't large enough for + * the result. + * + *------------------------------------------------------------------------- + */ +char * +h5_fixname_no_suffix(const char *base_name, hid_t fapl, char *fullname, size_t size) +{ + return (h5_fixname_real(base_name, fapl, NULL, fullname, size)); +} + + +/*------------------------------------------------------------------------- + * Function: h5_fixname_real + * + * Purpose: Create a file name from a file base name like `test' and + * return it through the FULLNAME (at most SIZE characters + * counting the null terminator). The full name is created by + * prepending the contents of HDF5_PREFIX (separated from the + * base name by a slash) and appending a file extension based on + * the driver supplied, resulting in something like + * `ufs:/u/matzke/test.h5'. + * + * Return: Success: The FULLNAME pointer. + * + * Failure: NULL if BASENAME or FULLNAME is the null + * pointer or if FULLNAME isn't large enough for + * the result. + * + * Programmer: Robb Matzke + * Thursday, November 19, 1998 + * + *------------------------------------------------------------------------- + */ +static char * +h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, + char *fullname, size_t size) +{ const char *prefix = NULL; - const char *suffix = ".h5"; /* suffix has default */ char *ptr, last = '\0'; + const char *suffix = _suffix; size_t i, j; hid_t driver = -1; int isppdriver = 0; /* if the driver is MPI parallel */ @@ -285,10 +337,12 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) if((driver = H5Pget_driver(fapl)) < 0) return NULL; - if(H5FD_FAMILY == driver) - suffix = "%05d.h5"; - else if (H5FD_MULTI == driver) - suffix = NULL; + if(suffix) { + if(H5FD_FAMILY == driver) + suffix = "%05d.h5"; + else if (H5FD_MULTI == driver) + suffix = NULL; + } } /* Must first check fapl is not H5P_DEFAULT (-1) because H5FD_XXX @@ -318,11 +372,11 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) */ if(isppdriver) { #ifdef H5_HAVE_PARALLEL - /* + /* * For parallel: * First use command line option, then the environment * variable, then try the constant - */ + */ static int explained = 0; prefix = (paraprefix ? paraprefix : getenv_all(MPI_COMM_WORLD, 0, "HDF5_PARAPREFIX")); @@ -335,12 +389,12 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) if (mpi_rank == 0) printf("*** Hint ***\n" - "You can use environment variable HDF5_PARAPREFIX to " - "run parallel test files in a\n" - "different directory or to add file type prefix. E.g.,\n" - " HDF5_PARAPREFIX=pfs:/PFS/user/me\n" - " export HDF5_PARAPREFIX\n" - "*** End of Hint ***\n"); + "You can use environment variable HDF5_PARAPREFIX to " + "run parallel test files in a\n" + "different directory or to add file type prefix. E.g.,\n" + " HDF5_PARAPREFIX=pfs:/PFS/user/me\n" + " export HDF5_PARAPREFIX\n" + "*** End of Hint ***\n"); explained = TRUE; #ifdef HDF5_PARAPREFIX @@ -352,7 +406,7 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) /* * For serial: * First use the environment variable, then try the constant - */ + */ prefix = HDgetenv("HDF5_PREFIX"); #ifdef HDF5_PREFIX @@ -425,18 +479,18 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) return NULL; } } else if (HDstrlen(base_name) >= size) { - /* Buffer is too small */ - return NULL; + /* Buffer is too small */ + return NULL; } else { - HDstrcpy(fullname, base_name); - } + HDstrcpy(fullname, base_name); + } /* Append a suffix */ if (suffix) { - if (HDstrlen(fullname) + HDstrlen(suffix) >= size) + if (HDstrlen(fullname) + HDstrlen(suffix) >= size) return NULL; - HDstrcat(fullname, suffix); + HDstrcat(fullname, suffix); } /* Remove any double slashes in the filename */ diff --git a/test/h5test.h b/test/h5test.h index 7813b51..ce224d8 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -142,8 +142,8 @@ extern "C" { /* Generally useful testing routines */ H5TEST_DLL int h5_cleanup(const char *base_name[], hid_t fapl); -H5TEST_DLL char *h5_fixname(const char *base_name, hid_t fapl, char *fullname, - size_t size); +H5TEST_DLL char *h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size); +H5TEST_DLL char *h5_fixname_no_suffix(const char *base_name, hid_t fapl, char *fullname, size_t size); H5TEST_DLL hid_t h5_fileaccess(void); H5TEST_DLL void h5_no_hwconv(void); H5TEST_DLL const char *h5_rmprefix(const char *filename); -- cgit v0.12 From ca6ffd477d11268cb4d37174417befe6506ae47b Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Fri, 3 Oct 2014 10:51:50 -0500 Subject: [svn-r25661] Update the default setting for the memb_addr array when use passes NULL to equally divide all the address space between all the members. Before there was one chunk of the address space not being used. tested h5committest, and multi vfd make check on jam. --- src/H5FDmulti.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 4a62bd8..38097c8 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -491,7 +491,7 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, } if (!memb_addr) { for (mt=H5FD_MEM_DEFAULT; mt Date: Fri, 3 Oct 2014 11:13:55 -0500 Subject: [svn-r25662] Correct packaging paths --- CMakeInstallation.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index a04b06a..beeea60 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -34,7 +34,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- -# Set includess needed for build +# Set includes needed for build #----------------------------------------------------------------------------- set (HDF5_INCLUDES_BUILD_TIME ${HDF5_SRC_DIR} ${HDF5_CPP_SRC_DIR} ${HDF5_HL_SRC_DIR} @@ -52,12 +52,12 @@ set (HDF5_VERSION_MINOR ${HDF5_PACKAGE_VERSION_MINOR}) # Configure the hdf5-config.cmake file for the build directory #----------------------------------------------------------------------------- set(INCLUDE_INSTALL_DIR HDF5_INSTALL_INCLUDE_DIR ) -set(SHARE_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/share" ) +set(SHARE_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_INSTALL_CMAKE_DIR}" ) set(CURRENT_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" ) configure_package_config_file ( ${HDF_RESOURCES_DIR}/hdf5-config.cmake.in "${HDF5_BINARY_DIR}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake" - INSTALL_DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" + INSTALL_DESTINATION "${HDF5_INSTALL_CMAKE_DIR}" PATH_VARS INCLUDE_INSTALL_DIR SHARE_INSTALL_DIR CURRENT_BUILD_DIR INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}" ) @@ -81,12 +81,12 @@ endif (NOT HDF5_EXTERNALLY_CONFIGURED) # Configure the hdf5-config.cmake file for the install directory #----------------------------------------------------------------------------- set(INCLUDE_INSTALL_DIR HDF5_INSTALL_INCLUDE_DIR ) -set(SHARE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/" ) +set(SHARE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${HDF5_INSTALL_CMAKE_DIR}" ) set(CURRENT_BUILD_DIR "${CMAKE_INSTALL_PREFIX}" ) configure_package_config_file ( ${HDF_RESOURCES_DIR}/hdf5-config.cmake.in "${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake" - INSTALL_DESTINATION "${CMAKE_INSTALL_PREFIX}" + INSTALL_DESTINATION "${HDF5_INSTALL_CMAKE_DIR}" PATH_VARS HDF5_INSTALL_INCLUDE_DIR SHARE_INSTALL_DIR CURRENT_BUILD_DIR ) -- cgit v0.12 From e6702f2cae7a549e6b32e609e2fb66623ff7c5b5 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 5 Oct 2014 05:27:58 -0500 Subject: [svn-r25668] Snapshot version 1.9 release 198 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/README.txt b/README.txt index 13786d1..4a44e21 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.198 currently under development +HDF5 version 1.9.199 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 9c932f1..9652b29 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -681,7 +681,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 188 +LT_VERS_REVISION = 189 LT_VERS_AGE = 0 # This is our main target diff --git a/config/lt_vers.am b/config/lt_vers.am index 217f126..37e2480 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 188 +LT_VERS_REVISION = 189 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index a0af921..65eb3f6 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.198. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.199. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.198' -PACKAGE_STRING='HDF5 1.9.198' +PACKAGE_VERSION='1.9.199' +PACKAGE_STRING='HDF5 1.9.199' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1489,7 +1489,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.198 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.199 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1559,7 +1559,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.198:";; + short | recursive ) echo "Configuration of HDF5 1.9.199:";; esac cat <<\_ACEOF @@ -1752,7 +1752,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.198 +HDF5 configure 1.9.199 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2846,7 +2846,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.198, which was +It was created by HDF5 $as_me 1.9.199, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3717,7 +3717,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.198' + VERSION='1.9.199' cat >>confdefs.h <<_ACEOF @@ -31732,7 +31732,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.198 +HDF5 config.lt 1.9.199 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -33874,7 +33874,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.198, which was +This file was extended by HDF5 $as_me 1.9.199, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -33940,7 +33940,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.198 +HDF5 config.status 1.9.199 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 183328a..60b427f 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.198], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.199], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index a38b5ac..f497fe9 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -732,7 +732,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 188 +LT_VERS_REVISION = 189 LT_VERS_AGE = 0 AM_FCLIBS = $(LIBHDF5) diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index e20610b..a07bb23 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -673,7 +673,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 188 +LT_VERS_REVISION = 189 LT_VERS_AGE = 0 # This is our main target diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 499c5bd..362dd63 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -688,7 +688,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 188 +LT_VERS_REVISION = 189 LT_VERS_AGE = 0 # Our main target, the high-level fortran library diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index d7c1d8d..35cdc87 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -669,7 +669,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 188 +LT_VERS_REVISION = 189 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 16f37f2..e662fde 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.198 currently under development +HDF5 version 1.9.199 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index b479fe5..2ec4d37 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -94,10 +94,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 198 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 199 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.198" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.199" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index fa6aa9d..7d61217 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -731,7 +731,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 188 +LT_VERS_REVISION = 189 LT_VERS_AGE = 0 # Our main target, the HDF5 library diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 4506a2e..2be7f2d 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -501,7 +501,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.198" +#define H5_PACKAGE_STRING "HDF5 1.9.199" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -510,7 +510,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.198" +#define H5_PACKAGE_VERSION "1.9.199" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -673,7 +673,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.198" +#define H5_VERSION "1.9.199" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From ab33b7f34dbae5042eb720b106962677157d5c9c Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Mon, 6 Oct 2014 08:27:47 -0500 Subject: [svn-r25670] Update compiler fersion information for XL compilers on ostrich. Text only - no test. This line, and those below, will be ignored-- M RELEASE.txt --- release_docs/RELEASE.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index e662fde..3277ca2 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1190,11 +1190,12 @@ Supported Platforms compilers: Version 14.0.2 (Build 20140120) - Linux 2.6.32-431.11.2.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3) - #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3) - (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3) - IBM XL C/C++ V11.1 - IBM XL Fortran V13.1 + Linux 2.6.32-431.29.2.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) + IBM XL C/C++ V13.1 + IBM XL Fortran V15.1 + Linux 2.6.32-220.23.1.1chaos Intel C, C++, Fortran Compilers ch5.x86_64 GNU/Linux Version 12.1.5.339 (LLNL Aztec) -- cgit v0.12 From 964515961446b6e0968dbe40f0588f9a43e1717e Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Tue, 7 Oct 2014 11:35:58 -0500 Subject: [svn-r25677] HDFFV-8933: Did not provide default values for clang++ options. Also, applied wrong values for the *_CPPFLAGS. Solution: Added default values for *_CXXFLAGS. Fixed the *_CPPFLAGS values. Tested: wren with and without --enable-production. --- config/apple | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/config/apple b/config/apple index be0e9f9..5203695 100644 --- a/config/apple +++ b/config/apple @@ -34,17 +34,17 @@ if test "X-" = "X-$CC"; then # Production PROD_CFLAGS="-O3" - PROD_CPPFLAGS="-O3" + PROD_CPPFLAGS= # Debug DEBUG_CFLAGS="-g -O0" - DEBUG_CPPFLAGS="-g -O0" + DEBUG_CPPFLAGS= # Profile # Use this for profiling with gprof # Just "-g" for now. More later. PROFILE_CFLAGS="-g" - PROFILE_CPPFLAGS="-g" + PROFILE_CPPFLAGS= ;; esac fi @@ -103,6 +103,16 @@ if test "X-" = "X-$CXX"; then esac fi +case $CXX_BASENAME in + clang++) + PROD_CXXFLAGS="-O3" + DEBUG_CXXFLAGS="-g -O0" + # Use this for profiling with gprof + # Just "-g" for now. More later. + PROFILE_CXXFLAGS="-g" + ;; +esac + # compiler version strings case $CC in clang) -- cgit v0.12 From 18f671c064783d4274492106ccd7fa0ab8648621 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Tue, 7 Oct 2014 11:54:54 -0500 Subject: [svn-r25679] Added instruction to run bin/reconfigure after changes. --- config/lt_vers.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/lt_vers.am b/config/lt_vers.am index 37e2480..868261a 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -16,6 +16,8 @@ ## # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. +# After making changes, run bin/reconfigure to update other configure related +# files like Makefile.in. LT_VERS_INTERFACE = 6 LT_VERS_REVISION = 189 LT_VERS_AGE = 0 -- cgit v0.12 From 9a074a6679fa08b6aa07cc9d2599c51ddb22f514 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Thu, 9 Oct 2014 07:42:21 -0500 Subject: [svn-r25685] HDFFV-8932: added C++ and High level interface to the default build. Tested: jam, koala, platypus --- bin/cmakehdf5 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/bin/cmakehdf5 b/bin/cmakehdf5 index 5da3cca..d9d0c03 100755 --- a/bin/cmakehdf5 +++ b/bin/cmakehdf5 @@ -26,6 +26,16 @@ installlog="#${progname}_5install.log" srcdir="../hdf5" # expected source directory exit_code=0 +# Cmake build options +hdf5_src=../hdf5 +cacheinit=$hdf5_src/config/cmake/cacheinit.cmake +build_cpp_lib=-DHDF5_BUILD_CPP_LIB:BOOL=ON # C++ interface default on +build_fortran= #-DHDF5_BUILD_FORTRAN:BOOL=ON # Fortran interface default off +build_hl_lib=-DHDF5_BUILD_HL_LIB:BOOL=ON # High Level interface default on +build_testing=-DBUILD_TESTING:BOOL=ON # Build tests default on +build_tools=-DHDF5_BUILD_TOOLS:BOOL=ON # Build tools default on + + #============= # Function definitions #============= @@ -99,7 +109,13 @@ fi echo Running Cmake for HDF5-${version} ... # 4. Configure the C library, tools and tests with this command: -STEP "Configure..." "cmake -G 'Unix Makefiles' -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ../hdf5" $configlog +STEP "Configure..." "cmake \ + $build_cpp_lib \ + $build_fortran \ + $build_hl_lib \ + $build_testing \ + $build_tools \ + $hdf5_src" $configlog # 5. Build the C library, tools and tests with this command: STEP "Build the library, tools and tests, ..." "cmake --build . --config Release" $makelog -- cgit v0.12