#32549 closed enhancement (fixed)
Remove package mpir
Reported by:  mkoeppe  Owned by:  

Priority:  major  Milestone:  sage9.5 
Component:  packages: standard  Keywords:  
Cc:  jhpalmieri, mjo, dimpase, wbhart, brg@…, riemannic@…  Merged in:  
Authors:  Matthias Koeppe, John Palmieri, Dima Pasechnik  Reviewers:  Dima Pasechnik, Matthias Koeppe 
Report Upstream:  N/A  Work issues:  
Branch:  286b39c (Commits, GitHub, GitLab)  Commit:  
Dependencies:  #30350, #31163  Stopgaps: 
Description
MPIR, a fork of GMP, has not been updated upstream. The latest release, 3.0.0, is from 20170301 (https://mpir.org/downloads.html).
Sage currently provides an SPKG for MPIR as a configurable alternative to GMP. We should remove this option and package, as previously suggested in https://trac.sagemath.org/ticket/29620#comment:10
Change History (44)
comment:1 Changed 8 months ago by
 Cc wbhart brg@… riemannic@… added
comment:2 followup: ↓ 4 Changed 8 months ago by
+1
Regardless of the state of MPIR upstream, sage never really developed a coherent plan for packages that are substitutes for one another. The ./configure
options that are available now don't really make sense, and the best thing to do for our end users is to eliminate the confusion (if also the choice). If someone later wants to overhaul the build system to handle these choices consistently, then OK; but I don't think anyone does right now.
comment:3 Changed 8 months ago by
The upstream (Bill) told me some time ago that due to Spectre and other CPU vulns discovered few years ago, parts of MPIR became obsolete, as speedups there relied on CPUs being unpatched.
IMHO it's semiabandonware now.
comment:4 in reply to: ↑ 2 Changed 8 months ago by
comment:5 Changed 8 months ago by
 Branch set to u/mkoeppe/remove_package_mpir
comment:6 Changed 8 months ago by
 Commit set to 81331d7af671345c3159662bc113b094b8660423
 Status changed from new to needs_review
comment:7 Changed 8 months ago by
 Commit changed from 81331d7af671345c3159662bc113b094b8660423 to fabdbb3144335ee7fb33957f78d4591b2c176e42
Branch pushed to git repo; I updated commit sha1. New commits:
fabdbb3  build/pkgs/*/SPKG.rst: Clear out redundant 'Dependencies' sections

comment:8 Changed 8 months ago by
There are a few references to yasm: a comment in m4/sage_spkg_configure.m4
and many mentions in doc/en/developer/portability_testing.rst
.
comment:9 Changed 8 months ago by
 Commit changed from fabdbb3144335ee7fb33957f78d4591b2c176e42 to 724c3ffd97682ced5521000df878a426a4901bd3
Branch pushed to git repo; I updated commit sha1. New commits:
724c3ff  src/doc/en/developer/portability_testing.rst: Remove references to package yasm

comment:10 Changed 8 months ago by
 Commit changed from 724c3ffd97682ced5521000df878a426a4901bd3 to 519dc83bc151b00a07d7e534d392f1139c615696
Branch pushed to git repo; I updated commit sha1. New commits:
519dc83  m4/sage_spkg_configure.m4: In documentation, do not use yasm as an example

comment:11 Changed 8 months ago by
 Commit changed from 519dc83bc151b00a07d7e534d392f1139c615696 to 01406bfea4ce7469c1d6520713f5952b6f133d2a
Branch pushed to git repo; I updated commit sha1. New commits:
01406bf  build/pkgs/*/SPKG.rst: Clear out more redundant 'Dependencies' sections

comment:12 Changed 8 months ago by
 Commit changed from 01406bfea4ce7469c1d6520713f5952b6f133d2a to e7fdb3578039895ff83e372ec511363b67b3e584
comment:13 followup: ↓ 15 Changed 8 months ago by
In two places of the Sage library, also 'mpir'
appears as a possible value of an algorithm
parameter:
src/sage/arith/misc.py: sage: a = binomial(100, 45, algorithm='mpir') src/sage/rings/integer.pyx: def binomial(self, m, algorithm='mpir'):
comment:14 Changed 8 months ago by
 Commit changed from e7fdb3578039895ff83e372ec511363b67b3e584 to 1eb83e30878c74b245547c22b6e165d4acf0595e
Branch pushed to git repo; I updated commit sha1. New commits:
1eb83e3  build/pkgs/ratpoints/SPKG.rst: Remove redundant 'Dependencies' section

comment:15 in reply to: ↑ 13 ; followup: ↓ 17 Changed 8 months ago by
Replying to mkoeppe:
In two places of the Sage library, also
'mpir'
appears as a possible value of analgorithm
parameter:src/sage/arith/misc.py: sage: a = binomial(100, 45, algorithm='mpir') src/sage/rings/integer.pyx: def binomial(self, m, algorithm='mpir'):
this option should be renamed gmp
, and respective tests should drop # optional
tag.
Indeed, it just calls a gmp/mpir function (which are more or less the same, and mpir provided a replacement for gmp there).
sage: 100.binomial(45, algorithm='mpir') 61448471214136179596720592960
see, it still works, without any mpir installed.
comment:16 Changed 8 months ago by
 Commit changed from 1eb83e30878c74b245547c22b6e165d4acf0595e to f883ea4c76e96fdbf0cbf8028fd65ce4513a786d
Branch pushed to git repo; I updated commit sha1. New commits:
f883ea4  Integer.binomial: Add algorithm='gmp', keep 'mpir' as an alias

comment:17 in reply to: ↑ 15 Changed 8 months ago by
Replying to dimpase:
this option should be renamed
gmp
I have kept mpir
as an alias, without deprecation warnings; after all, if we use system GMP, that could as well be MPIR
comment:18 followup: ↓ 20 Changed 8 months ago by
there is still an #optional : mpir
tag in integer.pyx, line 6427.
And analogous gmp
tag few lines down.
comment:19 Changed 8 months ago by
 Commit changed from f883ea4c76e96fdbf0cbf8028fd65ce4513a786d to 1647e2f9ce387e40273b2cb42b46b7f6de378562
Branch pushed to git repo; I updated commit sha1. New commits:
1647e2f  src/sage/rings/integer.pyx: Rewrite a doctest so it works with gmp, mpir, 64bit, 32bit

comment:20 in reply to: ↑ 18 Changed 8 months ago by
Replying to dimpase:
there is still an
#optional : mpir
tag in integer.pyx, line 6427. And analogousgmp
tag few lines down.
These doctests weren't actually being run because neither mpir
nor gmp
were optional packages. I've rewritten it in a less specific way, it now runs
comment:21 Changed 8 months ago by
 Commit changed from 1647e2f9ce387e40273b2cb42b46b7f6de378562 to 34526ca3ce293701c88607ec385a35b9d8a33e27
Branch pushed to git repo; I updated commit sha1. New commits:
34526ca  build/pkgs/*/SPKG.rst: Remove some more redundant 'Dependencies' sections

comment:22 Changed 8 months ago by
There is a similar test in src/sage/ext/memory.pyx
. We can also remove mpir
from COPYING.txt
. (Was there ever talk of autogenerating that file? Each package could have a file license.txt
...)
comment:23 Changed 8 months ago by
Also in m4/sage_spkg_collect.m4
:
# Packages that should be included in the source distribution # This includes all standard packages and two special cases case "$SPKG_NAME" in mpir) in_sdist=yes ;; esac
comment:24 Changed 8 months ago by
I don't understand this comment, line 286 in src/sage/all.py
:
# Free globally allocated mpir integers.
Just delete the comment and leave the code? Replace the comment with something else? Remove the code?
comment:25 Changed 8 months ago by
Here are some proposed changes:

COPYING.txt
diff git a/COPYING.txt b/COPYING.txt index 2da3a8e492..7ce750a1aa 100644
a b mistune Modified BSD 86 86 mpc LGPLv3+ 87 87 mpfi COPYING is GPLv2, source files state LGPLv2.1+ 88 88 mpfr LGPLv3+ 89 mpir LGPLv3+90 89 mpmath Modified BSD 91 90 networkx Modified BSD 92 91 ntl GPLv2+ 
build/pkgs/ecm/spkgconfigure.m4
diff git a/build/pkgs/ecm/spkgconfigure.m4 b/build/pkgs/ecm/spkgconfigure.m4 index e62c21cb32..d5302a89fb 100644
a b 1 1 SAGE_SPKG_CONFIGURE([ecm], [ 2 2 m4_pushdef([SAGE_ECM_MINVER],[7.0.4]) 3 3 AC_REQUIRE([SAGE_SPKG_CONFIGURE_GMP]) 4 AC_MSG_CHECKING([installing gmp /mpir? ])4 AC_MSG_CHECKING([installing gmp? ]) 5 5 if test x$sage_spkg_install_gmp = xyes; then 6 6 AC_MSG_RESULT([yes; install ecm as well]) 7 7 sage_spkg_install_ecm=yes 
build/pkgs/gdb/SPKG.rst
diff git a/build/pkgs/gdb/SPKG.rst b/build/pkgs/gdb/SPKG.rst index b89773fe67..0716ac53fa 100644
a b Upstream Contact 19 19 20 20 http://www.gnu.org/software/gdb/ 21 21 22 Dependencies23 24 25  python26  mpc27  mpfr28  ppl29  gmp/mpir30  makeinfo (external)31 32 33 22 Special Update/Build Instructions 34 23  35 24 
build/pkgs/isl/spkgconfigure.m4
diff git a/build/pkgs/isl/spkgconfigure.m4 b/build/pkgs/isl/spkgconfigure.m4 index 1b16f70870..d7bbef80c6 100644
a b 1 1 SAGE_SPKG_CONFIGURE([isl], [ 2 2 AC_REQUIRE([SAGE_SPKG_CONFIGURE_GMP]) 3 AC_MSG_CHECKING([installing gmp /mpir? ])3 AC_MSG_CHECKING([installing gmp? ]) 4 4 if test x$sage_spkg_install_gmp = xyes; then 5 5 AC_MSG_RESULT([yes; install isl as well]) 6 6 sage_spkg_install_isl=yes 
build/pkgs/mpfr/spkgconfigure.m4
diff git a/build/pkgs/mpfr/spkgconfigure.m4 b/build/pkgs/mpfr/spkgconfigure.m4 index 2300be6707..f64ede4b75 100644
a b 1 1 SAGE_SPKG_CONFIGURE([mpfr], [ 2 2 AC_REQUIRE([SAGE_SPKG_CONFIGURE_GMP]) 3 AC_MSG_CHECKING([installing gmp /mpir? ])3 AC_MSG_CHECKING([installing gmp? ]) 4 4 if test x$sage_spkg_install_gmp = xyes; then 5 5 AC_MSG_RESULT([yes; install mpfr as well]) 6 6 sage_spkg_install_mpfr=yes 
m4/sage_spkg_collect.m4
diff git a/m4/sage_spkg_collect.m4 b/m4/sage_spkg_collect.m4 index 1ab62d6fa4..c364ab62b7 100644
a b for DIR in $SAGE_ROOT/build/pkgs/*; do 259 259 AS_VAR_POPDEF([sage_require])dnl 260 260 AS_VAR_POPDEF([sage_spkg_install])dnl 261 261 262 # Packages that should be included in the source distribution263 # This includes all standard packages and two special cases264 case "$SPKG_NAME" in265 mpir)266 in_sdist=yes267 ;;268 esac269 270 262 # Determine package source 271 263 # 272 264 if test f "$DIR/requirements.txt"; then
comment:26 followup: ↓ 28 Changed 8 months ago by
All looking fine, please push them to the ticket
comment:27 Changed 8 months ago by
 Branch changed from u/mkoeppe/remove_package_mpir to u/jhpalmieri/remove_package_mpir
comment:28 in reply to: ↑ 26 Changed 8 months ago by
 Commit changed from 34526ca3ce293701c88607ec385a35b9d8a33e27 to e3ff6aa5aacc6cde5ea466322878a69437b2b376
comment:29 Changed 8 months ago by
comment:30 Changed 8 months ago by
Let's use this ticket to update to consistently use SAGE_SPKG_DEPCHECK
instead of that if test ...
in all the packages affected.
comment:31 Changed 8 months ago by
 Branch changed from u/jhpalmieri/remove_package_mpir to u/dimpase/remove_package_mpir
 Commit changed from e3ff6aa5aacc6cde5ea466322878a69437b2b376 to ccd0ff5770e18037d638e31c2cf67fdbd3f21b22
the monster isn't completely gone yet:
build//pkgs/ppl/spkginstall.in:# Make sure that we prefer Sage's mpir library over systemwide gmp/mpir installs src/doc/it/faq/faqusage.rst: rm spkg/installed/mpir* spkg/installed/atlas* src/doc/it/faq/faqgeneral.rst:`MPIR <http://www.mpir.org>`_, src/doc/en/faq/faqusage.rst: $ rm spkg/installed/mpir* spkg/installed/atlas* src/doc/en/faq/faqgeneral.rst:`MPIR <http://www.mpir.org>`_, src/sage/ext_data/valgrind/sageadditional.supp: fun:sage_mpir_malloc src/sage/ext_data/valgrind/sageadditional.supp: mpir_realloc src/sage/ext_data/valgrind/sageadditional.supp: fun:sage_mpir_realloc src/sage/ext/memory.pyx: sage: 2^(2^632) # optional  mpir src/sage/all.py: # Free globally allocated mpir integers.
taking care of this now.
New commits:
ccd0ff5  use SAGE_SPKG_DEPCHECK

comment:32 Changed 8 months ago by
 Commit changed from ccd0ff5770e18037d638e31c2cf67fdbd3f21b22 to 07da6c3872534e01975d3d90affc102a19a8169d
comment:33 Changed 8 months ago by
 Reviewers set to Dima Pasechnik
comment:34 Changed 8 months ago by
 Dependencies set to #30350
 Reviewers changed from Dima Pasechnik to Dima Pasechnik, Matthias Koeppe
Looking good. Let's merge #30350 (ATLAS removal) to resolve merge conflicts in the documentation and other places
comment:35 Changed 8 months ago by
 Branch changed from u/dimpase/remove_package_mpir to u/mkoeppe/remove_package_mpir
comment:36 Changed 8 months ago by
 Commit changed from 07da6c3872534e01975d3d90affc102a19a8169d to 9ed04f76161ee49e89e961e764fb41414286fa98
Branch pushed to git repo; I updated commit sha1. New commits:
9ed04f7  Merge tag '9.5.beta2' into t/32549/remove_package_mpir

comment:37 Changed 8 months ago by
there were a couple of docbuild errors in FAQs in my branch. Should merge the latest commit from u/dimpase/remove_package_mpir
comment:38 Changed 8 months ago by
 Commit changed from 9ed04f76161ee49e89e961e764fb41414286fa98 to 7c84f31668b4de402673fe8431ef77d7d9e0fcfc
comment:39 Changed 8 months ago by
 Status changed from needs_review to positive_review
OK, this works.
comment:41 Changed 7 months ago by
 Commit changed from 7c84f31668b4de402673fe8431ef77d7d9e0fcfc to 286b39c22f710795775506cfbdcb0cb3be51ced3
Branch pushed to git repo; I updated commit sha1. New commits:
2576f86  build/make/Makefile.in: If a script package has no spkginstall, run "sage info" and exit with error

feb8de7  build/pkgs/: Remove spkginstall scripts for dummy script packages

8f782c0  .github/workflows/tox{optional,experimental}.yml: Do not try to test dummy script packages

4b292be  build/pkgs/perl_mongodb/spkginstall: Remove

a7b6352  build/bin/sagespkginfo: Fix display of system packages

e65b309  bootstrap: Do not provide ./configure enableSPKG options for dummy optional packages

b485d46  m4/sage_spkg_collect.m4: Do not advertise dummy optional packages as installable

286b39c  Merge #31163

comment:42 Changed 7 months ago by
 Dependencies changed from #30350 to #30350, #31163
 Status changed from needs_work to positive_review
comment:43 Changed 7 months ago by
 Branch changed from u/mkoeppe/remove_package_mpir to 286b39c22f710795775506cfbdcb0cb3be51ced3
 Resolution set to fixed
 Status changed from positive_review to closed
comment:44 Changed 7 months ago by
 Commit 286b39c22f710795775506cfbdcb0cb3be51ced3 deleted
perhaps should we ask to the people involved in MPIR how they see the future of MPIR ?
Bill also told me recently that MPIR is not going forward at this point for a combination of reasons. +1 to this ticket.
It seems there are some commits since then (the last is from December 2020 for Linux version and August 2021 for Windows version), perhaps should we ask to the people involved in MPIR how they see the future of MPIR ?