From f28a1218e50877eef750ffb9af023175caf1bf13 Mon Sep 17 00:00:00 2001 From: Marc Mezzarobba Date: Mon, 9 Oct 2023 17:19:59 +0200 Subject: [PATCH] patch msolve to make it build with flint3 --- .../0001-Make-msolve-build-with-flint3.patch | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 build/pkgs/msolve/patches/0001-Make-msolve-build-with-flint3.patch diff --git a/build/pkgs/msolve/patches/0001-Make-msolve-build-with-flint3.patch b/build/pkgs/msolve/patches/0001-Make-msolve-build-with-flint3.patch new file mode 100644 index 00000000000..27a642a13b0 --- /dev/null +++ b/build/pkgs/msolve/patches/0001-Make-msolve-build-with-flint3.patch @@ -0,0 +1,53 @@ +From fe730579476de0b2d4181a38efa7f63dff9c81d7 Mon Sep 17 00:00:00 2001 +From: Marc Mezzarobba +Date: Tue, 12 Sep 2023 08:23:08 +0200 +Subject: [PATCH] Make msolve build with flint3 + +--- + src/fglm/berlekamp_massey.c | 3 +++ + src/fglm/data_fglm.c | 7 +++++-- + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/src/fglm/berlekamp_massey.c b/src/fglm/berlekamp_massey.c +index b0f2052..998af1c 100644 +--- a/src/fglm/berlekamp_massey.c ++++ b/src/fglm/berlekamp_massey.c +@@ -30,6 +30,9 @@ + */ + + #include ++#if __FLINT_VERSION >= 3 ++# include ++#endif + //#include "nmod_poly.h" + //#include "mpn_extras.h" + +diff --git a/src/fglm/data_fglm.c b/src/fglm/data_fglm.c +index 0726760..0e1da6f 100644 +--- a/src/fglm/data_fglm.c ++++ b/src/fglm/data_fglm.c +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + + + typedef uint32_t szmat_t; +@@ -299,9 +300,11 @@ static inline void nmod_poly_set_prime(nmod_poly_t poly, + mp_limb_t ninv = n_preinvert_limb(prime); + poly->mod.n = prime; + poly->mod.ninv = ninv; ++#if __FLINT_VERSION < 3 + count_leading_zeros(poly->mod.norm, prime); +- /* poly->mod.norm = flint_clz(prime); */ +- ++#else ++ poly->mod.norm = flint_clz(prime); ++#endif + } + + static inline void fglm_param_set_prime(param_t *param, mp_limb_t prime){ +-- +2.40.1 +