f8bee47
Name:           primecount
8032221
Version:        5.2
8032221
Release:        1%{?dist}
f8bee47
Summary:        Fast prime counting function implementation
f8bee47
f8bee47
License:        BSD
f8bee47
URL:            https://github.com/kimwalisch/%{name}/
f8bee47
Source0:        %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
f8bee47
8032221
BuildRequires:  asciidoc
f8bee47
BuildRequires:  cmake
f8bee47
BuildRequires:  gcc-c++
f8bee47
BuildRequires:  libdivide-devel
f8bee47
BuildRequires:  primesieve-devel
f8bee47
f8bee47
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
f8bee47
f8bee47
%description
f8bee47
Primecount is a command-line program and C++ library that counts the
f8bee47
primes below an integer x<=10**31 using highly optimized implementations
f8bee47
of the combinatorial prime counting algorithms.
f8bee47
f8bee47
Primecount includes implementations of all important combinatorial prime
f8bee47
counting algorithms known up to this date all of which have been
f8bee47
parallelized using OpenMP.  Primecount contains the first ever open
f8bee47
source implementations of the Deleglise-Rivat algorithm and Xavier
f8bee47
Gourdon's algorithm (that works).  Primecount also features a novel load
f8bee47
balancer that is shared amongst all implementations and that scales up
f8bee47
to hundreds of CPU cores.  Primecount has already been used to compute
f8bee47
several world records e.g. pi(10**27)
f8bee47
(http://www.mersenneforum.org/showthread.php?t=20473) and
f8bee47
nth_prime(10**24) (https://oeis.org/A006988).
f8bee47
f8bee47
%package        libs
f8bee47
Summary:        C++ library for fast prime counting
f8bee47
f8bee47
%description    libs
f8bee47
This package contains a C++ library for counting primes below an
f8bee47
integer.  See the primecount package for a command line interface.
f8bee47
f8bee47
%package        devel
f8bee47
Summary:        Headers and library links for libprimecount
f8bee47
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
f8bee47
Requires:       cmake-filesystem%{?_isa}
f8bee47
f8bee47
%description    devel
f8bee47
This package contains files necessary to develop applications that use
f8bee47
libprimecount.
f8bee47
f8bee47
%prep
f8bee47
%autosetup -p1
f8bee47
f8bee47
# Unbundle libdivide
f8bee47
rm -f include/libdivide.h
f8bee47
ln -s %{_includedir}/libdivide.h include/libdivide.h
f8bee47
f8bee47
# Do not add flags that change the architecture
8032221
sed -i '/if(mpopcnt)/,/endif()/d' CMakeLists.txt
f8bee47
f8bee47
%build
f8bee47
%ifarch %{ix86} x86_64
f8bee47
export CFLAGS="%{optflags} -DLIBDIVIDE_SSE2"
f8bee47
export CXXFLAGS="$CFLAGS"
f8bee47
%endif
f8bee47
mkdir build
f8bee47
cd build
8032221
%cmake -DBUILD_LIBPRIMESIEVE=OFF \
8032221
       -DBUILD_MANPAGE=ON \
8032221
       -DBUILD_SHARED_LIBS=ON \
8032221
       -DBUILD_STATIC_LIBS=OFF \
8032221
       -DBUILD_TESTS=ON \
8032221
       -DWITH_POPCNT=OFF \
8032221
       ..
f8bee47
%make_build
f8bee47
cd -
f8bee47
f8bee47
%install
f8bee47
cd build
f8bee47
%make_install
f8bee47
cd -
f8bee47
f8bee47
%check
f8bee47
make test
f8bee47
f8bee47
%files
f8bee47
%doc README.md
f8bee47
%{_bindir}/primecount
f8bee47
%{_mandir}/man1/primecount.1*
f8bee47
f8bee47
%files          libs
f8bee47
%license COPYING
f8bee47
%{_libdir}/libprimecount.so.5*
f8bee47
f8bee47
%files          devel
f8bee47
%doc ChangeLog doc/*.pdf doc/*.md
f8bee47
%{_includedir}/primecount.hpp
f8bee47
%{_libdir}/libprimecount.so
f8bee47
f8bee47
%changelog
8032221
* Mon Nov 18 2019 Jerry James <loganjerry@gmail.com> - 5.2-1
8032221
- Version 5.2
8032221
- Drop all patches
8032221
- Building man page now needs asciidoc instead of help2man
8032221
f8bee47
* Fri Sep 20 2019 Jerry James <loganjerry@gmail.com> - 5.1-2
f8bee47
- Add justifications in the patch files
f8bee47
- Generate a man page with help2man
f8bee47
f8bee47
* Thu Sep 19 2019 Jerry James <loganjerry@gmail.com> - 5.1-1
f8bee47
- Initial RPM