Hello community, here is the log from the commit of package fplll for openSUSE:Factory checked in at 2019-12-17 13:29:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/fplll (Old) and /work/SRC/openSUSE:Factory/.fplll.new.4691 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "fplll" Tue Dec 17 13:29:42 2019 rev:5 rq:757378 version:5.3.1 Changes: -------- --- /work/SRC/openSUSE:Factory/fplll/fplll.changes 2019-11-25 11:25:20.478094599 +0100 +++ /work/SRC/openSUSE:Factory/.fplll.new.4691/fplll.changes 2019-12-17 13:29:57.583413525 +0100 @@ -1,0 +2,6 @@ +Sat Dec 14 19:28:04 UTC 2019 - Jan Engelhardt <[email protected]> + +- Update to release 5.3.1 + * No changelog was provided + +------------------------------------------------------------------- Old: ---- fplll-5.3.0.tar.gz New: ---- fplll-5.3.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ fplll.spec ++++++ --- /var/tmp/diff_new_pack.GsiH5e/_old 2019-12-17 13:29:58.251413290 +0100 +++ /var/tmp/diff_new_pack.GsiH5e/_new 2019-12-17 13:29:58.251413290 +0100 @@ -18,7 +18,7 @@ Name: fplll %define lname libfplll6 -Version: 5.3.0 +Version: 5.3.1 Release: 0 Summary: Lenstra-Lovász Lattice Basis Reduction Algorithm Library License: LGPL-2.1-or-later ++++++ fplll-5.3.0.tar.gz -> fplll-5.3.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fplll-5.3.0/Makefile.am new/fplll-5.3.1/Makefile.am --- old/fplll-5.3.0/Makefile.am 2019-11-23 12:28:47.000000000 +0100 +++ new/fplll-5.3.1/Makefile.am 2019-12-14 17:57:49.000000000 +0100 @@ -14,4 +14,5 @@ CLANGFORMAT ?= clang-format .PHONY: check-style check-style: + -bash .check-m4.sh $(CLANGFORMAT) -i --style=file fplll/*.{cpp,h} fplll/*/*.{cpp,h,inl} tests/*.cpp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fplll-5.3.0/Makefile.in new/fplll-5.3.1/Makefile.in --- old/fplll-5.3.0/Makefile.in 2019-11-23 12:29:13.000000000 +0100 +++ new/fplll-5.3.1/Makefile.in 2019-12-14 17:58:16.000000000 +0100 @@ -900,6 +900,7 @@ CLANGFORMAT ?= clang-format .PHONY: check-style check-style: + -bash .check-m4.sh $(CLANGFORMAT) -i --style=file fplll/*.{cpp,h} fplll/*/*.{cpp,h,inl} tests/*.cpp # Tell versions [3.59,3.63) of GNU make to not export all variables. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fplll-5.3.0/configure new/fplll-5.3.1/configure --- old/fplll-5.3.0/configure 2019-11-23 12:29:12.000000000 +0100 +++ new/fplll-5.3.1/configure 2019-12-14 17:58:15.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for fplll 5.3.0. +# Generated by GNU Autoconf 2.69 for fplll 5.3.1. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ # Identity of this package. PACKAGE_NAME='fplll' PACKAGE_TARNAME='fplll' -PACKAGE_VERSION='5.3.0' -PACKAGE_STRING='fplll 5.3.0' +PACKAGE_VERSION='5.3.1' +PACKAGE_STRING='fplll 5.3.1' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1339,7 +1339,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures fplll 5.3.0 to adapt to many kinds of systems. +\`configure' configures fplll 5.3.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1409,7 +1409,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of fplll 5.3.0:";; + short | recursive ) echo "Configuration of fplll 5.3.1:";; esac cat <<\_ACEOF @@ -1530,7 +1530,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -fplll configure 5.3.0 +fplll configure 5.3.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2179,7 +2179,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by fplll $as_me 5.3.0, which was +It was created by fplll $as_me 5.3.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2532,9 +2532,9 @@ # cf http://comments.gmane.org/gmane.comp.sysutils.autoconf.general/15737 # First extract pieces from the version number string -FPLLL_MAJOR_VERSION=`echo 5.3.0 | awk -F. '{print $1}'` -FPLLL_MINOR_VERSION=`echo 5.3.0 | awk -F. '{print $2}'` -FPLLL_MICRO_VERSION=`echo 5.3.0 | awk -F. '{print $3}'` +FPLLL_MAJOR_VERSION=`echo 5.3.1 | awk -F. '{print $1}'` +FPLLL_MINOR_VERSION=`echo 5.3.1 | awk -F. '{print $2}'` +FPLLL_MICRO_VERSION=`echo 5.3.1 | awk -F. '{print $3}'` FPLLL_VERSION=$FPLLL_MAJOR_VERSION.$FPLLL_MINOR_VERSION.$FPLLL_MICRO_VERSION$FPLLL_MICRO_VERSION_SUFFIX FPLLL_VERSION_NUMBER=`expr $FPLLL_MAJOR_VERSION \* 1000000 + $FPLLL_MINOR_VERSION \* 1000 + $FPLLL_MICRO_VERSION` @@ -3054,7 +3054,7 @@ # Define the identity of the package. PACKAGE='fplll' - VERSION='5.3.0' + VERSION='5.3.1' cat >>confdefs.h <<_ACEOF @@ -11843,7 +11843,7 @@ # current, and set both revision and age to zero. FPLLL_LT_CURRENT=6 -FPLLL_LT_REVISION=0 +FPLLL_LT_REVISION=1 FPLLL_LT_AGE=0 @@ -16201,333 +16201,28 @@ SET_MAKE="MAKE=${MAKE-make}" fi - ax_cxx_compile_cxx11_required=true + ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=true ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_success=no - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5 -$as_echo_n "checking whether $CXX supports C++11 features by default... " >&6; } -if ${ax_cv_cxx_compile_cxx11+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -// If the compiler admits that it is not ready for C++11, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 201103L - -#error "This is not a C++11 compiler" - -#else - -namespace cxx11 -{ - - namespace test_static_assert - { - - template <typename T> - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; - - } - - namespace test_final_override - { - - struct Base - { - virtual void f() {} - }; - - struct Derived : public Base - { - virtual void f() override {} - }; - - } - - namespace test_double_right_angle_brackets - { - - template < typename T > - struct check {}; - - typedef check<void> single_type; - typedef check<check<void>> double_type; - typedef check<check<check<void>>> triple_type; - typedef check<check<check<check<void>>>> quadruple_type; - - } - - namespace test_decltype - { - - int - f() - { - int a = 1; - decltype(a) b = 2; - return a + b; - } - - } - - namespace test_type_deduction - { - - template < typename T1, typename T2 > - struct is_same - { - static const bool value = false; - }; - - template < typename T > - struct is_same<T, T> - { - static const bool value = true; - }; - - template < typename T1, typename T2 > - auto - add(T1 a1, T2 a2) -> decltype(a1 + a2) - { - return a1 + a2; - } - - int - test(const int c, volatile int v) - { - static_assert(is_same<int, decltype(0)>::value == true, ""); - static_assert(is_same<int, decltype(c)>::value == false, ""); - static_assert(is_same<int, decltype(v)>::value == false, ""); - auto ac = c; - auto av = v; - auto sumi = ac + av + 'x'; - auto sumf = ac + av + 1.0; - static_assert(is_same<int, decltype(ac)>::value == true, ""); - static_assert(is_same<int, decltype(av)>::value == true, ""); - static_assert(is_same<int, decltype(sumi)>::value == true, ""); - static_assert(is_same<int, decltype(sumf)>::value == false, ""); - static_assert(is_same<int, decltype(add(c, v))>::value == true, ""); - return (sumf > 0.0) ? sumi : add(c, v); - } - - } - - namespace test_noexcept - { - - int f() { return 0; } - int g() noexcept { return 0; } - - static_assert(noexcept(f()) == false, ""); - static_assert(noexcept(g()) == true, ""); - - } - - namespace test_constexpr - { - - template < typename CharT > - unsigned long constexpr - strlen_c_r(const CharT *const s, const unsigned long acc) noexcept - { - return *s ? strlen_c_r(s + 1, acc + 1) : acc; - } - - template < typename CharT > - unsigned long constexpr - strlen_c(const CharT *const s) noexcept - { - return strlen_c_r(s, 0UL); - } - - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("1") == 1UL, ""); - static_assert(strlen_c("example") == 7UL, ""); - static_assert(strlen_c("another\0example") == 7UL, ""); - - } - - namespace test_rvalue_references - { - - template < int N > - struct answer - { - static constexpr int value = N; - }; - - answer<1> f(int&) { return answer<1>(); } - answer<2> f(const int&) { return answer<2>(); } - answer<3> f(int&&) { return answer<3>(); } - - void - test() - { - int i = 0; - const int c = 0; - static_assert(decltype(f(i))::value == 1, ""); - static_assert(decltype(f(c))::value == 2, ""); - static_assert(decltype(f(0))::value == 3, ""); - } - - } - - namespace test_uniform_initialization - { - - struct test - { - static const int zero {}; - static const int one {1}; - }; - - static_assert(test::zero == 0, ""); - static_assert(test::one == 1, ""); - - } - - namespace test_lambdas - { - - void - test1() - { - auto lambda1 = [](){}; - auto lambda2 = lambda1; - lambda1(); - lambda2(); - } - - int - test2() - { - auto a = [](int i, int j){ return i + j; }(1, 2); - auto b = []() -> int { return '0'; }(); - auto c = [=](){ return a + b; }(); - auto d = [&](){ return c; }(); - auto e = [a, &b](int x) mutable { - const auto identity = [](int y){ return y; }; - for (auto i = 0; i < a; ++i) - a += b--; - return x + identity(a + b); - }(0); - return a + b + c + d + e; - } - - int - test3() - { - const auto nullary = [](){ return 0; }; - const auto unary = [](int x){ return x; }; - using nullary_t = decltype(nullary); - using unary_t = decltype(unary); - const auto higher1st = [](nullary_t f){ return f(); }; - const auto higher2nd = [unary](nullary_t f1){ - return [unary, f1](unary_t f2){ return f2(unary(f1())); }; - }; - return higher1st(nullary) + higher2nd(nullary)(unary); - } - - } - - namespace test_variadic_templates - { - - template <int...> - struct sum; - - template <int N0, int... N1toN> - struct sum<N0, N1toN...> - { - static constexpr auto value = N0 + sum<N1toN...>::value; - }; - - template <> - struct sum<> - { - static constexpr auto value = 0; - }; - - static_assert(sum<>::value == 0, ""); - static_assert(sum<1>::value == 1, ""); - static_assert(sum<23>::value == 23, ""); - static_assert(sum<1, 2>::value == 3, ""); - static_assert(sum<5, 5, 11>::value == 21, ""); - static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); - - } - - // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae - // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function - // because of this. - namespace test_template_alias_sfinae - { - - struct foo {}; - - template<typename T> - using member = typename T::member_type; - - template<typename T> - void func(...) {} - - template<typename T> - void func(member<T>*) {} - - void test(); - - void test() { func<foo>(0); } - - } - -} // namespace cxx11 - -#endif // __cplusplus >= 201103L - - - -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ax_cv_cxx_compile_cxx11=yes -else - ax_cv_cxx_compile_cxx11=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5 -$as_echo "$ax_cv_cxx_compile_cxx11" >&6; } - if test x$ax_cv_cxx_compile_cxx11 = xyes; then - ac_success=yes - fi if test x$ac_success = xno; then - for switch in -std=c++11 -std=c++0x +std=c++11 "-h std=c++11"; do - cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 $as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; } if eval \${$cachevar+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_CXX="$CXX" - CXX="$CXX $switch" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -16563,11 +16258,13 @@ struct Base { + virtual ~Base() {} virtual void f() {} }; struct Derived : public Base { + virtual ~Derived() override {} virtual void f() override {} }; @@ -16822,17 +16519,21 @@ eval $cachevar=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CXX="$ac_save_CXX" + CXX="$ac_save_CXX" fi eval ac_res=\$$cachevar { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break fi - ac_success=yes + done + if test x$ac_success = xyes; then break fi done @@ -17896,14 +17597,14 @@ # that too in a future libc.) So we'll check first for the # standard Solaris way of linking pthreads (-mt -lpthread). - ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags" + ax_pthread_flags=",-mt,-lpthread pthread $ax_pthread_flags" ;; esac # GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) if test "x$GCC" = "xyes"; then : - ax_pthread_flags="-pthread -pthreads $ax_pthread_flags" + ax_pthread_flags=",-pthread,-lpthread -pthread -pthreads $ax_pthread_flags" fi # The presence of a feature test macro requesting re-entrant function @@ -18071,19 +17772,19 @@ $as_echo_n "checking whether pthreads work without any flags... " >&6; } ;; - -mt,pthread) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with -mt -lpthread" >&5 -$as_echo_n "checking whether pthreads work with -mt -lpthread... " >&6; } - PTHREAD_CFLAGS="-mt" - PTHREAD_LIBS="-lpthread" - ;; - -*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5 $as_echo_n "checking whether pthreads work with $ax_pthread_try_flag... " >&6; } PTHREAD_CFLAGS="$ax_pthread_try_flag" ;; + ,*) + PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^,\(.*\),\(.*\)$/\1/"` + PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^,\(.*\),\(.*\)$/\2/"` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with CFLAGS=\"$PTHREAD_CFLAGS\" LIBS=\"$PTHREAD_LIBS\"" >&5 +$as_echo_n "checking whether pthreads work with CFLAGS=\"$PTHREAD_CFLAGS\" LIBS=\"$PTHREAD_LIBS\"... " >&6; } + ;; + pthread-config) # Extract the first word of "pthread-config", so it can be a program name with args. set dummy pthread-config; ac_word=$2 @@ -18158,7 +17859,13 @@ # if $ax_pthread_check_cond # error "$ax_pthread_check_macro must be defined" # endif - static void routine(void *a) { a = 0; } + static void *some_global = NULL; + static void routine(void *a) + { + /* To avoid any unused-parameter or + unused-but-set-parameter warning. */ + some_global = a; + } static void *start_routine(void *a) { return a; } int main () @@ -18274,6 +17981,7 @@ main () { int i = PTHREAD_PRIO_INHERIT; + return i; ; return 0; } @@ -19017,7 +18725,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by fplll $as_me 5.3.0, which was +This file was extended by fplll $as_me 5.3.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -19083,7 +18791,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -fplll config.status 5.3.0 +fplll config.status 5.3.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fplll-5.3.0/configure.ac new/fplll-5.3.1/configure.ac --- old/fplll-5.3.0/configure.ac 2019-11-23 12:28:47.000000000 +0100 +++ new/fplll-5.3.1/configure.ac 2019-12-14 17:57:49.000000000 +0100 @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT(fplll, 5.3.0) +AC_INIT(fplll, 5.3.1) AC_CONFIG_SRCDIR([fplll/fplll.cpp]) # cf http://comments.gmane.org/gmane.comp.sysutils.autoconf.general/15737 @@ -39,7 +39,7 @@ # current, and set both revision and age to zero. FPLLL_LT_CURRENT=6 -FPLLL_LT_REVISION=0 +FPLLL_LT_REVISION=1 FPLLL_LT_AGE=0 AC_SUBST(FPLLL_LT_CURRENT) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fplll-5.3.0/fplll/householder.h new/fplll-5.3.1/fplll/householder.h --- old/fplll-5.3.0/fplll/householder.h 2019-11-23 12:28:47.000000000 +0100 +++ new/fplll-5.3.1/fplll/householder.h 2019-12-14 17:57:49.000000000 +0100 @@ -554,7 +554,8 @@ inline void MatHouseholder<ZT, FT>::norm_square_R_row(FT &f, int k, int beg, int end, long &expo) { FPLLL_DEBUG_CHECK(k >= 0 && k < d); - FPLLL_DEBUG_CHECK(beg <= end && end <= k); + FPLLL_DEBUG_CHECK(beg <= end); + FPLLL_DEBUG_CHECK(end <= k); if (end == beg) f = 0.0; else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fplll-5.3.0/fplll/io/thread_pool.hpp new/fplll-5.3.1/fplll/io/thread_pool.hpp --- old/fplll-5.3.0/fplll/io/thread_pool.hpp 2019-11-23 12:28:47.000000000 +0100 +++ new/fplll-5.3.1/fplll/io/thread_pool.hpp 2019-12-14 17:57:49.000000000 +0100 @@ -43,7 +43,7 @@ #include <atomic> /*************************** example usage ***************************************\ -grep "^//test.cpp" thread_pool.hpp -A18 > test.cpp +grep "^//test.cpp" thread_pool.hpp -A33 > test.cpp g++ -std=c++11 -o test test.cpp -pthread -lpthread //test.cpp: @@ -62,6 +62,21 @@ std::cout << aui << std::endl; tp.wait_work(); std::cout << aui << std::endl; + + // blocking run 'void f()' function on all threads and main thread + tp.run( [&aui](){ + std::cout << "Run 1: Thread started." << std::endl; + }); + + // blocking run 'void f(int)' function on all threads and main thread + tp.run( [&aui](int threadid){ + std::cout << "Run 2: Thread " << threadid << " started." << std::endl; + }); + + // blocking run 'void f(int,int)' function on all threads and main thread + tp.run( [&aui](int threadid, int threads){ + std::cout << "Run 3: Thread " << threadid << " of " << threads << " started." << std::endl; + }); return 0; } @@ -99,6 +114,14 @@ // sleep until all threads are idle void wait_sleep(); + // run a job 'void f()' on #threads <= #threadpoolsize+1 + // (-1 => #threads = #threadpoolsize + 1) + void run(const std::function<void()>& f, int threads = -1); + // run a job given function 'void f(int threadid)' + void run(const std::function<void(int)>& f, int threads = -1); + // run a job given function 'void f(int threadid, int threads)' (0 <= threadid < threads) + void run(const std::function<void(int,int)>& f, int threads = -1); + private: void _init_thread(); @@ -199,18 +222,47 @@ return task->get_future(); } + inline void thread_pool::run(const std::function<void()>& f, int threads) + { + if (threads < 1 || threads > int(_threads.size())+1) + threads = int(_threads.size())+1; + for (int i = 0; i < threads; ++i) + this->push(f); + this->wait_work(); + } + + inline void thread_pool::run(const std::function<void(int)>& f, int threads) + { + if (threads < 1 || threads > int(_threads.size())+1) + threads = int(_threads.size())+1; + for (int i = 0; i < threads; ++i) + this->push( [f,i](){f(i);} ); + this->wait_work(); + } + + inline void thread_pool::run(const std::function<void(int,int)>& f, int threads) + { + if (threads < 1 || threads > int(_threads.size())+1) + threads = int(_threads.size())+1; + for (int i = 0; i < threads; ++i) + this->push( [f,i,threads](){f(i,threads);} ); + this->wait_work(); + } + inline void thread_pool::resize(std::size_t nrthreads) { if (nrthreads < _threads.size()) { // decreasing number of active threads + std::unique_lock<std::mutex> lock(_mutex); for (std::size_t i = nrthreads; i < _threads.size(); ++i) *(_threads_stop[i]) = true; _condition.notify_all(); + lock.unlock(); for (std::size_t i = nrthreads; i < _threads.size(); ++i) _threads[i]->join(); - std::unique_lock<std::mutex> lock(_mutex); + lock.lock(); _threads_stop.resize(nrthreads); _threads.resize(nrthreads); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fplll-5.3.0/fplll/pruner/pruner.h new/fplll-5.3.1/fplll/pruner/pruner.h --- old/fplll-5.3.0/fplll/pruner/pruner.h 2019-11-23 12:28:47.000000000 +0100 +++ new/fplll-5.3.1/fplll/pruner/pruner.h 2019-12-14 17:57:49.000000000 +0100 @@ -1027,8 +1027,8 @@ status |= (b[i] > 1.0001); b[i] = b[i] > 1 ? 1. : b[i]; - // note min_pruning_coefficients always has length n - if (b[i] <= min_pruning_coefficients[i / c]) + // note min_pruning_coefficients always has length d + if (i / c < d && b[i] <= min_pruning_coefficients[i / c]) b[i] = min_pruning_coefficients[i / c]; } @@ -1041,7 +1041,7 @@ } } - for (int i = j - 1; i >= 0; --i) + for (int i = std::min(j - 1, dn - 2); i >= 0; --i) { if (b[i + 1] < b[i]) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fplll-5.3.0/fplll.pc.in new/fplll-5.3.1/fplll.pc.in --- old/fplll-5.3.0/fplll.pc.in 2019-11-23 12:28:47.000000000 +0100 +++ new/fplll-5.3.1/fplll.pc.in 2019-12-14 17:57:49.000000000 +0100 @@ -6,4 +6,5 @@ Name: @PACKAGE_NAME@ Description: lattice algorithms with floating-point computations Version: @PACKAGE_VERSION@ -Libs: -L${libdir} @LIBQD_LIBADD@ @LIBGMP@ -lmpfr -lfplll +Cflags: @PTHREAD_CFLAGS@ +Libs: -L${libdir} @LIBQD_LIBADD@ @LIBGMP@ @PTHREAD_LIBS@ -lmpfr -lfplll diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fplll-5.3.0/m4/ax_cxx_compile_stdcxx.m4 new/fplll-5.3.1/m4/ax_cxx_compile_stdcxx.m4 --- old/fplll-5.3.0/m4/ax_cxx_compile_stdcxx.m4 2019-11-23 12:28:47.000000000 +0100 +++ new/fplll-5.3.1/m4/ax_cxx_compile_stdcxx.m4 2019-12-14 17:57:49.000000000 +0100 @@ -1,5 +1,5 @@ # =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html +# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html # =========================================================================== # # SYNOPSIS @@ -33,21 +33,23 @@ # Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <[email protected]> # Copyright (c) 2015 Paul Norman <[email protected]> # Copyright (c) 2015 Moritz Klammler <[email protected]> +# Copyright (c) 2016, 2018 Krzesimir Nowak <[email protected]> +# Copyright (c) 2019 Enji Cooper <[email protected]> # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 4 +#serial 11 dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro dnl (serial version number 13). AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl - m4_if([$1], [11], [], - [$1], [14], [], - [$1], [17], [m4_fatal([support for C++17 not yet implemented in AX_CXX_COMPILE_STDCXX])], + m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], + [$1], [14], [ax_cxx_compile_alternatives="14 1y"], + [$1], [17], [ax_cxx_compile_alternatives="17 1z"], [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl m4_if([$2], [], [], [$2], [ext], [], @@ -59,18 +61,11 @@ [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) AC_LANG_PUSH([C++])dnl ac_success=no - AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, - ax_cv_cxx_compile_cxx$1, - [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], - [ax_cv_cxx_compile_cxx$1=yes], - [ax_cv_cxx_compile_cxx$1=no])]) - if test x$ax_cv_cxx_compile_cxx$1 = xyes; then - ac_success=yes - fi m4_if([$2], [noext], [], [dnl if test x$ac_success = xno; then - for switch in -std=gnu++$1 -std=gnu++0x; do + for alternative in ${ax_cxx_compile_alternatives}; do + switch="-std=gnu++${alternative}" cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, $cachevar, @@ -96,22 +91,27 @@ dnl HP's aCC needs +std=c++11 according to: dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf dnl Cray's crayCC needs "-h std=c++11" - for switch in -std=c++$1 -std=c++0x +std=c++$1 "-h std=c++$1"; do - cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) - AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, - $cachevar, - [ac_save_CXX="$CXX" - CXX="$CXX $switch" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], - [eval $cachevar=yes], - [eval $cachevar=no]) - CXX="$ac_save_CXX"]) - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, + $cachevar, + [ac_save_CXX="$CXX" + CXX="$CXX $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXX="$ac_save_CXX"]) + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break fi - ac_success=yes + done + if test x$ac_success = xyes; then break fi done @@ -148,6 +148,11 @@ _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 ) +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 +) dnl Tests for new features in C++11 @@ -185,11 +190,13 @@ struct Base { + virtual ~Base() {} virtual void f() {} }; struct Derived : public Base { + virtual ~Derived() override {} virtual void f() override {} }; @@ -518,7 +525,7 @@ } - namespace test_digit_seperators + namespace test_digit_separators { constexpr auto ten_million = 100'000'000; @@ -560,3 +567,385 @@ #endif // __cplusplus >= 201402L ]]) + + +dnl Tests for new features in C++17 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201703L + +#error "This is not a C++17 compiler" + +#else + +#include <initializer_list> +#include <utility> +#include <type_traits> + +namespace cxx17 +{ + + namespace test_constexpr_lambdas + { + + constexpr int foo = [](){return 42;}(); + + } + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template<typename... Args> + int multiply(Args... args) + { + return (args * ... * 1); + } + + template<typename... Args> + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value); + static_assert(std::is_same<int, decltype(bar)>::value); + } + + namespace test_typename_in_template_template_parameter + { + + template<template<typename> typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template <bool cond> + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + + namespace test_template_argument_deduction_for_class_templates + { + + template <typename T1, typename T2> + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + + } + + namespace test_non_type_auto_template_parameters + { + + template <auto n> + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + + namespace test_structured_bindings + { + + int arr[2] = { 1, 2 }; + std::pair<int, int> pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair<int, int>& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + + } + + namespace test_exception_spec_type_system + { + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template<typename T> + Bad + f(T*, T*); + + template<typename T1, typename T2> + Good + f(T1*, T2*); + + static_assert (std::is_same_v<Good, decltype(f(g1, g2))>); + + } + + namespace test_inline_variables + { + + template<class T> void f(T) + {} + + template<class T> inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // __cplusplus < 201703L + +]]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fplll-5.3.0/m4/ax_pthread.m4 new/fplll-5.3.1/m4/ax_pthread.m4 --- old/fplll-5.3.0/m4/ax_pthread.m4 2019-11-23 12:28:47.000000000 +0100 +++ new/fplll-5.3.1/m4/ax_pthread.m4 2019-12-14 17:57:49.000000000 +0100 @@ -82,7 +82,8 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 24 +# modified based on version serial 26 +## serial 26 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AC_DEFUN([AX_PTHREAD], [ @@ -194,14 +195,14 @@ # that too in a future libc.) So we'll check first for the # standard Solaris way of linking pthreads (-mt -lpthread). - ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags" + ax_pthread_flags=",-mt,-lpthread pthread $ax_pthread_flags" ;; esac # GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) AS_IF([test "x$GCC" = "xyes"], - [ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"]) + [ax_pthread_flags=",-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"]) # The presence of a feature test macro requesting re-entrant function # definitions is, on some systems, a strong hint that pthreads support is @@ -328,17 +329,17 @@ AC_MSG_CHECKING([whether pthreads work without any flags]) ;; - -mt,pthread) - AC_MSG_CHECKING([whether pthreads work with -mt -lpthread]) - PTHREAD_CFLAGS="-mt" - PTHREAD_LIBS="-lpthread" - ;; - -*) AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag]) PTHREAD_CFLAGS="$ax_pthread_try_flag" ;; + ,*) + PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^,\(.*\),\(.*\)$/\1/"` + PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^,\(.*\),\(.*\)$/\2/"` + AC_MSG_CHECKING([whether pthreads work with CFLAGS="$PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS"]) + ;; + pthread-config) AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) AS_IF([test "x$ax_pthread_config" = "xno"], [continue]) @@ -371,7 +372,13 @@ # if $ax_pthread_check_cond # error "$ax_pthread_check_macro must be defined" # endif - static void routine(void *a) { a = 0; } + static void *some_global = NULL; + static void routine(void *a) + { + /* To avoid any unused-parameter or + unused-but-set-parameter warning. */ + some_global = a; + } static void *start_routine(void *a) { return a; }], [pthread_t th; pthread_attr_t attr; pthread_create(&th, 0, start_routine, 0); @@ -438,7 +445,8 @@ AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], [ax_cv_PTHREAD_PRIO_INHERIT], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], - [[int i = PTHREAD_PRIO_INHERIT;]])], + [[int i = PTHREAD_PRIO_INHERIT; + return i;]])], [ax_cv_PTHREAD_PRIO_INHERIT=yes], [ax_cv_PTHREAD_PRIO_INHERIT=no]) ])
