Skip to content

Commit

Permalink
sagemathgh-35848: upgrade to flint3
Browse files Browse the repository at this point in the history
    
Upgrade to flint3.

Current Sage versions are not compatible with flint ≥ 3, and, though the
diff is not huge, there are enough changes that versions including this
PR will be incompatible with flint < 3.

Fixes sagemath#20003.
Closes sagemath#35993 as no longer relevant.

Related PRs in upstream projects:
* Singular/Singular#1177
* flintlib/flint#1408
* flintlib/flint#1489
* flintlib/flint#1492
* flintlib/flint#1611
* algebraic-solving/msolve#76
* flatsurf/e-antic#264

Additional changes still needed for optional packages to work:
* sagemath#36677
* upgrade e-antic
* possibly more

Planned follow-ups:
* sagemath#36449
* sagemath#36433
    
URL: sagemath#35848
Reported by: Marc Mezzarobba
Reviewer(s): Vincent Delecroix
  • Loading branch information
Release Manager committed Dec 4, 2023
2 parents 9c4fc77 + 27351b5 commit a7b9ebc
Show file tree
Hide file tree
Showing 81 changed files with 423 additions and 439 deletions.
18 changes: 0 additions & 18 deletions build/pkgs/antic/SPKG.rst

This file was deleted.

5 changes: 0 additions & 5 deletions build/pkgs/antic/checksums.ini

This file was deleted.

4 changes: 0 additions & 4 deletions build/pkgs/antic/dependencies

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/antic/distros/arch.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/antic/distros/conda.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/antic/distros/debian.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/antic/distros/fedora.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/antic/distros/freebsd.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/antic/distros/opensuse.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/antic/distros/repology.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/antic/package-version.txt

This file was deleted.

19 changes: 0 additions & 19 deletions build/pkgs/antic/spkg-install.in

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/antic/type

This file was deleted.

27 changes: 0 additions & 27 deletions build/pkgs/arb/SPKG.rst

This file was deleted.

5 changes: 0 additions & 5 deletions build/pkgs/arb/checksums.ini

This file was deleted.

4 changes: 0 additions & 4 deletions build/pkgs/arb/dependencies

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/arb/distros/arch.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/arb/distros/conda.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/arb/distros/debian.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/arb/distros/fedora.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/arb/distros/freebsd.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/arb/distros/gentoo.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/arb/distros/homebrew.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/arb/distros/nix.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/arb/distros/opensuse.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/arb/distros/repology.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/arb/distros/void.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/arb/package-version.txt

This file was deleted.

2 changes: 0 additions & 2 deletions build/pkgs/arb/spkg-check.in

This file was deleted.

23 changes: 0 additions & 23 deletions build/pkgs/arb/spkg-configure.m4

This file was deleted.

17 changes: 0 additions & 17 deletions build/pkgs/arb/spkg-install.in

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/arb/type

This file was deleted.

2 changes: 1 addition & 1 deletion build/pkgs/e_antic/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$(MP_LIBRARY) flint arb antic boost_cropped
$(MP_LIBRARY) flint boost_cropped

----------
All lines of this file are ignored except the first.
6 changes: 3 additions & 3 deletions build/pkgs/flint/SPKG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ flint: Fast Library for Number Theory
Description
-----------

FLINT is a C library for doing number theory, maintained by William
Hart.
FLINT is a C library for doing number theory, maintained by
Fredrik Johansson.

Website: http://www.flintlib.org

Expand All @@ -20,4 +20,4 @@ Upstream Contact

