Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package primesieve for openSUSE:Factory 
checked in at 2024-03-13 22:18:29
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/primesieve (Old)
 and      /work/SRC/openSUSE:Factory/.primesieve.new.1770 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "primesieve"

Wed Mar 13 22:18:29 2024 rev:12 rq:1157145 version:12.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/primesieve/primesieve.changes    2024-02-20 
21:14:08.417383749 +0100
+++ /work/SRC/openSUSE:Factory/.primesieve.new.1770/primesieve.changes  
2024-03-13 22:19:36.042532000 +0100
@@ -1,0 +2,9 @@
+Tue Mar 12 09:50:00 UTC 2024 - Kim Walisch <kim.wali...@gmail.com>
+
+- Update to primesieve-12.1
+- CMakeLists.txt: Fix undefined reference to pthread_create
+- Fix -ffast-math failure of --test option
+- Fix musl libc issue in unit tests
+- Improve status output
+
+-------------------------------------------------------------------

Old:
----
  primesieve-12.0.tar.gz

New:
----
  primesieve-12.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ primesieve.spec ++++++
--- /var/tmp/diff_new_pack.MimSnk/_old  2024-03-13 22:19:36.774558985 +0100
+++ /var/tmp/diff_new_pack.MimSnk/_new  2024-03-13 22:19:36.774558985 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           primesieve
-Version:        12.0
+Version:        12.1
 Release:        0
 Summary:        A prime number generator
 License:        BSD-2-Clause

++++++ primesieve-12.0.tar.gz -> primesieve-12.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/primesieve-12.0/CMakeLists.txt 
new/primesieve-12.1/CMakeLists.txt
--- old/primesieve-12.0/CMakeLists.txt  2024-02-18 20:41:52.000000000 +0100
+++ new/primesieve-12.1/CMakeLists.txt  2024-03-09 15:05:38.000000000 +0100
@@ -1,7 +1,7 @@
 cmake_minimum_required(VERSION 3.4...3.27)
 project(primesieve CXX)
-set(PRIMESIEVE_VERSION "12.0")
-set(PRIMESIEVE_SOVERSION "12.0.0")
+set(PRIMESIEVE_VERSION "12.1")
+set(PRIMESIEVE_SOVERSION "12.1.0")
 
 # Build options ######################################################
 
@@ -233,7 +233,7 @@
 
 if(BUILD_PRIMESIEVE)
     add_executable(primesieve ${BIN_SRC})
-    target_link_libraries(primesieve primesieve::primesieve)
+    target_link_libraries(primesieve primesieve::primesieve Threads::Threads)
     target_compile_features(primesieve PRIVATE cxx_auto_type)
     install(TARGETS primesieve DESTINATION ${CMAKE_INSTALL_BINDIR})
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/primesieve-12.0/ChangeLog 
new/primesieve-12.1/ChangeLog
--- old/primesieve-12.0/ChangeLog       2024-02-18 20:41:52.000000000 +0100
+++ new/primesieve-12.1/ChangeLog       2024-03-09 15:05:38.000000000 +0100
@@ -1,3 +1,12 @@
+Changes in version 12.1, 09/03/2024
+===================================
+
+CMakeLists.txt: Fix undefined reference to pthread_create #146.
+PrimeSieve.cpp: Improve status output.
+src/app/test.cpp: Fix -ffast-math failure.
+test/count_primes2.cpp: Fix -ffast-math failure.
+test/Riemann_R.cpp: Fix musl libc issue #147.
+
 Changes in version 12.0, 17/02/2024
 ===================================
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/primesieve-12.0/include/primesieve.h 
new/primesieve-12.1/include/primesieve.h
--- old/primesieve-12.0/include/primesieve.h    2024-02-18 20:41:52.000000000 
+0100
+++ new/primesieve-12.1/include/primesieve.h    2024-03-09 15:05:38.000000000 
+0100
@@ -7,7 +7,7 @@
  *         standard error stream. libprimesieve also sets the C errno
  *         variable to EDOM if an error occurs.
  * 
