%global commit0 63058eff77e11aa15bf531df5dd34395ec3017c8 %global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) %global date0 20201208 %bcond_with check Summary: Header for division via fixed-point math Name: FXdiv License: MIT Version: 1.0^git%{date0}.%{shortcommit0} Release: 1%{?dist} # Only a header BuildArch: noarch URL: https://github.com/Maratyszcza/%{name} Source0: %{url}/archive/%{commit0}/%{name}-%{shortcommit0}.tar.gz Patch0: 0001-Prep-fxdiv-cmake-for-fedora-packaging.patch BuildRequires: cmake BuildRequires: gcc-c++ %if %{with check} BuildRequires: gtest-devel %endif %description Header-only library for division via fixed-point multiplication by inverse On modern CPUs and GPUs integer division is several times slower than multiplication. FXdiv implements an algorithm to replace an integer division with a multiplication and two shifts. This algorithm improves performance when an application performs repeated divisions by the same divisor. Features * Integer division for uint32_t, uint64_t, and size_t * Header-only library, no installation or build required * Compatible with C99, C++, OpenCL, and CUDA * Uses platform-specific compiler intrinsics for optimal performance * Covered with unit tests and microbenchmarks %package devel Summary: Header for division via fixed-point math Provides: %{name}-static = %{version}-%{release} %description devel Header-only library for division via fixed-point multiplication by inverse On modern CPUs and GPUs integer division is several times slower than multiplication. FXdiv implements an algorithm to replace an integer division with a multiplication and two shifts. This algorithm improves performance when an application performs repeated divisions by the same divisor. Features * Integer division for uint32_t, uint64_t, and size_t * Header-only library, no installation or build required * Compatible with C99, C++, OpenCL, and CUDA * Uses platform-specific compiler intrinsics for optimal performance * Covered with unit tests and microbenchmarks %prep %autosetup -p1 -n %{name}-%{commit0} %build %cmake \ -DFXDIV_USE_SYSTEM_LIBS=ON \ %if %{without check} -DFXDIV_BUILD_TESTS=OFF \ %endif -DFXDIV_BUILD_BENCHMARKS=OFF \ %cmake_build %if %{with check} %check %ctest %endif %install %cmake_install %files devel %license LICENSE %doc README.md %{_includedir}/fxdiv.h %changelog * Fri Sep 15 2023 Tom Rix - 1.0^git20201208.63058ef-1 - Initial package