- flint-devel Gougle Group
(http://groups.google.co.uk/group/flint-devel)
- William Hart
- Fredrik Johansson
8 changes: 4 additions & 4 deletions build/pkgs/flint/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=flint-VERSION.tar.gz
sha1=63d90f8242c8f8ab4011fbcfb44b86c154f43abd
md5=c2d3cec326438f159a530c66eb07fafe
cksum=4244948341
upstream_url=http://flintlib.org/flint-VERSION.tar.gz
sha1=65be9297c06edd7e24f20874b7bd6130cee56723
md5=5189f67b0ec12e4a54d6782851642b81
cksum=172350473
upstream_url=https://github.com/flintlib/flint/releases/download/vVERSION/flint-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/flint/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$(MP_LIBRARY) mpfr ntl
$(MP_LIBRARY) mpfr

----------
All lines of this file are ignored except the first.
2 changes: 1 addition & 1 deletion build/pkgs/flint/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.9.0
3.0.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
From 54277f054f13254898c9a57c2c7eb869877e1252 Mon Sep 17 00:00:00 2001
From: Marc Mezzarobba <marc@mezzarobba.net>
Date: Mon, 13 Nov 2023 10:23:54 +0100
Subject: [PATCH] Makefile.in: fix handling of $DESTDIR

---
Makefile.in | 54 ++++++++++++++++++++++++++---------------------------
1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 08db6837c..2827b9da1 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -34,9 +34,9 @@ FLINT_SOLIB:=@FLINT_SOLIB@
prefix:=@prefix@
exec_prefix:=@exec_prefix@

-INCLUDEDIR:=$(DESTDIR)@includedir@
-LIBDIR:=$(DESTDIR)@libdir@
-BINDIR:=$(DESTDIR)@bindir@
+INCLUDEDIR:=@includedir@
+LIBDIR:=@libdir@
+BINDIR:=@bindir@
PKGCONFIGDIR:=$(LIBDIR)/pkgconfig

HOST_OS:=@host_os@
@@ -202,10 +202,10 @@ BUILD_DIRS += \
endif

INSTALL_DIRS := \
- $(LIBDIR) $(INCLUDEDIR)/flint \
- $(PKGCONFIGDIR)
+ $(DESTDIR)$(LIBDIR) $(DESTDIR)$(INCLUDEDIR)/flint \
+ $(DESTDIR)$(PKGCONFIGDIR)
ifneq ($(FLINT_DLLLIB),0)
-INSTALL_DIRS += $(BINDIR)
+INSTALL_DIRS += $(DESTDIR)$(BINDIR)
endif

################################################################################
@@ -722,41 +722,41 @@ distclean: clean
################################################################################

install: library | $(INSTALL_DIRS)
- $(CP) flint.pc $(PKGCONFIGDIR)/flint.pc
+ $(CP) flint.pc $(DESTDIR)$(PKGCONFIGDIR)/flint.pc
ifneq ($(SHARED), 0)
ifneq ($(FLINT_DLLLIB),0)
- $(CP_A) $(FLINT_DIR)/$(FLINT_LIB) $(BINDIR)
- $(CP_A) $(FLINT_DIR)/$(FLINT_LIB_MAJOR) $(BINDIR)
- $(CP_A) $(FLINT_DIR)/$(FLINT_LIB_FULL) $(BINDIR)
- $(CP) $(FLINT_DIR)/$(FLINT_IMPLIB) $(LIBDIR)
+ $(CP_A) $(FLINT_DIR)/$(FLINT_LIB) $(DESTDIR)$(BINDIR)
+ $(CP_A) $(FLINT_DIR)/$(FLINT_LIB_MAJOR) $(DESTDIR)$(BINDIR)
+ $(CP_A) $(FLINT_DIR)/$(FLINT_LIB_FULL) $(DESTDIR)$(BINDIR)
+ $(CP) $(FLINT_DIR)/$(FLINT_IMPLIB) $(DESTDIR)$(LIBDIR)
else
- $(CP_A) $(FLINT_DIR)/$(FLINT_LIB) $(LIBDIR)
- $(CP_A) $(FLINT_DIR)/$(FLINT_LIB_MAJOR) $(LIBDIR)
- $(CP_A) $(FLINT_DIR)/$(FLINT_LIB_FULL) $(LIBDIR)
+ $(CP_A) $(FLINT_DIR)/$(FLINT_LIB) $(DESTDIR)$(LIBDIR)
+ $(CP_A) $(FLINT_DIR)/$(FLINT_LIB_MAJOR) $(DESTDIR)$(LIBDIR)
+ $(CP_A) $(FLINT_DIR)/$(FLINT_LIB_FULL) $(DESTDIR)$(LIBDIR)
endif
ifneq ($(FLINT_DYLIB),0)
- install_name_tool -id $(LIBDIR)/$(FLINT_LIB_FULL) $(LIBDIR)/$(FLINT_LIB)
+ install_name_tool -id $(LIBDIR)/$(FLINT_LIB_FULL) $(DESTDIR)$(LIBDIR)/$(FLINT_LIB)
endif
endif
ifneq ($(STATIC), 0)
- $(CP) $(FLINT_DIR)/$(FLINT_LIB_STATIC) $(LIBDIR)
+ $(CP) $(FLINT_DIR)/$(FLINT_LIB_STATIC) $(DESTDIR)$(LIBDIR)
endif
- $(CP) $(HEADERS) $(INCLUDEDIR)/flint
+ $(CP) $(HEADERS) $(DESTDIR)$(INCLUDEDIR)/flint

uninstall:
- $(RM_F) $(PKGCONFIGDIR)/flint.pc
+ $(RM_F) $(DESTDIR)$(PKGCONFIGDIR)/flint.pc
ifneq ($(FLINT_DLLLIB),0)
- $(RM_F) $(BINDIR)/$(FLINT_LIB)
- $(RM_F) $(BINDIR)/$(FLINT_LIB_MAJOR)
- $(RM_F) $(BINDIR)/$(FLINT_LIB_FULL)
- $(RM_F) $(LIBDIR)/$(FLINT_IMPLIB)
+ $(RM_F) $(DESTDIR)$(BINDIR)/$(FLINT_LIB)
+ $(RM_F) $(DESTDIR)$(BINDIR)/$(FLINT_LIB_MAJOR)
+ $(RM_F) $(DESTDIR)$(BINDIR)/$(FLINT_LIB_FULL)
+ $(RM_F) $(DESTDIR)$(LIBDIR)/$(FLINT_IMPLIB)
else
- $(RM_F) $(LIBDIR)/$(FLINT_LIB)
- $(RM_F) $(LIBDIR)/$(FLINT_LIB_MAJOR)
- $(RM_F) $(LIBDIR)/$(FLINT_LIB_FULL)
+ $(RM_F) $(DESTDIR)$(LIBDIR)/$(FLINT_LIB)
+ $(RM_F) $(DESTDIR)$(LIBDIR)/$(FLINT_LIB_MAJOR)
+ $(RM_F) $(DESTDIR)$(LIBDIR)/$(FLINT_LIB_FULL)
endif
- $(RM_F) $(LIBDIR)/$(FLINT_LIB_STATIC)
- $(RM_RF) $(INCLUDEDIR)/flint
+ $(RM_F) $(DESTDIR)$(LIBDIR)/$(FLINT_LIB_STATIC)
+ $(RM_RF) $(DESTDIR)$(INCLUDEDIR)/flint

################################################################################
# maintainer stuff
--
2.42.0

3 changes: 3 additions & 0 deletions build/pkgs/flint/spkg-build.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cd src
sdh_configure
sdh_make
23 changes: 3 additions & 20 deletions build/pkgs/flint/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -1,25 +1,8 @@
SAGE_SPKG_CONFIGURE([flint], [
SAGE_SPKG_DEPCHECK([mpfr ntl], [
SAGE_SPKG_DEPCHECK([mpfr], [
AC_CHECK_HEADER(flint/flint.h, [
dnl flint_parallel_binary_splitting appears in Flint 2.9.0, needed by arb 2.23
AC_SEARCH_LIBS([flint_parallel_binary_splitting], [flint], [
dnl check that NTL is linked in
AC_SEARCH_LIBS([fmpz_poly_get_ZZX], [flint], [
AC_MSG_CHECKING([that GC is not enabled in Flint... ])
AC_RUN_IFELSE([
AC_LANG_PROGRAM([[#include <flint/flint.h>]], [
[#ifdef HAVE_GC]
[return HAVE_GC;]
[#else]
[return 0;]
[#endif]])],
[AC_MSG_RESULT([GC not enabled. Good.])],
[AC_MSG_RESULT([GC enabled. Incompatible with Sage.])
sage_spkg_install_flint=yes],
[AC_MSG_RESULT(["cross compiling. assuming GC is not enabled"])])
], [sage_spkg_install_flint=yes])
], [sage_spkg_install_flint=yes])
dnl gr_get_fexpr appears in Flint 3.0
AC_SEARCH_LIBS([gr_get_fexpr], [flint], [], [sage_spkg_install_flint=yes])
], [sage_spkg_install_flint=yes])
])
], [], [], [
Expand Down
34 changes: 0 additions & 34 deletions build/pkgs/flint/spkg-install.in
Original file line number Diff line number Diff line change
@@ -1,36 +1,2 @@
###############################################################################
#
# FLINT Sage install script
#
###############################################################################
if [ "$SAGE_DEBUG" = "yes" ]; then
echo "Building a debug version of FLINT."
FLINT_TUNE=" $FLINT_TUNE"; export FLINT_TUNE
FLINT_CONFIGURE="--enable-assert $FLINT_CONFIGURE"
fi

cd src

echo "Configuring FLINT."
# Trac #29607: We must always supply --with-gmp, --with-mpfr,
# --with-ntl because otherwise FLINT's configure script uses
# /usr/local, which is always wrong.
# This is why we do not use $SAGE_CONFIGURE_GMP etc. here.
# The value $SAGE_LOCAL is always a safe choice even if the library
# is coming from the system and is found using what is in
# LIBRARY_PATH or LDFLAGS etc.
./configure \
--disable-static \
--prefix="$SAGE_LOCAL" \
--with-gmp="$SAGE_LOCAL" \
--with-mpfr="$SAGE_LOCAL" \
--with-ntl="$SAGE_LOCAL" \
$FLINT_CONFIGURE || sdh_die "Error: Failed to configure FLINT."

sdh_make verbose

echo "Deleting old FLINT files."
rm -f $SAGE_LOCAL/lib/libflint*
rm -rf $SAGE_LOCAL/include/flint

sdh_make_install
Loading

0 comments on commit a7b9ebc

Please sign in to comment.