- * Copyright (C) 2023 Kim Walisch, <kim.wali...@gmail.com>
+ * Copyright (C) 2024 Kim Walisch, <kim.wali...@gmail.com>
  * 
  * This file is distributed under the BSD License.
  */
@@ -15,9 +15,9 @@
 #ifndef PRIMESIEVE_H
 #define PRIMESIEVE_H
 
-#define PRIMESIEVE_VERSION "12.0"
+#define PRIMESIEVE_VERSION "12.1"
 #define PRIMESIEVE_VERSION_MAJOR 12
-#define PRIMESIEVE_VERSION_MINOR 0
+#define PRIMESIEVE_VERSION_MINOR 1
 
 #include <primesieve/iterator.h>
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/primesieve-12.0/include/primesieve.hpp 
new/primesieve-12.1/include/primesieve.hpp
--- old/primesieve-12.0/include/primesieve.hpp  2024-02-18 20:41:52.000000000 
+0100
+++ new/primesieve-12.1/include/primesieve.hpp  2024-03-09 15:05:38.000000000 
+0100
@@ -5,7 +5,7 @@
 ///         primesieve::primesieve_error exception (derived form
 ///         std::runtime_error) is thrown.
 ///
-/// Copyright (C) 2023 Kim Walisch, <kim.wali...@gmail.com>
+/// Copyright (C) 2024 Kim Walisch, <kim.wali...@gmail.com>
 ///
 /// This file is distributed under the BSD License.
 ///
@@ -13,9 +13,9 @@
 #ifndef PRIMESIEVE_HPP
 #define PRIMESIEVE_HPP
 
-#define PRIMESIEVE_VERSION "12.0"
+#define PRIMESIEVE_VERSION "12.1"
 #define PRIMESIEVE_VERSION_MAJOR 12
-#define PRIMESIEVE_VERSION_MINOR 0
+#define PRIMESIEVE_VERSION_MINOR 1
 
 #include <primesieve/iterator.hpp>
 #include <primesieve/primesieve_error.hpp>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/primesieve-12.0/src/PrimeSieve.cpp 
new/primesieve-12.1/src/PrimeSieve.cpp
--- old/primesieve-12.0/src/PrimeSieve.cpp      2024-02-18 20:41:52.000000000 
+0100
+++ new/primesieve-12.1/src/PrimeSieve.cpp      2024-03-09 15:05:38.000000000 
+0100
@@ -4,7 +4,7 @@
 ///         sieving. It is used for printing and counting primes
 ///         and for computing the nth prime.
 ///
-/// Copyright (C) 2023 Kim Walisch, <kim.wali...@gmail.com>
+/// Copyright (C) 2024 Kim Walisch, <kim.wali...@gmail.com>
 ///
 /// This file is distributed under the BSD License. See the COPYING
 /// file in the top level directory.
@@ -22,6 +22,7 @@
 #include <algorithm>
 #include <chrono>
 #include <iostream>
+#include <string>
 
 namespace {
 
@@ -231,7 +232,9 @@
   int percent = (int) current;
   if (percent > (int) old)
   {
-    std::cout << '\r' << percent << '%' << std::flush;
+    std::string precentStr = '\r' + std::to_string(percent) + '%';
+    std::cout << precentStr << std::flush;
+
     if (percent == 100)
       std::cout << '\n';
   }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/primesieve-12.0/src/app/test.cpp 
new/primesieve-12.1/src/app/test.cpp
--- old/primesieve-12.0/src/app/test.cpp        2024-02-18 20:41:52.000000000 
+0100
+++ new/primesieve-12.1/src/app/test.cpp        2024-03-09 15:05:38.000000000 
+0100
@@ -2,7 +2,7 @@
 /// @file   test.cpp
 /// @brief  primesieve self tests (option: --test).
 ///
-/// Copyright (C) 2023 Kim Walisch, <kim.wali...@gmail.com>
+/// Copyright (C) 2024 Kim Walisch, <kim.wali...@gmail.com>
 ///
 /// This file is distributed under the BSD License. See the COPYING
 /// file in the top level directory.
@@ -14,7 +14,6 @@
 
 #include <stdint.h>
 #include <chrono>
-#include <cmath>
 #include <cstdlib>
 #include <iomanip>
 #include <iostream>
@@ -54,14 +53,13 @@
   };
 
   ParallelSieve ps;
