Skip to content

Commit

Permalink
patch msolve to make it build with flint3
Browse files Browse the repository at this point in the history
  • Loading branch information
mezzarobba committed Oct 9, 2023
1 parent 1863440 commit f28a121
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions build/pkgs/msolve/patches/0001-Make-msolve-build-with-flint3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
From fe730579476de0b2d4181a38efa7f63dff9c81d7 Mon Sep 17 00:00:00 2001
From: Marc Mezzarobba <marc@mezzarobba.net>
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 <stdlib.h>
+#if __FLINT_VERSION >= 3
+# include <flint/nmod.h>
+#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 <flint/mpn_extras.h>
#include <flint/nmod_poly.h>
#include <flint/nmod_poly_factor.h>
+#include <flint/ulong_extras.h>


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

0 comments on commit f28a121

Please sign in to comment.