From 172fd15ff1d29cb5319fac14d879fe4344715cbc Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Wed, 19 Jun 2024 22:09:32 -0400 Subject: [PATCH] Remove more MPIR-related cruft --- M2/LICENSING-NOTES | 3 +-- M2/Macaulay2/d/gmp.d | 2 +- M2/Macaulay2/e/TODO-reallocate-heap | 4 ++-- M2/include/M2/config.h.cmake | 3 --- M2/include/M2/gmp-to-mpir/README | 7 ------- M2/include/M2/gmp-to-mpir/gmp.h | 1 - M2/include/M2/gmp-to-mpir/gmpxx.h | 1 - M2/include/M2/math-include.h | 12 ------------ 8 files changed, 4 insertions(+), 29 deletions(-) delete mode 100644 M2/include/M2/gmp-to-mpir/README delete mode 100644 M2/include/M2/gmp-to-mpir/gmp.h delete mode 100644 M2/include/M2/gmp-to-mpir/gmpxx.h diff --git a/M2/LICENSING-NOTES b/M2/LICENSING-NOTES index 5f2d2e3fd6d..800617811d3 100644 --- a/M2/LICENSING-NOTES +++ b/M2/LICENSING-NOTES @@ -15,7 +15,6 @@ Libraries that may be linked with M2: -lmathicgb mathicgb GPL 2 or later -lmemtailor memtailor the Modified BSD License -lmpfr mpfr LGPL 3 or later --lmpirxx -lmpir mpir LGPL 2.1 or later -lntl ntl GPL 2 or later -lpari pari GPL 2 or later -lreadline readline GPL 3 @@ -49,4 +48,4 @@ modifications by Paul Zinn-Justin public domain for M2 binaries: -We are prevented from using GPL 2 by mpir and mpfr +We are prevented from using GPL 2 by mpfr diff --git a/M2/Macaulay2/d/gmp.d b/M2/Macaulay2/d/gmp.d index 7a077c1ac67..554ccee8213 100644 --- a/M2/Macaulay2/d/gmp.d +++ b/M2/Macaulay2/d/gmp.d @@ -14,7 +14,7 @@ header " "; -- We introduce two types of big gmp-type integers here. One type is mutable, and the vector of limbs gets --- allocated with the standard memory allocator used by libgmp (or by its replacement, libmpir), when we use +-- allocated with the standard memory allocator used by libgmp when we use -- gmp routines to create the integers. The other type is immutable, and the limbs are allocated with libgc -- by us in final step after the computation. The types ZZmutable and ZZ are distinct in the D language, so -- neither one can be used as the other, but the underlying pointer types are the same, except that mpz_srcptr diff --git a/M2/Macaulay2/e/TODO-reallocate-heap b/M2/Macaulay2/e/TODO-reallocate-heap index e63725311cb..d73147a49ce 100644 --- a/M2/Macaulay2/e/TODO-reallocate-heap +++ b/M2/Macaulay2/e/TODO-reallocate-heap @@ -3,7 +3,7 @@ TO DO 1. GF (big-gf-flint): need to copy object to GC memory when we save it. 2. PointArray leak. 3. NAG memory leaks (could wait until after the merge). - 4. make sure configure scripts can use built in mpir, flint. + 4. make sure configure scripts can use built in flint. 5. speed of e.g. gb over QQ or ZZ. 6. make sure: all tests and example run correctly. On multiple machines. 7. gmp.d has warning message: remove those. @@ -82,7 +82,7 @@ previous notes: The plan: - 1. Make it so that we can link with gmp/mpir, flint, mpfr, without modification. + 1. Make it so that we can link with gmp, flint, mpfr, without modification. This just means that when we use mpz fcns, etc that we then copy the results into gc memory, OR that we will have that space freed by usual new/delete methods in c++. 2. Possibly allow the engine to be gc free, except for objects going to the front end. diff --git a/M2/include/M2/config.h.cmake b/M2/include/M2/config.h.cmake index 87cd32a7f3d..878bec7fd0d 100644 --- a/M2/include/M2/config.h.cmake +++ b/M2/include/M2/config.h.cmake @@ -330,9 +330,6 @@ /* Define to 1 if you have the ANSI C header files. */ #cmakedefine STDC_HEADERS 1 -/* Whether we use MPIR (instead of GMP) */ -#cmakedefine01 USING_MPIR - /* Whether we are building with tbb version >= 2021 */ #cmakedefine WITH_TBB diff --git a/M2/include/M2/gmp-to-mpir/README b/M2/include/M2/gmp-to-mpir/README deleted file mode 100644 index 5b458157dfb..00000000000 --- a/M2/include/M2/gmp-to-mpir/README +++ /dev/null @@ -1,7 +0,0 @@ -In this directory we have two files that can be used to redirect inclusions of -GMP files to MPIR files. Flint, in particular, doesn't seem to have a -convenient configure option for specifying whether to use MPIR instead of GMP --- it just includes gmp.h. - -The way we bring these two files into play for flint is by compiling with a -I -option pointing to this directory. diff --git a/M2/include/M2/gmp-to-mpir/gmp.h b/M2/include/M2/gmp-to-mpir/gmp.h deleted file mode 100644 index fcfa854a61a..00000000000 --- a/M2/include/M2/gmp-to-mpir/gmp.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/M2/include/M2/gmp-to-mpir/gmpxx.h b/M2/include/M2/gmp-to-mpir/gmpxx.h deleted file mode 100644 index 2d320dcdf9d..00000000000 --- a/M2/include/M2/gmp-to-mpir/gmpxx.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/M2/include/M2/math-include.h b/M2/include/M2/math-include.h index 1727e01c897..de681781cef 100644 --- a/M2/include/M2/math-include.h +++ b/M2/include/M2/math-include.h @@ -11,24 +11,12 @@ #include - #ifdef HAVE_STDINT_H - /* This prevents a problem with mpir.h and mpirxx.h, that arises when stdint.h is loaded - after mpir.h is but before mpirxx.h is. Solution: load it first. We load it - here, just before loading gmp.h, which, for us, used to be just a link to mpir.h. */ - #define __STDC_LIMIT_MACROS - #include - #endif - #ifdef HAVE_STDDEF_H /* this prevents a problem in Mac OS X, where 'cstddef' is loaded before 'stddef.h', and it causes a problem */ #include #endif - #if USING_MPIR - #include - #else #include - #endif #define MPFR_USE_NO_MACRO #include