-  ps.setStart(0);
-  ps.setStop(0);
   uint64_t count = 0;
+  uint64_t stop = 1;
 
   for (size_t i = 0; i < primePi.size(); i++)
   {
-    uint64_t start = ps.getStop() + 1;
-    uint64_t stop = (uint64_t) std::pow(10.0, i + 1);
+    uint64_t start = stop + 1;
+    stop *= 10;
     count += ps.countPrimes(start, stop);
     std::ostringstream oss;
     oss << "PrimePi(10^" << i + 1 << ") = " << count;
@@ -81,10 +79,11 @@
     66        // PrimePi6(10^16, 10^16+10^10)
   };
 
+  uint64_t start = (uint64_t) 1e12;
+  size_t j = 12;
+
   for (size_t i = 0; i < kTupletCounts.size(); i++)
   {
-    size_t j = i + 12;
-    uint64_t start = (uint64_t) std::pow(10.0, j);
     uint64_t stop = start + (uint64_t) 1e10;
     int k = (int) (i + 2);
     int countKTuplet = COUNT_PRIMES << (k - 1);
@@ -97,6 +96,9 @@
     oss << "PrimePi" << k << "(10^" << j << ", 10^" << j << "+10^10) = " << 
count;
     std::cout << std::left << std::setw(39) << oss.str();
     check(count == kTupletCounts[i]);
+
+    start *= 10;
+    j += 1;
   }
 }
 
@@ -112,14 +114,18 @@
     255481287  // PrimePi(10^17, 10^17+10^10)
   };
 
+  uint64_t start = (uint64_t) 1e12;
+  size_t j = 12;
+
   for (size_t i = 0; i < primePi.size(); i++)
   {
-    size_t j = i + 12;
-    uint64_t start = (uint64_t) std::pow(10.0, j);
     uint64_t stop = start + (uint64_t) 1e10;
     uint64_t count = count_primes(start, stop);
     std::cout << "PrimePi(10^" << j << ", 10^" << j << "+10^10) = " << count;
     check(count == primePi[i]);
+
+    start *= 10;
+    j += 1;
   }
 }
 
@@ -166,14 +172,14 @@
   };
 
   ParallelSieve ps;
