Skip to content

Upgrade to flint-3.3.0 #40259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Conversation

vbraun
Copy link
Member

@vbraun vbraun commented Jun 15, 2025

Straightforward upgrade to the latest release

Apparently Singluar is not yet compatible with it

[singular-4.4.1] [spkg-install] /usr/bin/bash ./libtool  --tag=CXX   --mode=compile g++ -std=gnu++11 -DHAVE_CONFIG_H -I.  -I./include -I./include -I. -DFACTORY_BUILDING_DLL -I/home/vbraun/Sage/git/local/var/tmp/sage/build/singular-4.4.1/src -I/home/vbraun/Sage/git/local/var/tmp/sage/build/singular-4.4.1/src  -I/home/vbraun/Sage/git/local/include/  -I/home/vbraun/Sage/git/local/include -I/home/vbraun/Sage/git/local/include -DSING_NDEBUG -DOM_NDEBUG   -g -O2 -pipe -fno-common -g0 -O3 -Wno-unused-function -Wno-trigraphs -Wno-unused-parameter -Wunknown-pragmas -Wno-unused-variable -fomit-frame-pointer -fwrapv -fvisibility=default -finline-functions -fno-exceptions -fno-threadsafe-statics -fno-enforce-eh-specs -fconserve-space -funroll-loops -fno-rtti -c -o FLINTconvert.lo FLINTconvert.cc
[singular-4.4.1] [spkg-install] libtool: compile:  g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I./include -I./include -I. -DFACTORY_BUILDING_DLL -I/home/vbraun/Sage/git/local/var/tmp/sage/build/singular-4.4.1/src -I/home/vbraun/Sage/git/local/var/tmp/sage/build/singular-4.4.1/src -I/home/vbraun/Sage/git/local/include/ -I/home/vbraun/Sage/git/local/include -I/home/vbraun/Sage/git/local/include -DSING_NDEBUG -DOM_NDEBUG -g -O2 -pipe -fno-common -g0 -O3 -Wno-unused-function -Wno-trigraphs -Wno-unused-parameter -Wunknown-pragmas -Wno-unused-variable -fomit-frame-pointer -fwrapv -fvisibility=default -finline-functions -fno-exceptions -fno-threadsafe-statics -fno-enforce-eh-specs -fconserve-space -funroll-loops -fno-rtti -c FLINTconvert.cc  -fPIC -DPIC -o .libs/FLINTconvert.o
[singular-4.4.1] [spkg-install] FLINTconvert.cc: In function 'void convertFacCFMatrix2Fq_nmod_mat_t(fq_nmod_mat_struct*, const fq_nmod_ctx_struct*, const CFMatrix&)':
[singular-4.4.1] [spkg-install] FLINTconvert.cc:655:36: error: 'struct fq_nmod_mat_struct' has no member named 'rows'
[singular-4.4.1] [spkg-install]   655 |       convertFacCF2nmod_poly_t (M->rows[i-1]+j-1, m (i,j));
[singular-4.4.1] [spkg-install]       |                                    ^~~~
[singular-4.4.1] [spkg-install] make[11]: *** [Makefile:1274: FLINTconvert.lo] Error 1
[singular-4.4.1] [spkg-install] make[10]: *** [Makefile:1379: all-recursive] Error 1
[singular-4.4.1] [spkg-install] make[9]: *** [Makefile:1041: all] Error 2
[singular-4.4.1] [spkg-install] make[8]: *** [Makefile:624: all-recursive] Error 1
[singular-4.4.1] [spkg-install] make[7]: *** [Makefile:475: all] Error 2
[singular-4.4.1] [spkg-install] *********************************************************************************************************************************************************
[singular-4.4.1] [spkg-install] Error building singular-4.4.1
[singular-4.4.1] [spkg-install] *********************************************************************************************************************************************************

See Singular/Singular#1279

@antonio-rojas
Copy link
Contributor

eclib needs patching too (builds fine but crashes at runtime) JohnCremona/eclib#87

Copy link

github-actions bot commented Jun 15, 2025

Documentation preview for this PR (built with commit bd8c9ab; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@vbraun vbraun force-pushed the update-flint-3.3.0 branch from 71228c8 to 4966f07 Compare June 15, 2025 14:22
@vbraun
Copy link
Member Author

vbraun commented Jun 15, 2025

This PR now works for me, but doesn't fix #40253 when using gcc 15

@JohnCremona
Copy link
Member

eclib needs patching too (builds fine but crashes at runtime) JohnCremona/eclib#87

I will shortly be merging @antonio-rojas 's eclib patch there, so either that patch needs to applied in Sage, or I canmake a new eclib release which Sage will need to use and make as a prerequisite for this PR. Sorry about this, there was a backwards-incompatible change in FLINT.

@vbraun
Copy link
Member Author

vbraun commented Jun 16, 2025

The eclib patch is already in this PR, fyi

@enriqueartal
Copy link
Contributor

This PR now works for me, but doesn't fix #40253 when using gcc 15

Any idea why? I got the same result, built but segfault.

@vbraun
Copy link
Member Author

vbraun commented Jun 16, 2025

We've narrowed the segfault down to flint miscompiling with gcc 15, see flintlib/flint#2340 for details

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 flintlib/flint#2340 for upstream bug report
@enriqueartal
Copy link
Contributor

It works for me!

@vbraun
Copy link
Member Author

vbraun commented Jun 16, 2025

I've added the -fno-strict-aliasing to the cflags, but I still get

**********************************************************************
File "src/sage/schemes/elliptic_curves/gp_simon.py", line 84, in sage.schemes.elliptic_curves.gp_simon.?
Failed example:
    E.simon_two_descent()                             # long time
Expected:
    (0, 2, [])
Got:
    (2, 2, [(-121/64*w - 2719/64 : -15555/512*w - 186181/512 : 1)])
**********************************************************************

Though not sure if its related to flint, might be another gcc 15 issue. Afaik thats just using pari so no flint involved...

@antonio-rojas
Copy link
Contributor

I've added the -fno-strict-aliasing to the cflags, but I still get

**********************************************************************
File "src/sage/schemes/elliptic_curves/gp_simon.py", line 84, in sage.schemes.elliptic_curves.gp_simon.?
Failed example:
    E.simon_two_descent()                             # long time
Expected:
    (0, 2, [])
Got:
    (2, 2, [(-121/64*w - 2719/64 : -15555/512*w - 186181/512 : 1)])
**********************************************************************

Though not sure if its related to flint, might be another gcc 15 issue...

That's a random issue, I've beed getting it occasionally for a long time

@vbraun
Copy link
Member Author

vbraun commented Jun 16, 2025

Ah true, using different random seed "fixes" the two descent ;)

So this PR is ready for review.

@antonio-rojas
Copy link
Contributor

there's now en eclib release including the patch, and also a 3.3.1 flint bugfix release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants