Skip to content
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

build: reduce build requirements on gmp and mpfr #2260

Closed
wants to merge 1 commit into from

Conversation

jengelh
Copy link
Contributor

@jengelh jengelh commented Mar 16, 2025

Systems like openSUSE Leap 15.6 have gmp-6.1.2 and mpfr-4.0.2, so I located the minimum viable versions for flint and adjusted configure.ac.

@albinahlback
Copy link
Collaborator

I'd rather not have conditional requirements when it comes to versioning.

But more importantly, I believe that if you want to build the development version of FLINT, I think it is reasonable to have recent versions of GMP and MPFR. Both GMP 6.2.1 and MPFR 4.1.0 were released more than four years ago.

@jengelh
Copy link
Contributor Author

jengelh commented Mar 16, 2025

Where do I see that some specific version of flint is development or not?
(The patch was originally made for 3.2.0, just the PR for master out of common practice.)

@albinahlback
Copy link
Collaborator

You can see it in the VERSION file.

But, for package managers, I don't see where you would want to distribute a recent version of FLINT without a recent version of GMP and MPFR.

For people wanting to build a recent version of FLINT on an old system, you sort of have to expect that we want you to have a recent version of GMP and MPFR. These are not heavy dependencies, so I think it is reasonable.

@edgarcosta
Copy link
Member

@albinahlback , to clarify the discussion:

Does Flint need the new versions?
If not, why should a user not try to build against old versions?

@albinahlback
Copy link
Collaborator

albinahlback commented Mar 16, 2025

We need mpn_zero_p, so we require GMP 6.2.0. And MPFR 4.1.0 is about the same age.

We could switch to flint_mpn_zero_p, but I recall there was something that hindered us from going back to an earlier version of GMP.

@albinahlback
Copy link
Collaborator

This is the PR were we made the change: #1591

@edgarcosta
Copy link
Member

It looks like you and @fredrik-johansson agreed that requirement of 6.2.0 made sense.
Unless you changed your mind, we can close down this PR.

BTW, looking at flint_mpn_zero_p vs mpn_zero_p the difference seems to be that they start looking at most significant word, while we look at least significant.

MPN_EXTRAS_INLINE
int flint_mpn_zero_p(mp_srcptr x, mp_size_t xsize)
{
    slong i;
    for (i = 0; i < xsize; i++)
    {
        if (x[i])
            return 0;
    }
    return 1;
}

https://github.com/flintlib/flint/blob/main/src/mpn_extras.h#L65-L75

vs

int
mpn_zero_p (mp_srcptr __gmp_p, mp_size_t __gmp_n) __GMP_NOTHROW
{
  /* if (__GMP_LIKELY (__gmp_n > 0)) */
    do {
      if (__gmp_p[--__gmp_n] != 0)
	return 0;
    } while (__gmp_n != 0);
  return 1;
}

https://github.com/gmp-mirror/gmp/blob/master/gmp-h.in#L2184-L2193

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

Successfully merging this pull request may close these issues.

3 participants