Blob Blame Raw
Name:           primecount
Version:        5.2
Release:        1%{?dist}
Summary:        Fast prime counting function implementation

License:        BSD
URL:  {name}/
Source0:        %{url}/archive/v%{version}/%{name}-%{version}.tar.gz

BuildRequires:  asciidoc
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  libdivide-devel
BuildRequires:  primesieve-devel

Requires:       %{name}-libs%{?_isa} = %{version}-%{release}

Primecount is a command-line program and C++ library that counts the
primes below an integer x<=10**31 using highly optimized implementations
of the combinatorial prime counting algorithms.

Primecount includes implementations of all important combinatorial prime
counting algorithms known up to this date all of which have been
parallelized using OpenMP.  Primecount contains the first ever open
source implementations of the Deleglise-Rivat algorithm and Xavier
Gourdon's algorithm (that works).  Primecount also features a novel load
balancer that is shared amongst all implementations and that scales up
to hundreds of CPU cores.  Primecount has already been used to compute
several world records e.g. pi(10**27)
( and
nth_prime(10**24) (

%package        libs
Summary:        C++ library for fast prime counting

%description    libs
This package contains a C++ library for counting primes below an
integer.  See the primecount package for a command line interface.

%package        devel
Summary:        Headers and library links for libprimecount
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
Requires:       cmake-filesystem%{?_isa}

%description    devel
This package contains files necessary to develop applications that use

%autosetup -p1

# Unbundle libdivide
rm -f include/libdivide.h
ln -s %{_includedir}/libdivide.h include/libdivide.h

# Do not add flags that change the architecture
sed -i '/if(mpopcnt)/,/endif()/d' CMakeLists.txt

%ifarch %{ix86} x86_64
export CFLAGS="%{optflags} -DLIBDIVIDE_SSE2"
mkdir build
cd build
cd -

cd build
cd -

make test


%files          libs
%license COPYING

%files          devel
%doc ChangeLog doc/*.pdf doc/*.md

* Mon Nov 18 2019 Jerry James <> - 5.2-1
- Version 5.2
- Drop all patches
- Building man page now needs asciidoc instead of help2man

* Fri Sep 20 2019 Jerry James <> - 5.1-2
- Add justifications in the patch files
- Generate a man page with help2man

* Thu Sep 19 2019 Jerry James <> - 5.1-1
- Initial RPM