-  uint64_t n = 0;
-  uint64_t nthPrime = 0;
+  uint64_t n = 1;
+  uint64_t nthPrime = 2;
 
   for (size_t i = 0; i < nthPrimes.size(); i++)
   {
     uint64_t oldN = n;
     uint64_t oldNthPrime = nthPrime;
-    n = (uint64_t) std::pow(10.0, i + 1);
+    n *= 10;
     nthPrime = ps.nthPrime(n - oldN, oldNthPrime);
     std::ostringstream oss;
     oss << "NthPrime(10^" << i + 1 << ") = " << nthPrime;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/primesieve-12.0/test/Riemann_R.cpp 
new/primesieve-12.1/test/Riemann_R.cpp
--- old/primesieve-12.0/test/Riemann_R.cpp      2024-02-18 20:41:52.000000000 
+0100
+++ new/primesieve-12.1/test/Riemann_R.cpp      2024-03-09 15:05:38.000000000 
+0100
@@ -9,19 +9,18 @@
 ///
 
 #include <primesieve/RiemannR.hpp>
+#include <primesieve/Vector.hpp>
 
 #include <stdint.h>
 #include <iostream>
 #include <cstdlib>
 #include <cmath>
 #include <limits>
-#include <vector>
 
-using std::max;
 using std::size_t;
 using namespace primesieve;
 
-std::vector<uint64_t> RiemannR_table =
+Array<uint64_t, 14> RiemannR_table =
 {
                      4, // RiemannR(10^1)
                     25, // RiemannR(10^2)
@@ -36,11 +35,7 @@
           4118052494ll, // RiemannR(10^11)
          37607910542ll, // RiemannR(10^12)
         346065531065ll, // RiemannR(10^13)
-       3204941731601ll, // RiemannR(10^14)
-      29844570495886ll, // RiemannR(10^15)
-     279238341360977ll, // RiemannR(10^16)
-    2623557157055978ll, // RiemannR(10^17)
-   24739954284239494ll  // RiemannR(10^18)
+       3204941731601ll  // RiemannR(10^14)
 };
 
 void check(bool OK)
@@ -55,11 +50,6 @@
   uint64_t x = 1;
   for (size_t i = 0; i < RiemannR_table.size(); i++)
   {
-    // The accuracy of RiemannR(x) depends on
-    // the width of the long double type.
-    if (i >= std::numeric_limits<long double>::digits10)
-      break;
-
     x *= 10;
     std::cout << "RiemannR(" << x << ") = " << (uint64_t) RiemannR((long 
double) x);
     check((uint64_t) RiemannR((long double) x) == RiemannR_table[i]);
@@ -68,11 +58,6 @@
   x = 1;
   for (size_t i = 0; i < RiemannR_table.size(); i++)
   {
-    // The accuracy of RiemannR(x) depends on
-    // the width of the long double type.
-    if (i >= std::numeric_limits<long double>::digits10)
-      break;
-
     x *= 10;
     std::cout << "RiemannR_inverse(" << RiemannR_table[i] << ") = " << 
(uint64_t) RiemannR_inverse((long double) RiemannR_table[i]);
     check((uint64_t) RiemannR_inverse((long double) RiemannR_table[i]) < x &&
@@ -83,7 +68,7 @@
   for (x = 0; x < 10000; x++)
   {
     uint64_t rix = (uint64_t) RiemannR((long double) x);
-    double logx = std::log(max((double) x, 2.0));
+    double logx = std::log(std::max((double) x, 2.0));
 
     if ((x >= 20 && rix < x / logx) ||
         (x >= 2  && rix > x * logx))
@@ -97,7 +82,7 @@
   for (; x < 100000; x += 101)
   {
     uint64_t rix = (uint64_t) RiemannR((long double) x);
-    double logx = std::log(max((double) x, 2.0));
+    double logx = std::log(std::max((double) x, 2.0));
 
     if ((x >= 20 && rix < x / logx) ||
         (x >= 2  && rix > x * logx))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/primesieve-12.0/test/count_primes1.cpp 
new/primesieve-12.1/test/count_primes1.cpp
--- old/primesieve-12.0/test/count_primes1.cpp  2024-02-18 20:41:52.000000000 
+0100
+++ new/primesieve-12.1/test/count_primes1.cpp  2024-03-09 15:05:38.000000000 
+0100
@@ -2,7 +2,7 @@
 /// @file   count_primes1.cpp
 /// @brief  Count the primes up to 10^9.
 ///
-/// Copyright (C) 2023 Kim Walisch, <kim.wali...@gmail.com>
+/// Copyright (C) 2024 Kim Walisch, <kim.wali...@gmail.com>
 ///
 /// This file is distributed under the BSD License. See the COPYING
 /// file in the top level directory.
@@ -12,7 +12,6 @@
 #include <primesieve/Vector.hpp>
 
 #include <stdint.h>
-#include <cmath>
 #include <cstdlib>
 #include <iostream>
 #include <iomanip>
@@ -44,14 +43,15 @@
 {
   std::cout << std::left;
   ParallelSieve ps;
-  ps.setStart(0);
-  ps.setStop(0);
   uint64_t count = 0;
+  uint64_t stop = 1;
 
   // pi(x) with x = 10^(i+1)
   for (size_t i = 0; i < pix.size(); i++)
   {
-    count += ps.countPrimes(ps.getStop() + 1, (uint64_t) std::pow(10.0, i + 
1));
+    uint64_t start = stop + 1;
+    stop *= 10;
+    count += ps.countPrimes(start, stop);
     std::cout << "pi(10^" << i + 1 << ") = " << std::setw(12) << count;
     check(count == pix[i]);
   }
@@ -61,7 +61,7 @@
   // otherwise minimal pre-sieving is used.
   // Using a single thread increases thread interval.
   ps.setNumThreads(1);
-  count = ps.countPrimes(0, (uint64_t) std::pow(10.0, 9));
+  count = ps.countPrimes(0, (uint64_t) 1e9);
   std::cout << "pi(10^9) = " << std::setw(12) << count;
   check(count == 50847534);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/primesieve-12.0/test/count_primes2.cpp 
new/primesieve-12.1/test/count_primes2.cpp
--- old/primesieve-12.0/test/count_primes2.cpp  2024-02-18 20:41:52.000000000 
+0100
+++ new/primesieve-12.1/test/count_primes2.cpp  2024-03-09 15:05:38.000000000 
+0100
@@ -3,7 +3,7 @@
 /// @brief  Count the primes within [10^i, 10^i + 10^8]
 ///         for i = 12 to 19
 ///
-/// Copyright (C) 2023 Kim Walisch, <kim.wali...@gmail.com>
+/// Copyright (C) 2024 Kim Walisch, <kim.wali...@gmail.com>
 ///
 /// This file is distributed under the BSD License. See the COPYING
 /// file in the top level directory.
@@ -14,7 +14,6 @@
 
 #include <stdint.h>
 #include <cstdlib>
-#include <cmath>
 #include <iostream>
 #include <iomanip>
 
@@ -40,16 +39,19 @@
 int main()
 {
   std::cout << std::left;
+  uint64_t start = (uint64_t) 1e12;
+  size_t j = 12;
 
   for (size_t i = 0; i < pix.size(); i++)
   {
-    size_t j = i + 12;
     std::cout << "Sieving the primes within [10^" << j << ", 10^" << j << " + 
10^8]" << std::endl;
-    uint64_t start = (uint64_t) std::pow(10.0, j);
     uint64_t stop = start + (uint64_t) 1e8;
     uint64_t count = count_primes(start, stop);
     std::cout << "\rPrime count: " << std::setw(7) << count;
     check(count == pix[i]);
+
+    start *= 10;
+    j++;
   }
 
   std::cout << std::endl;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/primesieve-12.0/test/nth_prime3.cpp 
new/primesieve-12.1/test/nth_prime3.cpp
--- old/primesieve-12.0/test/nth_prime3.cpp     2024-02-18 20:41:52.000000000 
+0100
+++ new/primesieve-12.1/test/nth_prime3.cpp     2024-03-09 15:05:38.000000000 
+0100
@@ -2,7 +2,7 @@
 /// @file   nth_prime3.cpp
 /// @brief  Long distance nth prime testing.
 ///
-/// Copyright (C) 2022 Kim Walisch, <kim.wali...@gmail.com>
+/// Copyright (C) 2024 Kim Walisch, <kim.wali...@gmail.com>
 ///
 /// This file is distributed under the BSD License. See the COPYING
 /// file in the top level directory.
@@ -39,15 +39,17 @@
   // Set a small sieve size in order to
   // ensure many segments are sieved
   set_sieve_size(16);
+  int64_t n = 100;
 
   for (int i = 3; i <= 6; i++)
   {
+    n *= 10;
+    int64_t start = (int64_t) 1e7;
+    int64_t iters = 5;
+
     for (int j = 8; j <= 10; j++)
     {
-      int64_t n = (int64_t) std::pow(10.0, i);
-      int64_t start = (int64_t) std::pow(10.0, j);
-      int64_t iters = 5;
-
+      start *= 10;
       std::cout << "nth_prime_test(" << n << ", " << start << ", " << iters << 
")";
       nth_prime_test(n, start, iters);
       std::cout << " = OK" << std::endl;

Reply via email to