From fdb77dc550cc716e31197fbf86a67524b2ceeafd Mon Sep 17 00:00:00 2001 From: Benjamin A. Beasley Date: Aug 27 2021 18:52:42 +0000 Subject: Update to 2.3.1 (fix RHBZ#1990668, fix RHBZ#1952348) - Drop patches, which were all upstreamed - Switch BR’s to cmake(…) where appropriate - Add -static BR’s for header-only library dependencies - Add unarched -static virtual Provides since arched BR’s must not be used - Use ninja cmake backend (which was already BR’d) - Enable OpenCV (except on armv7hl, for now) - Fix ExcludeArch --- diff --git a/.gitignore b/.gitignore index 98fa6d1..65a5887 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /highfive-2.2.2.tar.gz +/highfive-2.3.1.tar.gz diff --git a/0001-Fix-compiling-invalid-reinterpret_cast-on-32-bit.patch b/0001-Fix-compiling-invalid-reinterpret_cast-on-32-bit.patch new file mode 100644 index 0000000..0c4b598 --- /dev/null +++ b/0001-Fix-compiling-invalid-reinterpret_cast-on-32-bit.patch @@ -0,0 +1,70 @@ +From 8b379f7dd77c3196525cd06ffec1621ca5a373d3 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Thu, 26 Aug 2021 13:24:10 -0400 +Subject: [PATCH] Fix compiling invalid reinterpret_cast on 32-bit + +--- + include/highfive/bits/H5Slice_traits_misc.hpp | 33 +++++++++++++------ + 1 file changed, 23 insertions(+), 10 deletions(-) + +diff --git a/include/highfive/bits/H5Slice_traits_misc.hpp b/include/highfive/bits/H5Slice_traits_misc.hpp +index d5ae746..5b27893 100644 +--- a/include/highfive/bits/H5Slice_traits_misc.hpp ++++ b/include/highfive/bits/H5Slice_traits_misc.hpp +@@ -121,6 +121,28 @@ inline Selection SliceTraits::select(const std::vector& column + return Selection(DataSpace(dims), space, dataset); + } + ++// no data conversion on 64bits platforms ++template ++typename std::enable_if::value>::type ++access_with_conversion(const T*& data, ++ typename std::vector&, ++ const std::size_t, ++ const std::vector& element_ids) { ++ data = reinterpret_cast(&(element_ids[0])); ++} ++ ++// data conversion on 32bits platforms ++template ++typename std::enable_if::value>::type ++access_with_conversion(const T*& data, ++ typename std::vector& raw_elements, ++ const std::size_t length, ++ const std::vector& element_ids) { ++ raw_elements.resize(length); ++ std::copy(element_ids.begin(), element_ids.end(), raw_elements.begin()); ++ data = raw_elements.data(); ++} ++ + template + inline Selection SliceTraits::select(const ElementSet& elements) const { + const auto& slice = static_cast(*this); +@@ -135,15 +157,7 @@ inline Selection SliceTraits::select(const ElementSet& elements) const + std::vector raw_elements; + + // optimised at compile time +- // switch for data conversion on 32bits platforms +- if (std::is_same::value) { +- // `if constexpr` can't be used, thus a reinterpret_cast is needed. +- data = reinterpret_cast(&(elements._ids[0])); +- } else { +- raw_elements.resize(length); +- std::copy(elements._ids.begin(), elements._ids.end(), raw_elements.begin()); +- data = raw_elements.data(); +- } ++ access_with_conversion<>(data, raw_elements, length, elements._ids); + + if (H5Sselect_elements(space.getId(), H5S_SELECT_SET, num_elements, data) < 0) { + HDF5ErrMapper::ToException("Unable to select elements"); +@@ -152,7 +166,6 @@ inline Selection SliceTraits::select(const ElementSet& elements) const + return Selection(DataSpace(num_elements), space, details::get_dataset(slice)); + } + +- + template + template + inline void SliceTraits::read(T& array) const { +-- +2.31.1 + diff --git a/0001-Use-std-move-in-NRVO-depending-of-version-of-GCC-375.patch b/0001-Use-std-move-in-NRVO-depending-of-version-of-GCC-375.patch deleted file mode 100644 index 2104dcc..0000000 --- a/0001-Use-std-move-in-NRVO-depending-of-version-of-GCC-375.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 7434d54b84ce54fae950d505de4ff0d772f63e94 Mon Sep 17 00:00:00 2001 -From: Nicolas Cornu -Date: Fri, 25 Sep 2020 17:14:11 +0200 -Subject: [PATCH] Use std::move in NRVO depending of version of GCC (#375) - -Before version 10, GCC warns if not used. -After version 10, GCC warns if used. ---- - include/highfive/bits/H5Reference_misc.hpp | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/include/highfive/bits/H5Reference_misc.hpp b/include/highfive/bits/H5Reference_misc.hpp -index 7c892c1..b4aea3e 100644 ---- a/include/highfive/bits/H5Reference_misc.hpp -+++ b/include/highfive/bits/H5Reference_misc.hpp -@@ -43,7 +43,11 @@ inline T Reference::dereference(const Object& location) const { - HDF5ErrMapper::ToException( - "Trying to dereference the wrong type"); - } -+#if defined __GNUC__ && __GNUC__ < 9 - return std::move(obj); -+#else -+ return obj; -+#endif - } - - inline Object Reference::get_ref(const Object& location) const { --- -2.31.1 - diff --git a/0001-fix-32bit-arches-use-explicit-casts.patch b/0001-fix-32bit-arches-use-explicit-casts.patch new file mode 100644 index 0000000..60f8cc6 --- /dev/null +++ b/0001-fix-32bit-arches-use-explicit-casts.patch @@ -0,0 +1,84 @@ +From d4ae490aaa5f8f3a8a7c4986cfc1e55621789354 Mon Sep 17 00:00:00 2001 +From: "Ankur Sinha (Ankur Sinha Gmail)" +Date: Thu, 29 Apr 2021 09:00:16 +0100 +Subject: [PATCH] fix(32bit arches): use explicit casts + +Explicitly casts long long unsigned int to size_t + +Fixes https://github.com/BlueBrain/HighFive/issues/443 +--- + include/highfive/bits/H5Attribute_misc.hpp | 2 +- + include/highfive/bits/H5File_misc.hpp | 2 +- + include/highfive/bits/H5Node_traits_misc.hpp | 2 +- + include/highfive/bits/H5Path_traits_misc.hpp | 2 +- + include/highfive/bits/H5Reference_misc.hpp | 2 +- + 5 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/include/highfive/bits/H5Attribute_misc.hpp b/include/highfive/bits/H5Attribute_misc.hpp +index 63ae5f3..9e4ffe4 100644 +--- a/include/highfive/bits/H5Attribute_misc.hpp ++++ b/include/highfive/bits/H5Attribute_misc.hpp +@@ -30,7 +30,7 @@ namespace HighFive { + + inline std::string Attribute::getName() const { + return details::get_name([&](char *buffer, hsize_t length) { +- return H5Aget_name(_hid, length, buffer); ++ return H5Aget_name(_hid, static_cast(length), buffer); + }); + } + +diff --git a/include/highfive/bits/H5File_misc.hpp b/include/highfive/bits/H5File_misc.hpp +index 304205a..ee8293c 100644 +--- a/include/highfive/bits/H5File_misc.hpp ++++ b/include/highfive/bits/H5File_misc.hpp +@@ -78,7 +78,7 @@ inline File::File(const std::string& filename, unsigned openFlags, + inline const std::string& File::getName() const noexcept { + if (_filename.empty()) { + _filename = details::get_name([this](char* buffer, hsize_t length) { +- return H5Fget_name(getId(), buffer, length); ++ return H5Fget_name(getId(), buffer, static_cast(length)); + }); + } + return _filename; +diff --git a/include/highfive/bits/H5Node_traits_misc.hpp b/include/highfive/bits/H5Node_traits_misc.hpp +index a34067c..859cefd 100644 +--- a/include/highfive/bits/H5Node_traits_misc.hpp ++++ b/include/highfive/bits/H5Node_traits_misc.hpp +@@ -149,7 +149,7 @@ inline std::string NodeTraits::getObjectName(size_t index) const { + return details::get_name([&](char* buffer, hsize_t length) { + return H5Lget_name_by_idx( + static_cast(this)->getId(), ".", H5_INDEX_NAME, H5_ITER_INC, +- index, buffer, length, H5P_DEFAULT); ++ index, buffer, static_cast(length), H5P_DEFAULT); + }); + } + +diff --git a/include/highfive/bits/H5Path_traits_misc.hpp b/include/highfive/bits/H5Path_traits_misc.hpp +index 75617a1..b59f99a 100644 +--- a/include/highfive/bits/H5Path_traits_misc.hpp ++++ b/include/highfive/bits/H5Path_traits_misc.hpp +@@ -36,7 +36,7 @@ inline PathTraits::PathTraits() { + template + inline std::string PathTraits::getPath() const { + return details::get_name([this](char* buffer, hsize_t length) { +- return H5Iget_name(static_cast(this)->getId(), buffer, length); ++ return H5Iget_name(static_cast(this)->getId(), buffer, static_cast(length)); + }); + } + +diff --git a/include/highfive/bits/H5Reference_misc.hpp b/include/highfive/bits/H5Reference_misc.hpp +index b4aea3e..7486bb8 100644 +--- a/include/highfive/bits/H5Reference_misc.hpp ++++ b/include/highfive/bits/H5Reference_misc.hpp +@@ -20,7 +20,7 @@ namespace HighFive { + inline Reference::Reference(const Object& location, const Object& object) + : parent_id(location.getId()) { + obj_name = details::get_name([&](char *buffer, hsize_t length) { +- return H5Iget_name(object.getId(), buffer, length); }); ++ return H5Iget_name(object.getId(), buffer, static_cast(length)); }); + } + + inline void Reference::create_ref(hobj_ref_t* refptr) const { +-- +2.31.1 + diff --git a/highfive.spec b/highfive.spec index 0bed2e1..8d3a2d5 100644 --- a/highfive.spec +++ b/highfive.spec @@ -36,38 +36,47 @@ Feature support: %global debug_package %{nil} Name: highfive -Version: 2.2.2 -Release: 3%{?dist} +Version: 2.3.1 +Release: 1%{?dist} Summary: Header-only C++ HDF5 interface License: Boost URL: https://bluebrain.github.io/HighFive/ Source0: https://github.com/BlueBrain/HighFive/archive/v%{version}/%{name}-%{version}.tar.gz -# Do not use std::move in return -Patch0: 0001-Use-std-move-in-NRVO-depending-of-version-of-GCC-375.patch -# Should fix test failure: https://github.com/BlueBrain/HighFive/issues/444 -Patch1: https://github.com/BlueBrain/HighFive/commit/be32be0ba2c8ba0b5d43726835abb0bf83cc2120.patch -BuildRequires: boost-devel +# Does not build on 32 bit architectures +# Issue filed upstream: https://github.com/BlueBrain/HighFive/issues/443 +# https://bugzilla.redhat.com/show_bug.cgi?id=1952348 +# +# Partially patched, fixing i686; see upstream bug for armv7hl status. We can +# work around this by disabling OpenCV on armv7hl until a patch is available. +Patch0: 0001-fix-32bit-arches-use-explicit-casts.patch +Patch1: 0001-Fix-compiling-invalid-reinterpret_cast-on-32-bit.patch + BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: git-core BuildRequires: hdf5-devel +# Technically optional, enabled by default +BuildRequires: boost-devel +# Our choice vs. make BuildRequires: ninja-build # Optional but included in Fedora, so we use these -BuildRequires: eigen3-devel -BuildRequires: xtensor-devel +BuildRequires: cmake(eigen3) +BuildRequires: cmake(xtensor) +%ifnarch %{arm32} +BuildRequires: cmake(opencv) +%endif +# The -static versions are required by guidelines for tracking header-only +# libraries +BuildRequires: eigen3-static +BuildRequires: xtensor-static %if %{with docs} BuildRequires: doxygen %endif -# Does not build on 32 bit architectures -# Issue filed upstream: https://github.com/BlueBrain/HighFive/issues/443 -# https://bugzilla.redhat.com/show_bug.cgi?id=1952348 -ExcludeArch: %{ix86} %{arm32} - %description %_description @@ -75,6 +84,8 @@ ExcludeArch: %{ix86} %{arm32} Summary: Development files for %{name} Provides: %{name}%{?_isa} = %{version}-%{release} Provides: %{name}-static%{?_isa} = %{version}-%{release} +# Unarched version is needed since arched BuildRequires must not be used +Provides: %{name}-static = %{version}-%{release} %description devel @@ -88,50 +99,77 @@ BuildArch: noarch %description doc Documentation for %{name} - %endif %prep -%autosetup -n %{pretty_name}-%{version} -S git +%autosetup -n %{pretty_name}-%{version} -S git -p1 %build -%cmake -DUSE_XTENSOR:BOOL=TRUE -DUSE_EIGEN:BOOL=TRUE -DHIGHFIVE_EXAMPLES:BOOL=TRUE -DHIGHFIVE_UNIT_TESTS:BOOL=TRUE +%if %{with tests} +%set_build_flags +# The unit tests intentionally test deprecated APIs; silence these warnings so +# we are more likely to notice any real problems. +CXXFLAGS="${CXXFLAGS} -Wno-deprecated-declarations" +%endif +%cmake \ + -DHIGHFIVE_USE_BOOST:BOOL=TRUE \ + -DHIGHFIVE_USE_XTENSOR:BOOL=TRUE \ + -DHIGHFIVE_USE_EIGEN:BOOL=TRUE \ +%ifnarch %{arm32} + -DHIGHFIVE_USE_OPENCV:BOOL=TRUE \ +%endif + -DHIGHFIVE_EXAMPLES:BOOL=TRUE \ + -DHIGHFIVE_UNIT_TESTS:BOOL=%{?with_tests:TRUE}%{?!with_tests:FALSE} \ + -DHIGHFIVE_BUILD_DOCS:BOOL=%{?with_docs:TRUE}%{?!with_docs:FALSE} \ + -GNinja %cmake_build - -# Docs %if %{with docs} -pushd %{_vpath_builddir}/doc -make doc +%cmake_build --target doc %endif + %install %cmake_install +# Move the CMake configurations to the correct location +[ ! -d '%{buildroot}/%{_libdir}/cmake/%{pretty_name}' ] +install -d '%{buildroot}/%{_libdir}/cmake' +mv -v '%{buildroot}/%{_datadir}/%{pretty_name}/CMake' \ + '%{buildroot}/%{_libdir}/cmake/%{pretty_name}' -# Move the CMake configurations to correct location -mkdir -p -m 0755 $RPM_BUILD_ROOT/%{_libdir}/cmake/%{pretty_name}/ -mv $RPM_BUILD_ROOT/%{_datadir}/%{pretty_name}/CMake/* $RPM_BUILD_ROOT/%{_libdir}/cmake/%{pretty_name}/ -rm -rvf $RPM_BUILD_ROOT/%{_datadir}/%{pretty_name} %check %if %{with tests} %ctest %endif + %files devel %license LICENSE %doc README.md VERSION CHANGELOG.md -%{_includedir}/* +%{_includedir}/%{name} %{_libdir}/cmake/%{pretty_name} + %if %{with docs} %files doc %license LICENSE %doc %{_vpath_builddir}/doc/html %endif + %changelog +* Fri Aug 27 2021 Benjamin A. Beasley - 2.3.1-1 +- Update to 2.3.1 +- Drop patches, which were all upstreamed +- Switch BR’s to cmake(…) where appropriate +- Add -static BR’s for header-only library dependencies +- Add unarched -static virtual Provides since arched BR’s must not be used +- Use ninja cmake backend (which was already BR’d) +- Enable OpenCV (except on armv7hl, for now) +- Fix ExcludeArch + * Thu Jul 22 2021 Fedora Release Engineering - 2.2.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild diff --git a/sources b/sources index c817d45..325b571 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (highfive-2.2.2.tar.gz) = 7e562951b18425f1bfc96c30d0e47b6d218830417a732856a27943cd7ee6feab54d833b94aa303c40ca5038ac1aaf0eadd8c61800ffe82b6da46a465b21b1fc4 +SHA512 (highfive-2.3.1.tar.gz) = 984a6da556b1b4dbe183e5d5c6c9b9a15aac29855a67e6c4a5b83bcbf0a0f04749abcde68e8e976d43c4838f797c8d7de7c36f22e11ac3d3e87e4f87e20e2da8