From 381af8bf408871455af2a6e07cc3f985cd7f5759 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Mon, 19 Apr 2021 11:28:31 +0100 Subject: [PATCH] feat: init --- .gitignore | 1 + ...NRVO-depending-of-version-of-GCC-375.patch | 30 ++++ highfive.spec | 135 ++++++++++++++++++ sources | 1 + 4 files changed, 167 insertions(+) create mode 100644 .gitignore create mode 100644 0001-Use-std-move-in-NRVO-depending-of-version-of-GCC-375.patch create mode 100644 highfive.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..98fa6d1 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/highfive-2.2.2.tar.gz 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 new file mode 100644 index 0000000..2104dcc --- /dev/null +++ b/0001-Use-std-move-in-NRVO-depending-of-version-of-GCC-375.patch @@ -0,0 +1,30 @@ +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/highfive.spec b/highfive.spec new file mode 100644 index 0000000..2ba2577 --- /dev/null +++ b/highfive.spec @@ -0,0 +1,135 @@ +%global pretty_name HighFive + +%global _description %{expand: +HighFive is a modern header-only C++11 friendly interface for libhdf5. + +HighFive supports STL vector/string, Boost::UBLAS, Boost::Multi-array, Eigen +and Xtensor. It handles C++ from/to HDF5 with automatic type mapping. HighFive +does not require additional libraries (see dependencies) and supports both HDF5 +thread safety and Parallel HDF5 (contrary to the official hdf5 cpp) + +It integrates nicely with other CMake projects by defining (and exporting) a +HighFive target. + +Design: +- Simple C++-ish minimalist interface +- No other dependency than libhdf5 +- Zero overhead +- Support C++11 + +Feature support: +- create/read/write files, datasets, attributes, groups, dataspaces. +- automatic memory management / ref counting +- automatic conversion of std::vector and nested std::vector from/to any + dataset with basic types +- automatic conversion of std::string to/from variable length string dataset +- selection() / slice support +- parallel Read/Write operations from several nodes with Parallel HDF5 +- Advanced types: Compound, Enum, Arrays of Fixed-length strings, References + etc... (see ChangeLog) +} + +%bcond_without tests +%bcond_without docs + +# Header only, so no debuginfo is generated +%global debug_package %{nil} + +Name: highfive +Version: 2.2.2 +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 + +BuildRequires: boost-devel +BuildRequires: cmake +BuildRequires: gcc-c++ +BuildRequires: git-core +BuildRequires: hdf5-devel +BuildRequires: ninja-build + +# Optional but included in Fedora, so we use these +BuildRequires: eigen3-devel +BuildRequires: xtensor-devel + +%if %{with docs} +BuildRequires: doxygen +%endif + +# Does not build on 32 bit architectures +# Issue filed upstream: https://github.com/BlueBrain/HighFive/issues/443 +ExcludeArch: %{ix86} %{arm32} + +%description %_description + + +%package devel +Summary: Development files for %{name} +Provides: %{name}%{?_isa} = %{version}-%{release} +Provides: %{name}-static%{?_isa} = %{version}-%{release} + + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%if %{with docs} +%package doc +Summary: Documentation for %{name} +BuildArch: noarch + +%description doc +Documentation for %{name} + +%endif + + +%prep +%autosetup -n %{pretty_name}-%{version} -S git + + +%build +%cmake -DUSE_XTENSOR:BOOL=TRUE -DUSE_EIGEN:BOOL=TRUE -DHIGHFIVE_EXAMPLES:BOOL=TRUE -DHIGHFIVE_UNIT_TESTS:BOOL=TRUE +%cmake_build + +# Docs +%if %{with docs} +pushd %{_vpath_builddir}/doc +make doc +%endif + +%install +%cmake_install + +# 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} +# Test fails, reported upstream: https://github.com/BlueBrain/HighFive/issues/444 +%ctest "-j1" "-E" "tests_high_five_base" +%endif + +%files devel +%license LICENSE +%doc README.md VERSION CHANGELOG.md +%{_includedir}/* +%{_libdir}/cmake/%{pretty_name} + +%if %{with docs} +%files doc +%license LICENSE +%doc %{_vpath_builddir}/doc/html +%endif + +%changelog +* Sun Apr 18 2021 Ankur Sinha - 2.2.2-1 +- Enable doc build +- include complete doc package in conditional diff --git a/sources b/sources new file mode 100644 index 0000000..c817d45 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (highfive-2.2.2.tar.gz) = 7e562951b18425f1bfc96c30d0e47b6d218830417a732856a27943cd7ee6feab54d833b94aa303c40ca5038ac1aaf0eadd8c61800ffe82b6da46a465b21b1fc4