music / rpms / highfive

Forked from rpms/highfive 2 years ago
Clone
Blob Blame History Raw
%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:        3%{?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
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
# https://bugzilla.redhat.com/show_bug.cgi?id=1952348
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}
%ctest
%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
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Thu Apr 22 2021 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2.2.2-2
- Make note of excludearch bug

* Mon Apr 19 2021 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2.2.2-2
- Carry patch to fix failing test: https://github.com/BlueBrain/HighFive/issues/444

* Sun Apr 18 2021 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2.2.2-1
- Enable doc build
- include complete doc package in conditional