Skip to content

Commit

Permalink
build/pkgs/gmp/spkg-configure.m4: Check the actual GMP version, to ma…
Browse files Browse the repository at this point in the history
…tch check in FLINT 3.1
  • Loading branch information
Matthias Koeppe committed May 13, 2024
1 parent fc47aea commit 18e1d4f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions build/pkgs/gmp/spkg-configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@ SAGE_SPKG_CONFIGURE([gmp], [
sage_spkg_install_gmp=no
AC_CHECK_HEADER(gmp.h, [], [sage_spkg_install_gmp=yes])
AC_CHECK_HEADER(gmpxx.h, [], [sage_spkg_install_gmp=yes])
# Check that GMP >= 6.2.1; this test is copied from FLINT.
AC_MSG_CHECKING([if version of GMP is greater than 6.2.1])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM(
[[#include <gmp.h>
]],
[[#if (__GNU_MP_VERSION < 6) \
|| (__GNU_MP_VERSION == 6 && __GNU_MP_VERSION_MINOR < 2) \
|| (__GNU_MP_VERSION == 6 && __GNU_MP_VERSION_MINOR == 2 && __GNU_MP_VERSION_PATCHLEVEL < 1)
# error GMP version 6.2.1 or later is required
#endif
]]
)], [dnl
AC_MSG_RESULT([yes])
], [dnl
AC_MSG_RESULT([no])
sage_spkg_install_gmp=yes
])
dnl The test above uses the headers only. To protect against header/library
dnl mismatches, we now check for a function.
dnl mpn_gcd_11 appeared in GMP 6.2.1
dnl It is undocumented but is used by Flint when built with default
dnl flags.
Expand Down

0 comments on commit 18e1d4f

Please sign in to comment.