From 4966f075ca3027a87a6f942c4569cd2439b828bf Mon Sep 17 00:00:00 2001 From: Volker Braun Date: Sun, 15 Jun 2025 15:00:47 +0200 Subject: [PATCH 1/3] Upgrade to flint-3.3.0 --- .../patches/flint-3.3.0-compatibility.patch | 41 +++++++++++++++++++ build/pkgs/flint/checksums.ini | 4 +- build/pkgs/flint/package-version.txt | 2 +- .../patches/flint-3.3.0-compatibility.patch | 26 ++++++++++++ 4 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 build/pkgs/eclib/patches/flint-3.3.0-compatibility.patch create mode 100644 build/pkgs/singular/patches/flint-3.3.0-compatibility.patch diff --git a/build/pkgs/eclib/patches/flint-3.3.0-compatibility.patch b/build/pkgs/eclib/patches/flint-3.3.0-compatibility.patch new file mode 100644 index 00000000000..87c52de5f56 --- /dev/null +++ b/build/pkgs/eclib/patches/flint-3.3.0-compatibility.patch @@ -0,0 +1,41 @@ +diff --git a/libsrc/eclib/flinterface.h b/libsrc/eclib/flinterface.h +index a74049d..b9a582e 100644 +--- a/libsrc/eclib/flinterface.h ++++ b/libsrc/eclib/flinterface.h +@@ -58,14 +58,22 @@ typedef struct + hlimb_t * entries; + slong r; + slong c; ++#if (__FLINT_VERSION==3)&&(__FLINT_VERSION_MINOR<3) + hlimb_t ** rows; ++#else ++ slong stride; ++#endif + nmod_t mod; + } + hmod_mat_struct; + + typedef hmod_mat_struct hmod_mat_t[1]; + ++#if (__FLINT_VERSION==3)&&(__FLINT_VERSION_MINOR<3) + #define hmod_mat_entry(mat,i,j) ((mat)->rows[(i)][(j)]) ++#else ++#define hmod_mat_entry nmod_mat_entry ++#endif + #define hmod_mat_nrows(mat) ((mat)->r) + #define hmod_mat_ncols(mat) ((mat)->c) + +diff --git a/libsrc/mat.cc b/libsrc/mat.cc +index b0c6c08..948fc24 100644 +--- a/libsrc/mat.cc ++++ b/libsrc/mat.cc +@@ -1602,7 +1602,9 @@ hmod_mat_clear(hmod_mat_t mat) + if (mat->entries) + { + flint_free(mat->entries); ++#if (__FLINT_VERSION==3)&&(__FLINT_VERSION_MINOR<3) + flint_free(mat->rows); ++#endif + } + } + diff --git a/build/pkgs/flint/checksums.ini b/build/pkgs/flint/checksums.ini index b7ccee17ce3..1edcbee7f06 100644 --- a/build/pkgs/flint/checksums.ini +++ b/build/pkgs/flint/checksums.ini @@ -1,4 +1,4 @@ tarball=flint-VERSION.tar.gz -sha1=ebca3a55e48373c2eeee6c172051f3177845e121 -sha256=577d7729e4c2e79ca1e894ad2ce34bc73516a92f623d42562694817f888a17eb +sha1=1e60a03c108b3240cb3341c0d9f462ad0760e697 +sha256=d9ae0f1318253727068270dbfa3c4b55155e3f4b7be6ca9c056e58f2838f15b3 upstream_url=https://github.com/flintlib/flint/releases/download/vVERSION/flint-VERSION.tar.gz diff --git a/build/pkgs/flint/package-version.txt b/build/pkgs/flint/package-version.txt index be94e6f53db..15a27998172 100644 --- a/build/pkgs/flint/package-version.txt +++ b/build/pkgs/flint/package-version.txt @@ -1 +1 @@ -3.2.2 +3.3.0 diff --git a/build/pkgs/singular/patches/flint-3.3.0-compatibility.patch b/build/pkgs/singular/patches/flint-3.3.0-compatibility.patch new file mode 100644 index 00000000000..588e130c837 --- /dev/null +++ b/build/pkgs/singular/patches/flint-3.3.0-compatibility.patch @@ -0,0 +1,26 @@ +diff --git a/factory/FLINTconvert.cc b/factory/FLINTconvert.cc +index c36f6022d..67c271c5a 100644 +--- a/factory/FLINTconvert.cc ++++ b/factory/FLINTconvert.cc +@@ -652,7 +652,7 @@ convertFacCFMatrix2Fq_nmod_mat_t (fq_nmod_mat_t M, + { + for(j=m.columns();j>0;j--) + { +- convertFacCF2nmod_poly_t (M->rows[i-1]+j-1, m (i,j)); ++ convertFacCF2nmod_poly_t (fq_nmod_mat_entry (M, i-1, j-1), m (i,j)); + } + } + } +diff --git a/libpolys/polys/flintconv.cc b/libpolys/polys/flintconv.cc +index 89152f5e4..56d527c16 100644 +--- a/libpolys/polys/flintconv.cc ++++ b/libpolys/polys/flintconv.cc +@@ -331,7 +331,7 @@ void convSingMFlintFq_nmod_mat(matrix m, fq_nmod_mat_t M, const fq_nmod_ctx_t fq + { + for(j=MATCOLS(m);j>0;j--) + { +- convSingPFlintnmod_poly_t (M->rows[i-1]+j-1, MATELEM(m,i,j),r); ++ convSingPFlintnmod_poly_t (fq_nmod_mat_entry (M, i-1, j-1), MATELEM(m,i,j),r); + } + } + } From bd8c9ab1ed9a5e9c0b31c512e2fb51409ad0556e Mon Sep 17 00:00:00 2001 From: Volker Braun Date: Mon, 16 Jun 2025 18:53:51 +0200 Subject: [PATCH 2/3] Build flint with -fno-strict-aliasing Flint miscompiles with gcc 15, workaround is to compile with -fno-strict-aliasing This is also what Fedora does: https://src.fedoraproject.org/rpms/flint/blob/rawhide/f/flint.spec#_97-98 See https://github.com/flintlib/flint/issues/2340 for upstream bug report --- build/pkgs/flint/spkg-build.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/pkgs/flint/spkg-build.in b/build/pkgs/flint/spkg-build.in index ffb822c8a97..30f370e2d10 100644 --- a/build/pkgs/flint/spkg-build.in +++ b/build/pkgs/flint/spkg-build.in @@ -1,3 +1,7 @@ cd src + +# See https://github.com/flintlib/flint/issues/2340 +export CFLAGS="$CFLAGS -fno-strict-aliasing" + sdh_configure sdh_make From 8253d12f56243a4c6fcd01102a43a94d3f7e7104 Mon Sep 17 00:00:00 2001 From: Volker Braun Date: Sun, 22 Jun 2025 17:43:13 +0200 Subject: [PATCH 3/3] Upgrade to flint 3.3.1, eclib 20250627 --- build/pkgs/eclib/checksums.ini | 4 +- build/pkgs/eclib/package-version.txt | 2 +- .../patches/flint-3.3.0-compatibility.patch | 41 ------------------- build/pkgs/eclib/spkg-configure.m4 | 2 +- build/pkgs/flint/checksums.ini | 4 +- build/pkgs/flint/package-version.txt | 2 +- 6 files changed, 7 insertions(+), 48 deletions(-) delete mode 100644 build/pkgs/eclib/patches/flint-3.3.0-compatibility.patch diff --git a/build/pkgs/eclib/checksums.ini b/build/pkgs/eclib/checksums.ini index ff0ea83451a..14061199f9f 100644 --- a/build/pkgs/eclib/checksums.ini +++ b/build/pkgs/eclib/checksums.ini @@ -1,4 +1,4 @@ tarball=eclib-VERSION.tar.bz2 -sha1=ec8dd87df46ac5a54b548354681085d1da6e7e13 -sha256=9f8c2b32e24a4f20d7cc2d336ea30c8ea03b5b0953c2d32adda0c496e7616899 +sha1=5593348fef3ee35918815fbc6444c3003bdb4fa4 +sha256=b88d4b52612e491c5415946d9e35f2062ca1015ee7fbbe0b61f158fa74cb4bc9 upstream_url=https://github.com/JohnCremona/eclib/releases/download/VERSION/eclib-VERSION.tar.bz2 diff --git a/build/pkgs/eclib/package-version.txt b/build/pkgs/eclib/package-version.txt index b0aec664e8d..b128998250b 100644 --- a/build/pkgs/eclib/package-version.txt +++ b/build/pkgs/eclib/package-version.txt @@ -1 +1 @@ -20250122 +20250627 diff --git a/build/pkgs/eclib/patches/flint-3.3.0-compatibility.patch b/build/pkgs/eclib/patches/flint-3.3.0-compatibility.patch deleted file mode 100644 index 87c52de5f56..00000000000 --- a/build/pkgs/eclib/patches/flint-3.3.0-compatibility.patch +++ /dev/null @@ -1,41 +0,0 @@ -diff --git a/libsrc/eclib/flinterface.h b/libsrc/eclib/flinterface.h -index a74049d..b9a582e 100644 ---- a/libsrc/eclib/flinterface.h -+++ b/libsrc/eclib/flinterface.h -@@ -58,14 +58,22 @@ typedef struct - hlimb_t * entries; - slong r; - slong c; -+#if (__FLINT_VERSION==3)&&(__FLINT_VERSION_MINOR<3) - hlimb_t ** rows; -+#else -+ slong stride; -+#endif - nmod_t mod; - } - hmod_mat_struct; - - typedef hmod_mat_struct hmod_mat_t[1]; - -+#if (__FLINT_VERSION==3)&&(__FLINT_VERSION_MINOR<3) - #define hmod_mat_entry(mat,i,j) ((mat)->rows[(i)][(j)]) -+#else -+#define hmod_mat_entry nmod_mat_entry -+#endif - #define hmod_mat_nrows(mat) ((mat)->r) - #define hmod_mat_ncols(mat) ((mat)->c) - -diff --git a/libsrc/mat.cc b/libsrc/mat.cc -index b0c6c08..948fc24 100644 ---- a/libsrc/mat.cc -+++ b/libsrc/mat.cc -@@ -1602,7 +1602,9 @@ hmod_mat_clear(hmod_mat_t mat) - if (mat->entries) - { - flint_free(mat->entries); -+#if (__FLINT_VERSION==3)&&(__FLINT_VERSION_MINOR<3) - flint_free(mat->rows); -+#endif - } - } - diff --git a/build/pkgs/eclib/spkg-configure.m4 b/build/pkgs/eclib/spkg-configure.m4 index 23771dad1bd..ea1e28a8823 100644 --- a/build/pkgs/eclib/spkg-configure.m4 +++ b/build/pkgs/eclib/spkg-configure.m4 @@ -1,7 +1,7 @@ SAGE_SPKG_CONFIGURE([eclib], [ SAGE_SPKG_DEPCHECK([ntl pari flint], [ dnl use existing eclib only if the version reported by pkg-config is recent enough - m4_pushdef([SAGE_ECLIB_VER],["20241112"]) + m4_pushdef([SAGE_ECLIB_VER],["20250627"]) PKG_CHECK_MODULES([ECLIB], [eclib >= SAGE_ECLIB_VER], [ AC_CACHE_CHECK([for mwrank version == SAGE_ECLIB_VER], [ac_cv_path_MWRANK], [ AC_PATH_PROGS_FEATURE_CHECK([MWRANK], [mwrank], [ diff --git a/build/pkgs/flint/checksums.ini b/build/pkgs/flint/checksums.ini index 1edcbee7f06..53a1842d271 100644 --- a/build/pkgs/flint/checksums.ini +++ b/build/pkgs/flint/checksums.ini @@ -1,4 +1,4 @@ tarball=flint-VERSION.tar.gz -sha1=1e60a03c108b3240cb3341c0d9f462ad0760e697 -sha256=d9ae0f1318253727068270dbfa3c4b55155e3f4b7be6ca9c056e58f2838f15b3 +sha1=dae6d32b25e46a6ab92514b4dfa64b06fdf247ec +sha256=64d70e513076cfa971e0410b58c1da5d35112913e9a56b44e2c681b459d3eafb upstream_url=https://github.com/flintlib/flint/releases/download/vVERSION/flint-VERSION.tar.gz diff --git a/build/pkgs/flint/package-version.txt b/build/pkgs/flint/package-version.txt index 15a27998172..bea438e9ade 100644 --- a/build/pkgs/flint/package-version.txt +++ b/build/pkgs/flint/package-version.txt @@ -1 +1 @@ -3.3.0 +3.3.1