Blob Blame History Raw
Summary: High performance compressor optimized for binary data
Name: blosc
Version: 1.21.2
Release: %autorelease
License: MIT
Patch0: %{name}-gcc11.patch

BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: cmake
BuildRequires: lz4-devel
BuildRequires: snappy-devel
BuildRequires: zlib-devel
BuildRequires: libzstd-devel

Blosc is a compression library designed to transmit data to the processor
cache faster than the traditional non-compressed memory fetch.
Compression ratios are not very high, but the decompression is very fast.
Blosc is meant not only to reduce the size of large datasets on-disk or
in-memory, but also to accelerate memory-bound computations.

%package devel
Summary: Header files and libraries for Blosc development
Requires: %{name}%{?_isa} = %{version}-%{release}

%description devel
The blosc-devel package contains the header files and libraries needed
to develop programs that use the blosc meta-compressor.

%package bench
Summary: Benchmark for the Blosc compressor
Requires: %{name} = %{version}-%{release}
Requires: python3-matplotlib

%description bench
The blosc-bench package contains a benchmark suite which evaluates
the performance of Blosc, and compares it with memcpy.

%autosetup -n c-%{name}-%{version} -p1
rm -r internal-complibs/lz4* internal-complibs/zstd*

# Fix rpath issue
sed -i '1i  set\(CMAKE_SKIP_RPATH true\)' bench/CMakeLists.txt

# Fix cmake detection of pthreads
sed -i '1i  set\(CMAKE_POSITION_INDEPENDENT_CODE TRUE\)' CMakeLists.txt

sed -i 's|lib/pkgconfig|%{_lib}/pkgconfig|' CMakeLists.txt

# Add python shebang and permission
sed -i '1i  #!/usr/bin/python3' bench/

# Use the proper library path and SSE2 instruction on 64bits systems
%cmake \


export LD_LIBRARY_PATH=%{buildroot}%{_libdir}


install -p bench/* -Dt %{buildroot}/%{_pkgdocdir}/bench/
install -pm 0644 bench/*.c %{buildroot}/%{_pkgdocdir}/bench

install -p %{_vpath_builddir}/bench/bench -D %{buildroot}/%{_bindir}/%{name}-bench
install -p bench/ %{buildroot}/%{_bindir}/%{name}-plot-times

%exclude %{_pkgdocdir}/bench/
%license LICENSES/*

%files devel

%files bench