primesieve  5.5.0-rc1
primesieve Documentation

About

primesieve is a C/C++ library for fast prime number generation. http://primesieve.org/build.html explains how to build and install primesieve.

primesieve is written in C++03 and includes C bindings for all of its functions so that it can easily be used in languages other than C++. Multi-threading is implemented using OpenMP 2.0 (2002) or later. primesieve is very portable, it builds on most Unix-like operating system (GNU Autotools) and Windows (MSVC) is also supported.

primesieve generates primes using a highly optimized implementation of the segmented sieve of Eratosthenes. It generates the primes below 10^9 in just 0.2 seconds on a single core of an Intel Core i7-4770 3.4GHz CPU from 2013. primesieve can generate primes and prime k-tuplets up to 2^64 - 2^32 * 10. primesieve's memory requirement is about pi(sqrt(n)) * 8 bytes per thread, its run-time complexity is O(n log log n) operations.

C++ API

C API