Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package antic for openSUSE:Factory checked in at 2021-05-07 16:46:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/antic (Old) and /work/SRC/openSUSE:Factory/.antic.new.2988 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "antic" Fri May 7 16:46:09 2021 rev:3 rq:891304 version:0.2.4 Changes: -------- --- /work/SRC/openSUSE:Factory/antic/antic.changes 2020-12-28 10:31:10.701795361 +0100 +++ /work/SRC/openSUSE:Factory/.antic.new.2988/antic.changes 2021-05-07 16:46:34.912103792 +0200 @@ -1,0 +2,7 @@ +Fri May 7 11:59:40 UTC 2021 - Jan Engelhardt <jeng...@inai.de> + +- Update to release 0.2.4 + * Fix get and set coeff to not read/write past length of + unreduced poly and fix test code. + +------------------------------------------------------------------- Old: ---- v0.2.3.tar.gz New: ---- v0.2.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ antic.spec ++++++ --- /var/tmp/diff_new_pack.YJ4c86/_old 2021-05-07 16:46:35.384101654 +0200 +++ /var/tmp/diff_new_pack.YJ4c86/_new 2021-05-07 16:46:35.388101636 +0200 @@ -1,7 +1,7 @@ # # spec file for package antic # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ Name: antic %define lname libantic0 -Version: 0.2.3 +Version: 0.2.4 Release: 0 Summary: Algebraic Number Theory library in C License: LGPL-2.1-or-later ++++++ v0.2.3.tar.gz -> v0.2.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/antic-0.2.3/.build_dependencies new/antic-0.2.4/.build_dependencies --- old/antic-0.2.3/.build_dependencies 2020-12-11 15:47:53.000000000 +0100 +++ new/antic-0.2.4/.build_dependencies 2021-04-15 13:22:11.000000000 +0200 @@ -1,27 +1,31 @@ -#! /bin/sh +#!/bin/bash + +MAKE=${MAKE:=make} + +set -exo pipefail wget http://mpir.org/mpir-2.7.2.tar.bz2 tar -xf mpir-2.7.2.tar.bz2 mkdir -p local -cd mpir-2.7.2 +pushd mpir-2.7.2 ./configure ABI=$ABI --enable-gmpcompat --prefix=${LOCAL} -${MAKE} > /dev/null 2>&1 -${MAKE} install > /dev/null 2>&1 -cd .. +${MAKE} +${MAKE} install +popd wget http://www.mpfr.org/mpfr-4.0.0/mpfr-4.0.0.tar.bz2 tar -xf mpfr-4.0.0.tar.bz2 -cd mpfr-4.0.0 +pushd mpfr-4.0.0 ./configure ABI=$ABI --with-gmp=${LOCAL} --prefix=${LOCAL} -${MAKE} > /dev/null 2>&1 -${MAKE} install > /dev/null 2>&1 -cd .. +${MAKE} +${MAKE} install +popd -git clone https://github.com/wbhart/flint2 -cd flint2 +git clone --branch $FLINT_TAG https://github.com/wbhart/flint2 +pushd flint2 ./configure --with-mpir=${LOCAL} --with-mpfr=${LOCAL} --prefix=${LOCAL} -${MAKE} > /dev/null 2>&1 -${MAKE} install > /dev/null 2>&1 -cd .. +${MAKE} +${MAKE} install +popd diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/antic-0.2.3/.travis.yml new/antic-0.2.4/.travis.yml --- old/antic-0.2.3/.travis.yml 2020-12-11 15:47:53.000000000 +0100 +++ new/antic-0.2.4/.travis.yml 2021-04-15 13:22:11.000000000 +0200 @@ -6,11 +6,16 @@ packages: - texinfo env: - MAKE="make -j4" + MAKEFLAGS=-j2 os: - osx - linux +env: + - FLINT_TAG: v2.6.3 + - FLINT_TAG: v2.7.0 + - FLINT_TAG: v2.7.1 + - FLINT_TAG: trunk osx_image: xcode6.4 @@ -23,12 +28,12 @@ - while sleep 30; do echo "still alive"; done & - ./.build_dependencies - ./configure --with-mpir=${LOCAL} --with-mpfr=${LOCAL} --with-flint=${LOCAL} --prefix=${LOCAL} - - ${MAKE} + - make - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then otool -L libantic.dylib; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ldd libantic.so; fi script: - - ${MAKE} check - - ${MAKE} install + - make check + - make install - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then otool -L local/lib/libantic.dylib; fi - PREFIX=$(pwd)/local ./.check_post_install diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/antic-0.2.3/configure new/antic-0.2.4/configure --- old/antic-0.2.3/configure 2020-12-11 15:47:53.000000000 +0100 +++ new/antic-0.2.4/configure 2021-04-15 13:22:11.000000000 +0200 @@ -10,9 +10,15 @@ # # antic => soname # 0.0.1 => 0.0.0 +# 0.2.0 => 0.0.0 +# 0.2.1 => 0.0.0 +# 0.2.2 => 0.0.0 +# 0.2.3 => 0.0.0 +# 0.2.4 => 0.2.4 + ANTIC_MAJOR=0 -ANTIC_MINOR=0 -ANTIC_PATCH=1 +ANTIC_MINOR=2 +ANTIC_PATCH=4 PREFIX="/usr/local" GMP_DIR="/usr/local" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/antic-0.2.3/nf.h new/antic-0.2.4/nf.h --- old/antic-0.2.3/nf.h 2020-12-11 15:47:53.000000000 +0100 +++ new/antic-0.2.4/nf.h 2021-04-15 13:22:11.000000000 +0200 @@ -27,6 +27,16 @@ extern "C" { #endif +/* antic version number */ + +#define __ANTIC_VERSION 0 +#define __ANTIC_VERSION_MINOR 2 +#define __ANTIC_VERSION_PATCHLEVEL 4 +#define ANTIC_VERSION "0.2.4" +#define __ANTIC_RELEASE (__ANTIC_VERSION * 10000 + \ + __ANTIC_VERSION_MINOR * 100 + \ + __ANTIC_VERSION_PATCHLEVEL) + long int antic_test_multiplier(void); typedef struct { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/antic-0.2.3/nf_elem/get_fmpz_mod_poly.c new/antic-0.2.4/nf_elem/get_fmpz_mod_poly.c --- old/antic-0.2.3/nf_elem/get_fmpz_mod_poly.c 2020-12-11 15:47:53.000000000 +0100 +++ new/antic-0.2.4/nf_elem/get_fmpz_mod_poly.c 2021-04-15 13:22:11.000000000 +0200 @@ -16,21 +16,25 @@ #include "nf_elem.h" +#if __FLINT_RELEASE >= 20700 void _nf_elem_get_fmpz_mod_poly(fmpz_mod_poly_t pol, const nf_elem_t a, const nf_t nf, const fmpz_mod_ctx_t ctx) +#else +void _nf_elem_get_fmpz_mod_poly(fmpz_mod_poly_t pol, const nf_elem_t a, const nf_t nf) +#endif { if (nf_elem_is_zero(a, nf)) { - fmpz_mod_poly_zero(pol, ctx); + FMPZ_MOD_POLY_ZERO(pol, ctx); return; } if (nf->flag & NF_LINEAR) { { - fmpz_mod_poly_fit_length(pol, 1, ctx); + FMPZ_MOD_POLY_FIT_LENGTH(pol, 1, ctx); - fmpz_mod(pol->coeffs + 0, LNF_ELEM_NUMREF(a), ctx->n); + FMPZ_MOD(pol->coeffs + 0, LNF_ELEM_NUMREF(a), ctx, &(pol->p)); _fmpz_mod_poly_set_length(pol, 1); _fmpz_mod_poly_normalise(pol); @@ -38,11 +42,11 @@ } } else if (nf->flag & NF_QUADRATIC) { - fmpz_mod_poly_fit_length(pol, 3, ctx); + FMPZ_MOD_POLY_FIT_LENGTH(pol, 3, ctx); - fmpz_mod(pol->coeffs + 0, QNF_ELEM_NUMREF(a), ctx->n); - fmpz_mod(pol->coeffs + 1, QNF_ELEM_NUMREF(a) + 1, ctx->n); - fmpz_mod(pol->coeffs + 2, QNF_ELEM_NUMREF(a) + 2, ctx->n); + FMPZ_MOD(pol->coeffs + 0, QNF_ELEM_NUMREF(a), ctx, &(pol->p)); + FMPZ_MOD(pol->coeffs + 1, QNF_ELEM_NUMREF(a) + 1, ctx, &(pol->p)); + FMPZ_MOD(pol->coeffs + 2, QNF_ELEM_NUMREF(a) + 2, ctx, &(pol->p)); _fmpz_mod_poly_set_length(pol, 3); _fmpz_mod_poly_normalise(pol); @@ -51,33 +55,48 @@ slong len = NF_ELEM(a)->length; slong i; - fmpz_mod_poly_fit_length(pol, len, ctx); + FMPZ_MOD_POLY_FIT_LENGTH(pol, len, ctx); for (i = 0; i < len; i++) - fmpz_mod(pol->coeffs + i, NF_ELEM_NUMREF(a) + i, ctx->n); + FMPZ_MOD(pol->coeffs + i, NF_ELEM_NUMREF(a) + i, ctx, &(pol->p)); _fmpz_mod_poly_set_length(pol, len); _fmpz_mod_poly_normalise(pol); } } +#if __FLINT_RELEASE >= 20700 void nf_elem_get_fmpz_mod_poly_den(fmpz_mod_poly_t pol, const nf_elem_t a, const nf_t nf, int den, const fmpz_mod_ctx_t ctx) +#else +void nf_elem_get_fmpz_mod_poly_den(fmpz_mod_poly_t pol, const nf_elem_t a, const nf_t nf, int den) +#endif { +#if __FLINT_RELEASE >= 20700 _nf_elem_get_fmpz_mod_poly(pol, a, nf, ctx); +#else + _nf_elem_get_fmpz_mod_poly(pol, a, nf); +#endif if (den) { if (nf->flag & NF_LINEAR) - fmpz_mod_poly_scalar_div_fmpz(pol, pol, LNF_ELEM_DENREF(a), ctx); + FMPZ_MOD_POLY_SCALAR_DIV_FMPZ(pol, pol, LNF_ELEM_DENREF(a), ctx); else if (nf->flag & NF_QUADRATIC) - fmpz_mod_poly_scalar_div_fmpz(pol, pol, QNF_ELEM_DENREF(a), ctx); + FMPZ_MOD_POLY_SCALAR_DIV_FMPZ(pol, pol, QNF_ELEM_DENREF(a), ctx); else - fmpz_mod_poly_scalar_div_fmpz(pol, pol, NF_ELEM_DENREF(a), ctx); + FMPZ_MOD_POLY_SCALAR_DIV_FMPZ(pol, pol, NF_ELEM_DENREF(a), ctx); } } +#if __FLINT_RELEASE >= 20700 void nf_elem_get_fmpz_mod_poly(fmpz_mod_poly_t pol, const nf_elem_t a, const nf_t nf, const fmpz_mod_ctx_t ctx) { nf_elem_get_fmpz_mod_poly_den(pol, a, nf, 1, ctx); } +#else +void nf_elem_get_fmpz_mod_poly(fmpz_mod_poly_t pol, const nf_elem_t a, const nf_t nf) +{ + nf_elem_get_fmpz_mod_poly_den(pol, a, nf, 1); +} +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/antic-0.2.3/nf_elem/test/t-get_fmpz_mod_poly.c new/antic-0.2.4/nf_elem/test/t-get_fmpz_mod_poly.c --- old/antic-0.2.3/nf_elem/test/t-get_fmpz_mod_poly.c 2020-12-11 15:47:53.000000000 +0100 +++ new/antic-0.2.4/nf_elem/test/t-get_fmpz_mod_poly.c 2021-04-15 13:22:11.000000000 +0200 @@ -37,7 +37,9 @@ nf_elem_t a; fmpz_mod_poly_t reduced_elem; fmpz_t coeff, mod, reduced_coeff; +#if __FLINT_RELEASE >= 20700 fmpz_mod_ctx_t ctx; +#endif fmpz_init(mod); fmpz_randtest_unsigned(mod, state, 2 * FLINT_BITS); @@ -45,8 +47,12 @@ fmpz_init(coeff); fmpz_init(reduced_coeff); +#if __FLINT_RELEASE >= 20700 fmpz_mod_ctx_init(ctx, mod); fmpz_mod_poly_init(reduced_elem, ctx); +#else + fmpz_mod_poly_init(reduced_elem, &mod); +#endif nf_init_randtest(nf, state, 40, 200); @@ -54,13 +60,21 @@ nf_elem_randtest(a, state, 200, nf); +#if __FLINT_RELEASE >= 20700 nf_elem_get_fmpz_mod_poly_den(reduced_elem, a, nf, 0, ctx); +#else + nf_elem_get_fmpz_mod_poly_den(reduced_elem, a, nf, 0); +#endif for (j = 0; j < fmpq_poly_degree(nf->pol); j++) { nf_elem_get_coeff_fmpz(coeff, a, j, nf); fmpz_mod(coeff, coeff, mod); +#if __FLINT_RELEASE >= 20700 fmpz_mod_poly_get_coeff_fmpz(reduced_coeff, reduced_elem, j, ctx); +#else + fmpz_mod_poly_get_coeff_fmpz(reduced_coeff, reduced_elem, j); +#endif result = fmpz_equal(reduced_coeff, coeff); if (!result) { @@ -68,14 +82,24 @@ printf("f = "); fmpq_poly_print_pretty(nf->pol, "x"); printf("\n"); printf("a = "); nf_elem_print_pretty(a, nf, "x"); printf("\n"); printf("n = "); fmpz_print(mod); printf("\n"); - printf("a mod n = "); fmpz_mod_poly_print_pretty(reduced_elem, "x", ctx); printf("\n"); + printf("a mod n = "); +#if __FLINT_RELEASE >= 20700 + fmpz_mod_poly_print_pretty(reduced_elem, "x", ctx); +#else + fmpz_mod_poly_print_pretty(reduced_elem, "x"); +#endif + printf("\n"); abort(); } } nf_elem_clear(a, nf); +#if __FLINT_RELEASE >= 20700 fmpz_mod_poly_clear(reduced_elem, ctx); fmpz_mod_ctx_clear(ctx); +#else + fmpz_mod_poly_clear(reduced_elem); +#endif fmpz_clear(coeff); fmpz_clear(mod); nf_clear(nf); @@ -88,7 +112,9 @@ nf_elem_t a; fmpz_mod_poly_t reduced_elem; fmpz_t coeff, reduced_coeff, den, mod, d_mod, d_modinv; +#if __FLINT_RELEASE >= 20700 fmpz_mod_ctx_t ctx; +#endif fmpz_init(coeff); fmpz_init(den); @@ -101,9 +127,12 @@ fmpz_randtest_unsigned(mod, state, 2 * FLINT_BITS); fmpz_add_ui(mod, mod, 2); +#if __FLINT_RELEASE >= 20700 fmpz_mod_ctx_init(ctx, mod); - fmpz_mod_poly_init(reduced_elem, ctx); +#else + fmpz_mod_poly_init(reduced_elem, &mod); +#endif nf_init_randtest(nf, state, 40, 200); @@ -116,7 +145,11 @@ fmpz_gcd(d_mod, d_mod, mod); } while (!fmpz_is_one(d_mod)); +#if __FLINT_RELEASE >= 20700 nf_elem_get_fmpz_mod_poly(reduced_elem, a, nf, ctx); +#else + nf_elem_get_fmpz_mod_poly(reduced_elem, a, nf); +#endif for (j = 0; j < fmpq_poly_degree(nf->pol); j++) { @@ -125,14 +158,24 @@ fmpz_invmod(d_modinv, den, mod); fmpz_mul(coeff, coeff, d_modinv); fmpz_mod(coeff, coeff, mod); +#if __FLINT_RELEASE >= 20700 fmpz_mod_poly_get_coeff_fmpz(reduced_coeff, reduced_elem, j, ctx); +#else + fmpz_mod_poly_get_coeff_fmpz(reduced_coeff, reduced_elem, j); +#endif result = (fmpz_equal(coeff, reduced_coeff)); if (!result) { printf("FAIL: Reducing element with denominator\n"); printf("a = "); nf_elem_print_pretty(a, nf, "x"); printf("\n"); printf("n = "); fmpz_print(mod); flint_printf("\n"); - printf("a mod n = "); fmpz_mod_poly_print_pretty(reduced_elem, "x", ctx); printf("\n"); + printf("a mod n = "); +#if __FLINT_RELEASE >= 20700 + fmpz_mod_poly_print_pretty(reduced_elem, "x", ctx); +#else + fmpz_mod_poly_print_pretty(reduced_elem, "x"); +#endif + printf("\n"); abort(); } } @@ -144,8 +187,12 @@ fmpz_clear(d_mod); fmpz_clear(d_modinv); nf_elem_clear(a, nf); +#if __FLINT_RELEASE >= 20700 fmpz_mod_poly_clear(reduced_elem, ctx); fmpz_mod_ctx_clear(ctx); +#else + fmpz_mod_poly_clear(reduced_elem); +#endif nf_clear(nf); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/antic-0.2.3/nf_elem/test/t-set_coeff_num_fmpz.c new/antic-0.2.4/nf_elem/test/t-set_coeff_num_fmpz.c --- old/antic-0.2.3/nf_elem/test/t-set_coeff_num_fmpz.c 2020-12-11 15:47:53.000000000 +0100 +++ new/antic-0.2.4/nf_elem/test/t-set_coeff_num_fmpz.c 2021-04-15 13:22:11.000000000 +0200 @@ -50,9 +50,9 @@ nf_elem_randtest(a, state, 200, nf); nf_elem_set(b, a, nf); - coeff = (slong) n_randint(state, fmpq_poly_length(nf->pol)); - - fmpz_randtest(d, state, 200); + coeff = (slong) n_randint(state, fmpq_poly_degree(nf->pol)); + + fmpz_randtest(d, state, 200); nf_elem_get_den(fmpq_denref(tempcoeff), a, nf); fmpz_set(fmpq_numref(tempcoeff), d); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/antic-0.2.3/nf_elem.h new/antic-0.2.4/nf_elem.h --- old/antic-0.2.3/nf_elem.h 2020-12-11 15:47:53.000000000 +0100 +++ new/antic-0.2.4/nf_elem.h 2021-04-15 13:22:11.000000000 +0200 @@ -553,6 +553,7 @@ FLINT_DLL void nf_elem_get_nmod_poly(nmod_poly_t pol, const nf_elem_t a, const nf_t nf); +#if __FLINT_RELEASE >= 20700 FLINT_DLL void _nf_elem_get_fmpz_mod_poly(fmpz_mod_poly_t pol, const nf_elem_t a, const nf_t nf, const fmpz_mod_ctx_t ctx); @@ -564,6 +565,16 @@ FLINT_DLL void nf_elem_get_fmpz_mod_poly(fmpz_mod_poly_t pol, const nf_elem_t a, const nf_t nf, const fmpz_mod_ctx_t ctx); +#else +FLINT_DLL +void _nf_elem_get_fmpz_mod_poly(fmpz_mod_poly_t pol, const nf_elem_t a, const nf_t nf); + +FLINT_DLL +void nf_elem_get_fmpz_mod_poly_den(fmpz_mod_poly_t pol, const nf_elem_t a, const nf_t nf, int den); + +FLINT_DLL +void nf_elem_get_fmpz_mod_poly(fmpz_mod_poly_t pol, const nf_elem_t a, const nf_t nf); +#endif /****************************************************************************** @@ -607,14 +618,24 @@ { if (nf->flag & NF_LINEAR) { - fmpz_set(fmpq_numref(a), LNF_ELEM_NUMREF(b)); - fmpz_set(fmpq_denref(a), LNF_ELEM_DENREF(b)); + if (i > 0) + fmpq_zero(a); + else + { + fmpz_set(fmpq_numref(a), LNF_ELEM_NUMREF(b)); + fmpz_set(fmpq_denref(a), LNF_ELEM_DENREF(b)); + } } else if (nf->flag & NF_QUADRATIC) { const fmpz * const bnum = QNF_ELEM_NUMREF(b); - fmpz_set(fmpq_numref(a), bnum + i); - fmpz_set(fmpq_denref(a), QNF_ELEM_DENREF(b)); + if (i > 2) /* element may be unreduced */ + fmpq_zero(a); + else + { + fmpz_set(fmpq_numref(a), bnum + i); + fmpz_set(fmpq_denref(a), QNF_ELEM_DENREF(b)); + } fmpq_canonicalise(a); } else @@ -627,12 +648,18 @@ { if (nf->flag & NF_LINEAR) { - fmpz_set(a, LNF_ELEM_NUMREF(b)); + if (i > 0) + fmpz_zero(a); + else + fmpz_set(a, LNF_ELEM_NUMREF(b)); } else if (nf->flag & NF_QUADRATIC) { const fmpz * const bnum = QNF_ELEM_NUMREF(b); - fmpz_set(a, bnum + i); + if (i > 2) /* element may be unreduced */ + fmpz_zero(a); + else + fmpz_set(a, bnum + i); } else fmpq_poly_get_coeff_fmpz(a, NF_ELEM(b), i); } @@ -655,7 +682,12 @@ NF_ELEM_INLINE void _nf_elem_set_coeff_num_fmpz(nf_elem_t a, slong i, const fmpz_t b, const nf_t nf) { - + if (i > 2*(fmpq_poly_degree(nf->pol) - 1)) + { + flint_printf("Degree out of range\n"); + flint_abort(); + } + if (nf->flag & NF_LINEAR) { fmpz_set(LNF_ELEM_NUMREF(a), b); @@ -975,4 +1007,21 @@ } #endif +/****************************************************************************** + + Helpers for compatibility with FLINT 2.6 + +******************************************************************************/ +#if __FLINT_RELEASE >= 20700 +#define FMPZ_MOD_POLY_FIT_LENGTH(POL, N, CTX) fmpz_mod_poly_fit_length(POL, N, CTX) +#define FMPZ_MOD(F, G, CTX, P) fmpz_mod(F, G, (CTX)->n) +#define FMPZ_MOD_POLY_ZERO(POL, CTX) fmpz_mod_poly_zero(POL, CTX) +#define FMPZ_MOD_POLY_SCALAR_DIV_FMPZ(RES, POL, X, CTX) fmpz_mod_poly_scalar_div_fmpz(RES, POL, X, CTX) +#else +#define FMPZ_MOD_POLY_FIT_LENGTH(POL, N, CTX) fmpz_mod_poly_fit_length(POL, N) +#define FMPZ_MOD(F, G, CTX, P) fmpz_mod(F, G, P) +#define FMPZ_MOD_POLY_ZERO(POL, CTX) fmpz_mod_poly_zero(POL) +#define FMPZ_MOD_POLY_SCALAR_DIV_FMPZ(RES, POL, X, CTX) fmpz_mod_poly_scalar_div_fmpz(RES, POL, X) +#endif + #endif