The package rpms/Macaulay2.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/Macaulay2.git/commit/?id=1690102d....
Change:
+ExcludeArch: %{ix86} %{arm}
Thanks.
Full change:
============
commit 1690102d4b3adc2f729e6640d62b91412a6c29b0
Author: Jerry James <loganjerry(a)gmail.com>
Date: Mon Aug 31 21:19:59 2020 -0600
Version 1.16.
- Drop upstreamed patch: -xdg_open.
- Add -ulimit patch for the slower builders.
- Add -format and -rightarrow patches.
- Bundle packages due to garbage collector crashes: linbox, memtailor, mathic.
- Drop the XEmacs subpackage; XEmacs support no longer works.
diff --git a/Macaulay2-1.11-xdg_open.patch b/Macaulay2-1.11-xdg_open.patch
deleted file mode 100644
index b7e7740..0000000
--- a/Macaulay2-1.11-xdg_open.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- M2/Macaulay2/m2/html.m2.orig 2018-03-07 10:43:35.000000000 -0700
-+++ M2/Macaulay2/m2/html.m2 2018-04-22 14:48:26.637899340 -0600
-@@ -1263,6 +1263,7 @@ chk := ret -> if ret != 0 then (
- error "external command failed"
- )
- browserMethods := hashTable {
-+ "xdg open" => url -> {"xdg-open", url},
- "firefox" => url -> {"firefox", url},
- "open" => url -> {"open", url},
- "cygstart" => url -> {"cygstart", url},
-@@ -1278,7 +1279,8 @@ show URL := x -> (
- else
- if version#"issue" === "Cygwin" then browser =
"cygstart";
- if browser === "" then (
-- if runnable "firefox" then browser = "firefox"
-+ if runnable "xdg-open" then browser = "xdg-open"
-+ else if runnable "firefox" then browser = "firefox"
- else if runnable "netscape" then browser = "netscape"
- else error "no browser found, and none specified in $WWWBROWSER"
- );
diff --git a/Macaulay2-1.15-default_make_targets.patch
b/Macaulay2-1.15-default_make_targets.patch
deleted file mode 100644
index 0c209c9..0000000
--- a/Macaulay2-1.15-default_make_targets.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- M2/Macaulay2/Makefile.in.orig 2020-05-28 20:16:53.246808781 -0600
-+++ M2/Macaulay2/Makefile.in 2020-05-28 20:17:27.293787155 -0600
-@@ -7,7 +7,7 @@ SUBDIRS = util regex c
- ifeq "@DUMPDATA@" "yes"
- SUBDIRS += dumpdata
- endif
--SUBDIRS += d e system bin m2 man packages emacs html-check-links tests
-+SUBDIRS += d e system bin m2 man packages emacs
- SUBDIRS += book
-
- define do-in-subdirs
diff --git a/Macaulay2-1.16-default_make_targets.patch
b/Macaulay2-1.16-default_make_targets.patch
new file mode 100644
index 0000000..1e77bcf
--- /dev/null
+++ b/Macaulay2-1.16-default_make_targets.patch
@@ -0,0 +1,11 @@
+--- M2/Macaulay2/Makefile.in.orig 2020-07-12 19:17:33.241211749 -0600
++++ M2/Macaulay2/Makefile.in 2020-07-12 19:18:07.133195781 -0600
+@@ -3,7 +3,7 @@
+ VPATH = @srcdir@
+ include ../include/config.Makefile
+ all: @pre_docdir@/COPYING-GPL-2 @pre_docdir@/COPYING-GPL-3 @pre_docdir@/README
@pre_docdir@/LAYOUT
+-SUBDIRS = util regex c d e system bin m2 man packages editors html-check-links tests
++SUBDIRS = util regex c d e system bin m2 man packages editors
+
+ define do-in-subdirs
+ $(foreach d,$(SUBDIRS),
diff --git a/Macaulay2-1.16-format.patch b/Macaulay2-1.16-format.patch
new file mode 100644
index 0000000..2ffd3f5
--- /dev/null
+++ b/Macaulay2-1.16-format.patch
@@ -0,0 +1,11 @@
+--- M2/Macaulay2/e/mem.cpp.orig 2020-07-11 05:04:29.000000000 -0600
++++ M2/Macaulay2/e/mem.cpp 2020-07-12 19:26:39.391982818 -0600
+@@ -71,7 +71,7 @@ void stash::text_out(buffer &o) const
+ {
+ char s[200];
+ sprintf(s,
+- "%16s %9dk %9dk %10zd %10lu %10lu %10lu %10lu%s",
++ "%16s %9dk %9dk %10zu %10zu %10zu %10zu %10zu%s",
+ name,
+ static_cast<int>((element_size * highwater + 1023) / 1024),
+ static_cast<int>((element_size * n_inuse + 1023) / 1024),
diff --git a/Macaulay2-1.15-no_gftables.patch b/Macaulay2-1.16-no_gftables.patch
similarity index 67%
rename from Macaulay2-1.15-no_gftables.patch
rename to Macaulay2-1.16-no_gftables.patch
index 7aa2807..e491a6e 100644
--- a/Macaulay2-1.15-no_gftables.patch
+++ b/Macaulay2-1.16-no_gftables.patch
@@ -1,7 +1,7 @@
---- M2/configure.ac.orig 2020-05-28 20:18:37.577744116 -0600
-+++ M2/configure.ac 2020-05-28 20:19:23.942716638 -0600
-@@ -711,7 +711,7 @@ AC_SUBST(BUILTLIBS)
- AC_SUBST(LIBLIST, " atomic_ops gc gdbm gmp mpir mpfr readline ntl flint factory
lapack mpsolve frobby glpk cddlib fplll givaro linbox boost gtest ")
+--- M2/configure.ac.orig 2020-07-12 19:15:12.986277846 -0600
++++ M2/configure.ac 2020-07-12 19:19:00.202170774 -0600
+@@ -673,7 +673,7 @@ AC_SUBST(BUILTLIBS)
+ AC_SUBST(LIBLIST, " atomic_ops gc gdbm gmp mpir mpfr readline ntl flint factory
lapack mpsolve frobby glpk cddlib fplll linbox gtest ")
# The list LIBLIST is the list of libraries that might be used and linked into M2.
-AC_SUBST(PROGLIST, "4ti2 gfan normaliz csdp nauty cddplus lrslib gftables topcom
cohomcalg")
diff --git a/Macaulay2-1.16-rightarrow.patch b/Macaulay2-1.16-rightarrow.patch
new file mode 100644
index 0000000..1c4abd5
--- /dev/null
+++ b/Macaulay2-1.16-rightarrow.patch
@@ -0,0 +1,11 @@
+--- M2/Macaulay2/packages/Macaulay2Doc/overview_modules.m2.orig 2020-07-11
05:04:29.000000000 -0600
++++ M2/Macaulay2/packages/Macaulay2Doc/overview_modules.m2 2020-07-12 19:27:28.520963206
-0600
+@@ -347,7 +347,7 @@ document {
+ },
+ TEX "Macaulay2 represents each module (at least conceptually) as a subquotient
module, that is, a submodule of
+ a quotient of an ambient free module. A subquotient module is determined by two
+- matrices $f : R^m \\rightarrow{} R^n$ and $g : R^p \\rightarrow{} R^n$.
++ matrices $f : R^m \\rightarrow R^n$ and $g : R^p \\rightarrow R^n$.
+ The {\\em subquotient module} with generators $f$ and relations $g$ is by
definition the module
+ $M = ((image f) + (image g))/(image g)$.",
+ PARA{},
diff --git a/Macaulay2-1.16-ulimit.patch b/Macaulay2-1.16-ulimit.patch
new file mode 100644
index 0000000..96065a5
--- /dev/null
+++ b/Macaulay2-1.16-ulimit.patch
@@ -0,0 +1,115 @@
+--- M2/GNUmakefile.in.orig 2020-07-11 05:04:29.000000000 -0600
++++ M2/GNUmakefile.in 2020-07-12 19:24:55.838024149 -0600
+@@ -136,7 +136,7 @@ build-in-$1: submodules/$1/Makefile
+ $(MAKE) -C submodules/$1 all
+ check-in-$1: run-configure-in-$1
+ ifeq ($(no-check-$1),)
+- ulimit -v 1000000 && $(MAKE) -C submodules/$1 check
++ ulimit -v 2000000 && $(MAKE) -C submodules/$1 check
+ endif
+
+ install-in-$1: build-in-$1; + $(MAKE) -C submodules/$1 install
+--- M2/libraries/Makefile.library.in.orig 2020-07-11 05:04:29.000000000 -0600
++++ M2/libraries/Makefile.library.in 2020-07-12 19:20:23.705132772 -0600
+@@ -238,10 +238,10 @@ distclean: package-distclean
+ clean::; rm -rf .patched* .untarred* $(LIBNAME)* .checked* .compiled* .configured*
.installed* .untarred2* diffs tmp $(UNTARDIR) $(OLDUNTARDIR)
+ distclean: clean ; rm -rf Makefile
+
+-SLIMIT ?= 8192
+-TLIMIT ?= 100
+-MLIMIT ?= 400000
+-VLIMIT ?= 400000
++SLIMIT ?= 16384
++TLIMIT ?= 200
++MLIMIT ?= 800000
++VLIMIT ?= 800000
+ LIMIT := :
+ ifeq (@ULIMIT_T@,yes)
+ LIMIT += ; ulimit -t $(TLIMIT)
+--- M2/Macaulay2/m2/basictests/Makefile.in.orig 2020-07-11 05:04:29.000000000 -0600
++++ M2/Macaulay2/m2/basictests/Makefile.in 2020-07-12 19:23:46.653051760 -0600
+@@ -22,17 +22,17 @@ $(TESTRESULTS) : @pre_exec_prefix@/bin/M
+ ARGS := --silent -q --stop --no-setup -e 'srcdir = "@srcdir@/"'
+
+ ifeq "@DEBUG@" "no"
+-TLIMIT ?= 20
+-MLIMIT ?= 600000
+-VLIMIT ?= 600000
++TLIMIT ?= 40
++MLIMIT ?= 1200000
++VLIMIT ?= 1200000
+ else
+-TLIMIT ?= 60
+-MLIMIT ?= 700000
+-VLIMIT ?= 700000
++TLIMIT ?= 120
++MLIMIT ?= 1400000
++VLIMIT ?= 1400000
+ endif
+
+ # make the stack limit always the same as it would be under MacOS
+-SLIMIT ?= 8192
++SLIMIT ?= 16384
+
+ LIMIT :=
+ ifeq (@ULIMIT_T@,yes)
+--- M2/Macaulay2/m2/run.m2.orig 2020-07-11 05:04:29.000000000 -0600
++++ M2/Macaulay2/m2/run.m2 2020-07-12 19:22:43.157077109 -0600
+@@ -7,7 +7,7 @@
+ utest := opt -> (
+ cmd := "ulimit " | opt | "; ";
+ if chkrun("2>/dev/null >/dev/null "|cmd) == 0 then cmd else
"")
+-ulimit := utest "-c unlimited" | utest "-t 700" | utest "-m
850000" | utest "-s 8192" | utest "-n 512"
++ulimit := utest "-c unlimited" | utest "-t 1400" | utest "-m
1700000" | utest "-s 16384" | utest "-n 512"
+
+ M2statusRegexp := "^--status:"
+ statusLines := file -> select(lines file, s -> match(M2statusRegexp,s))
+--- M2/Macaulay2/tests/ComputationsBook/Makefile.chapter.in.orig 2020-07-11
05:04:29.000000000 -0600
++++ M2/Macaulay2/tests/ComputationsBook/Makefile.chapter.in 2020-07-12 19:20:27.318131329
-0600
+@@ -15,16 +15,16 @@ diff:
+
+ LIMIT :=
+ ifeq (@ULIMIT_T@,yes)
+-LIMIT += ulimit -t 1200 ;
++LIMIT += ulimit -t 2400 ;
+ endif
+ ifeq (@ULIMIT_V@,yes)
+-LIMIT += ulimit -v 1600000 ;
++LIMIT += ulimit -v 3200000 ;
+ endif
+ ifeq (@ULIMIT_M@,yes)
+-LIMIT += ulimit -m 800000 ;
++LIMIT += ulimit -m 1600000 ;
+ endif
+ ifeq (@ULIMIT_S@,yes)
+-LIMIT += ulimit -s 8192 ;
++LIMIT += ulimit -s 16834 ;
+ endif
+
+
+--- M2/Macaulay2/tests/Makefile.test.in.orig 2020-07-11 05:04:29.000000000 -0600
++++ M2/Macaulay2/tests/Makefile.test.in 2020-07-12 19:20:27.319131328 -0600
+@@ -6,18 +6,18 @@ DEFERRED ?= no
+
+ DOTS ?= ../..
+ ifeq "@DEBUG@" "no"
+-TLIMIT ?= 90
++TLIMIT ?= 180
+ # one test doesn't work with only 150MB RAM, ext-total.m2, on a 64 bit intel
machine:
+-MLIMIT ?= 800000
++MLIMIT ?= 1600000
+ VLIMIT ?= 2000000
+ else
+ # give the debug version more time and space
+-TLIMIT ?= 140
+-MLIMIT ?= 1200000
++TLIMIT ?= 280
++MLIMIT ?= 2400000
+ VLIMIT ?= 2000000
+ endif
+ # make the stack limit always the same as it would be under MacOS
+-SLIMIT ?= 8192
++SLIMIT ?= 16384
+
+ LIMIT :=
+ ifeq (@ULIMIT_T@,yes)
diff --git a/Macaulay2.spec b/Macaulay2.spec
index ec63552..b28494a 100644
--- a/Macaulay2.spec
+++ b/Macaulay2.spec
@@ -8,13 +8,29 @@
# - factory (from Singular) configured with --disable-omalloc --enable-streamio
# and linked with the flint that is linked with the GC-enabled mpfr
# Since the main Fedora packages are not built in this way, we are forced to
-# bundle these packages to avoid random GC-related crashes.
+# bundle these packages to avoid random GC-related crashes. The packages
+# memtailor and mathic, which sit underneath mathicgb, must also be bundled or
+# we get random GC-related crashes for an as yet undiagnosed reason.
#
-# In addition, we have to use the static versions of the libfplll and givaro
-# libraries. Both have global objects whose constructors run before GC is
-# initialized. If we allow the shared libraries to be unloaded, which happens
-# as a normal part of Macaulay2's functioning, then GC tries to free objects it
-# did not allocate, which leads to a segfault.
+# We have to use the static version of the libfplll and givaro library. They
+# have global objects whose constructors run before GC is initialized. If we
+# allow the shared libraries to be unloaded, which happens as a normal part of
+# Macaulay2's functioning, then GC tries to free objects it did not allocate,
+# which leads to a segfault.
+#
+# We have to bundle the linbox package. It has global constructors that cause
+# the same problem as libfplll.
+
+# Upstream wants us to build the final commit in a release branch. We wait
+# for a release announcement, then pull from git. The tarballs in the git repo
+# are for upstream's use, not for distributions to build.
+%global commit 94c4b7db5dcafeaf2b97315a2bed6ac8ba16ee6b
+%global shortcommit %(cut -b -7 <<< %{commit})
+%global m2url
https://github.com/Macaulay2/M2
+
+%global emacscommit 7460c448d40571866e8290ac862abbc28c1b5b37
+%global emacsurl
https://github.com/Macaulay2/M2-emacs
+%global emacsshort %(cut -b -7 <<< %{emacscommit})
# Address randomization interferes with Macaulay2's memory management scheme,
# and linking with -z now breaks configure.
@@ -42,16 +58,17 @@
Summary: System for algebraic geometry and commutative algebra
Name: Macaulay2
-Version: 1.15.1.0
-Release: 5%{?dist}
+Version: 1.16
+Release: 1%{?dist}
License: GPLv2 or GPLv3
URL:
http://macaulay2.com/
%if 0%{?snap:1}
-Source0: Macaulay2-%{version}-%{snap}.tar.xz
+Source0: %{name}-%{version}-%{snap}.tar.xz
%else
-Source0:
https://github.com/%{name}/M2/archive/version-%{version}.tar.gz
+Source0: %{m2url}/tarball/%{commit}/%{name}-%{version}.tar.gz
%endif
+Source1: %{emacsurl}/tarball/%{emacscommit}/M2-emacs-%{emacsshort}.tar.gz
# Various sizes of the planets icon from
macaulay2.com. See README.icons in
# the tar file for details on how these icons were created.
@@ -66,14 +83,13 @@ Source100:
http://www.math.uiuc.edu/Macaulay2/Downloads/OtherSourceCode/normaliz
Provides: bundled(normaliz) = %{normalizver}
# MPFR is bundled because it must be built with different threading options
-%global mpfrver 4.0.2
+%global mpfrver 4.1.0
Source101:
http://www.mpfr.org/mpfr-%{mpfrver}/mpfr-%{mpfrver}.tar.xz
Provides: bundled(mpfr) = %{mpfrver}
# FLINT is bundled because it must be linked with the specially-built MPFR
-%global flintver 20200414
-Source102:
https://faculty.math.illinois.edu/Macaulay2/Downloads/OtherSourceCode/fli...
-#Source102:
http://www.flintlib.org/flint-%%{flintver}.tar.gz
+%global flintver 2.6.3
+Source102:
http://www.flintlib.org/flint-%{flintver}.tar.gz
Provides: bundled(flint) = %{flintver}
# FACTORY is bundled because it must be built with special options
@@ -83,7 +99,7 @@ Provides: bundled(factory) = %{factoryver}
# MATHICGB is bundled because it must be built with different threading options
%global mathicgbver 1.0
-%global mathicgbcommit 636952f94bf6bb6d82a84f0c9ac7f44373f8a34f
+%global mathicgbcommit 0d70da731a84008143a00cf1effd978dc8607879
Source104:
https://github.com/Macaulay2/mathicgb/tarball/%{mathicgbcommit}/mathicgb-...
Provides: bundled(mathicgb) = %{mathicgbver}
@@ -91,15 +107,30 @@ Provides: bundled(mathicgb) = %{mathicgbver}
%global gtestver 1.10.0
Source105:
https://faculty.math.illinois.edu/Macaulay2/Downloads/OtherSourceCode/gte...
+# MEMTAILOR is bundled because it causes garbage collector crashes otherwise
+%global memtailorver 1.0
+%global memtailorcommit 1d13f96bc7d84b7ac401e6b8c936fad26f08786c
+Source106:
https://github.com/Macaulay2/memtailor/tarball/%{memtailorcommit}/memtail...
+Provides: bundled(memtailor) = %{memtailorver}
+
+# MATHIC is bundled because it causes garbage collector crashes otherwise
+%global mathicver 1.0
+%global mathiccommit 44095b846a83c05cbff6f3e8765070e5cda40e67
+Source107:
https://github.com/Macaulay2/mathic/tarball/%{mathiccommit}/mathic-%{math...
+Provides: bundled(mathic) = %{mathicver}
+
+# LINBOX is bundled because it introduces static global objects
+%global linboxver 1.6.3
+Source108:
https://github.com/linbox-team/linbox/archive/v%{linboxver}}/linbox-%{lin...
+Provides: bundled(linbox) = %{linboxver}
+
## PATCHES FOR BUNDLED code
-# Fix flint memory leaks
-Source200: flint-20200414.patch
+# Work around an ambiguous overload on 32-bit platforms
+Source200: linbox-1.6.3.patch
# Fix factory build failure. REPLACES the upstream patch.
Source201: factory-4.1.1.patch
-# Upstream mpfr patches subsequent to the 4.0.2 release.
-Source202: mpfr-4.0.2.patch
# Fix mathicgb build on big endian machines.
-Source203: mathicgb-1.0.patch
+Source202: mathicgb-1.0.patch
## FAKE library tarballs that convince Macaulay2 to use the system versions
Source300: frobby_v0.9.0.tar.gz
@@ -114,22 +145,26 @@ Source308: TOPCOM-0.17.8.tar.gz
Source309: cohomCalg-0.32.tar.gz
Source310: glpk-4.59.tar.gz
Source311: Csdp-6.2.0.tgz
-Source312: mpsolve-3.1.8.tar.gz
+Source312: mpsolve-3.2.1.tar.gz
# let Fedora optflags override the defaults
Patch0: %{name}-1.15-optflags.patch
-# use xdg-open as the default browser
-Patch1: %{name}-1.11-xdg_open.patch
+# give the build a little more time and space than upstream permits
+Patch1: %{name}-1.16-ulimit.patch
# fix paths to nauty binaries
Patch2: %{name}-1.11-nauty-paths.patch
# drop 'tests' from default make target
-Patch3: %{name}-1.15-default_make_targets.patch
+Patch3: %{name}-1.16-default_make_targets.patch
# disable check for gftables
-Patch4: %{name}-1.15-no_gftables.patch
+Patch4: %{name}-1.16-no_gftables.patch
# adapt to libfplll 5.2.1
Patch5: %{name}-1.15-fplll.patch
# do not override the debug level
Patch6: %{name}-1.12-configure.patch
+# fix some -Wformat warnings
+Patch7: %{name}-1.16-format.patch
+# Fix "error: in conversion to html, unknown TeX control sequence(s):
\rightarrow"
+Patch8: %{name}-1.16-rightarrow.patch
BuildRequires: 4ti2
BuildRequires: autoconf
@@ -151,6 +186,7 @@ BuildRequires: doxygen
%endif
# etags
BuildRequires: emacs
+BuildRequires: expat-devel
BuildRequires: factory-gftables
BuildRequires: fflas-ffpack-devel
BuildRequires: flex
@@ -161,6 +197,7 @@ BuildRequires: gdb
BuildRequires: gdbm-devel
BuildRequires: gettext-devel
BuildRequires: gfan
+BuildRequires: git-core
BuildRequires: givaro-static
BuildRequires: glpk-devel
%if 0%{?gmp}
@@ -169,6 +206,7 @@ BuildRequires: gmp-devel
BuildRequires: mpir-devel
%endif
BuildRequires: gtest-devel
+BuildRequires: iml-devel
BuildRequires: info
BuildRequires: libgfan-devel
BuildRequires: libtool
@@ -179,12 +217,12 @@ BuildRequires: libnauty-devel
%if 0%{?system_normaliz}
BuildRequires: libnormaliz-devel >= 3.6.3
%endif
-BuildRequires: linbox-devel
+BuildRequires: libtool
BuildRequires: lrslib-devel
BuildRequires: lrslib-utils
+BuildRequires: m4ri-devel
+BuildRequires: m4rie-devel
BuildRequires: mariadb-devel
-BuildRequires: memtailor-devel
-BuildRequires: mathic-devel
BuildRequires: mpsolve-devel
BuildRequires: nauty
BuildRequires: normaliz
@@ -198,10 +236,11 @@ BuildRequires: polymake
BuildRequires: python3
BuildRequires: qd-devel
BuildRequires: readline-devel
-BuildRequires: tbb-devel
BuildRequires: time
+BuildRequires: tinyxml2-devel
BuildRequires: TOPCOM
-BuildRequires: xemacs
+BuildRequires: transfig
+BuildRequires: valgrind
Requires: 4ti2
Requires: cohomCalg
@@ -213,7 +252,8 @@ Requires: hicolor-icon-theme
Requires: lrslib-utils
Requires: nauty
Requires: TOPCOM
-Requires: xemacs-filesystem
+
+Recommends: mathicgb
%if 0%{?common}
Requires: %{name}-common = %{version}-%{release}
@@ -235,6 +275,10 @@ Requires: xdg-utils
Requires: normaliz
%endif
+# Macaulay2 no longer builds successfully on 32-bit platforms
+#
https://bugzilla.redhat.com/show_bug.cgi?id=1874318
+ExcludeArch: %{ix86} %{arm}
+
# Do not advertise the bundled mpfr
%global __provides_exclude libmpfr.so*
@@ -253,8 +297,9 @@ BuildArch: noarch
%prep
-%setup -q -n M2-version-%{version}/M2
-%setup -q -n M2-version-%{version}/M2 -T -D -a 10
+%setup -q -n %{name}-M2-%{shortcommit}/M2
+%setup -q -n %{name}-M2-%{shortcommit}/M2 -T -D -a 10
+tar -C Macaulay2/editors/emacs --strip-components=1 -xzf %{SOURCE1}
install -p -m755 %{SOURCE20} ./etags
@@ -266,21 +311,23 @@ sed -e '/PROGRAMS =/aPATCHFILE =
@abs_srcdir@/patch-$(VERSION)' \
-i libraries/normaliz/Makefile.in
%endif
install -p -m644 %{SOURCE101} %{SOURCE102} %{SOURCE103} %{SOURCE105} \
- BUILD/tarfiles/
+ %{SOURCE108} BUILD/tarfiles/
sed -i 's/\(VERSION = \).*/\1%{mpfrver}/' libraries/mpfr/Makefile.in
-pushd submodules/mathicgb
-tar -xf %{SOURCE104} --strip-components=1
-patch -p0 < %{SOURCE203}
-popd
+sed -e 's/\(VERSION = \).*/\1%{linboxver}/' \
+ -e 's/^#\(PATCHFILE\)/\1/' \
+ -e 's,--with-gmp.*,GIVARO_CFLAGS=-I$(LIBRARIESDIR)
GIVARO_LIBS="%{_libdir}/libgivaro.a",' \
+ -i libraries/linbox/Makefile.in
+tar -C submodules/mathicgb -xf %{SOURCE104} --strip-components=1
+patch -d submodules/mathicgb -p0 < %{SOURCE202}
+tar -C submodules/memtailor -xf %{SOURCE106} --strip-components=1
+tar -C submodules/mathic -xf %{SOURCE107} --strip-components=1
## patches for bundled code
-cp -p %{SOURCE200} libraries/flint/patch-%{flintver}
-sed -e 's/# PATCHFILE/PATCHFILE/' \
- -e 's,--with-blas,&=%{_includedir}/%{blaslib} --with-ntl,' \
+sed -e 's,--with-blas,&=%{_includedir}/%{blaslib} --with-ntl,' \
+ -e 's,2\.6\.0,%{flintver},' \
-i libraries/flint/Makefile.in
+cp -p %{SOURCE200} libraries/linbox/patch-%{linboxver}
cp -p %{SOURCE201} libraries/factory/patch-%{factoryver}
-cp -p %{SOURCE202} libraries/mpfr/patch-%{mpfrver}
-cp -p %{SOURCE203} submodules/mathicgb/patch-%{mathicgbver}
## fake library tarballs
install -p -m644 %{SOURCE300} %{SOURCE301} %{SOURCE302} %{SOURCE303} \
@@ -291,10 +338,12 @@ sed -i 's/VERSION = 4\.0\.4/VERSION = 5.2.0/;/PATCHFILE/d'
libraries/fplll/Makef
sed -i '/PATCHFILE/d'
libraries/{csdp,frobby,gfan,givaro,mpsolve,normaliz,topcom}/Makefile.in
sed -i '/INSTALLCMD/,/stdinc/d' libraries/frobby/Makefile.in
sed -i 's,install \(lib.*\.a\),ln -s %{_libdir}/\1,'
libraries/lapack/Makefile.in
-sed -i '/TARFILE/iPATCHFILE = @abs_srcdir@/patch-$(VERSION)'
libraries/mpfr/Makefile.in
+
+## fake givaro submodule
+tar -C submodules/givaro --strip-components=1 -xzf %{SOURCE306}
%patch0 -p1 -b .optflags
-%patch1 -p1 -b .xdg_open
+%patch1 -p1 -b .ulimit
%patch2 -p1 -b .nauty
%patch3 -p1 -b .default_make_targets
%patch4 -p1 -b .no_gftables
@@ -304,6 +353,8 @@ ln -s %{_datadir}/factory \
BUILD/%{_target_platform}/usr-dist/common/share/Macaulay2/Core/factory
%patch5 -p1 -b .fplll
%patch6 -p1 -b .configure
+%patch7 -p1 -b .format
+%patch8 -p1 -b .rightarrow
# repeatable builds: inject a node name
sed -i 's,`uname -n`,build.fedoraproject.org,' configure.ac
@@ -313,34 +364,22 @@ if [ "$HOME" = "/builddir" ]; then
echo "set auto-load safe-path /" > /builddir/.gdbinit
fi
-# fix executable bits
-chmod a-x Macaulay2/packages/NumericalAlgebraicGeometry/hom4ps2_in_out
-
-# Use, but don't build, cddlib, fflas-ffpack, gc, and linbox. Use the static
-# versions of libfplll and givaro. Do not invoke git on a nonrepository. Link
-# with blaslib instead of the reference blas and lapack. Fix a typo.
+# Use, but don't build, cddlib, fflas-ffpack, and gc. Use the static versions
+# of libfplll and givaro. Do not invoke git on a nonrepository. Link with
+# blaslib instead of the reference blas and lapack. Fix typos.
sed -e 's/^BUILD_cddlib=yes/BUILD_cddlib=no/' \
-e 's/^BUILD_gc=yes/BUILD_gc=no/' \
- -e 's/BUILD_linbox=yes/BUILD_linbox=no/' \
-e 's/BUILD_fflas_ffpack=yes/BUILD_fflas_ffpack=no/' \
-e 's/^\(GIT_DESCRIPTION=\).*/\1"unknown"/' \
- -e 's,-lfplll,%{_libdir}/libfplll.a,' \
+ -e 's,-lfplll,%{_libdir}/libfplll.a -lqd,' \
+ -e 's,`\$PKG_CONFIG --libs givaro`,%{_libdir}/libgivaro.a,' \
-e 's,-lgivaro,%{_libdir}/libgivaro.a,' \
-e 's,-llapack -lrefblas,-l%{blaslib},' \
-e 's,\$added_fclibs != yes,"$added_fclibs" != yes,' \
-i configure.ac
-# Use, but don't build, memtailor and mathic. Link with qd.
-sed -e '/LIBDEPS_FOR_BUILD/s/ memtailor mathic//' \
- -e '/LDLIBS_FOR_BUILD/s/mathicgb/& qd/' \
- -i include/config.Makefile.in
-
-# We want to build mathicgb, but not mathic or memtailor. This line in
-# GNUmakefile assumes that building mathicgb means building the other two.
-sed -i '/all-in-mathicgb:all-in-mathic all-in-memtailor/d' GNUmakefile.in
-
# (re)generate configure
-[ -f configure -a -f include/config.h ] || make
+autoreconf -fi .
%build
@@ -366,6 +405,7 @@ cxxflags="%{optflags} -fsigned-char"
CPPFLAGS="-I%{_includedir}/cddlib -I%{_includedir}/frobby" \
CFLAGS="%{optflags} -fsigned-char" \
CXXFLAGS="$cxxflags" \
+LIBS="-l%{blaslib}" \
../../configure \
--build=%{_build} \
--host=%{_host} \
@@ -383,9 +423,9 @@ CXXFLAGS="$cxxflags" \
--with-integer-package=mpir \
%endif
--with-unbuilt-programs="cddplus nauty" \
- --enable-build-libraries="mpfr flint factory lapack fplll givaro gtest"
+ --enable-build-libraries="mpfr flint factory lapack fplll givaro linbox
gtest"
# The list of libraries and submodules above should include only those that:
- # 1. We bundle (mpfr, flint, and factory)
+ # 1. We bundle (mpfr, flint, factory, and linbox)
# 2. We sneakily substitute one library for another (lapack -> blaslib)
# 3. Have to be linked with the static library (fplll and givaro)
popd
@@ -434,24 +474,19 @@ desktop-file-install --vendor="" \
--dir=%{buildroot}%{_datadir}/applications \
%{SOURCE11}
-# Byte compile the (X)Emacs files, and move the documentation
-mkdir -p %{buildroot}%{_xemacs_sitelispdir}
-cp -p %{buildroot}%{_emacs_sitelispdir}/*.el %{buildroot}%{_xemacs_sitelispdir}
-pushd %{buildroot}%{_emacs_sitelispdir}
-mv M2-emacs* M2-README %{buildroot}%{_pkgdocdir}
+# Byte compile the Emacs files, and move the documentation
+pushd %{buildroot}%{_emacs_sitelispdir}/%{name}
+mv M2-emacs* %{buildroot}%{_pkgdocdir}
+mv README.md %{buildroot}%{_pkgdocdir}/README-emacs.md
%{_emacs_bytecompile} *.el
-cd %{buildroot}%{_xemacs_sitelispdir}
-%{_xemacs_bytecompile} *.el
popd
-# Missing executable bit
-chmod a+x %{buildroot}%{_datadir}/Macaulay2/NumericalAlgebraicGeometry/hom4ps2_in_out
-
## unpackaged files
# info dir
rm -fv %{buildroot}%{_infodir}/dir
-# source control file
-rm -f %{buildroot}%{_datadir}/Macaulay2/Macaulay2Doc/test/.gitignore
+
+# Delete misinstalled memtailor, mathic, and mathicgb libraries
+rm -fr %{buildroot}/builddir
%check
@@ -476,11 +511,18 @@ time make -k check -C BUILD/%{_target_platform} Verbose=true ||:
%{_docdir}/Macaulay2/
%{_infodir}/*.info*
%{_mandir}/man1/*
-%{_emacs_sitelispdir}/*
-%{_xemacs_sitelispdir}/*
+%{_emacs_sitelispdir}/%{name}/
%changelog
+* Mon Aug 31 2020 Jerry James <loganjerry(a)gmail.com> - 1.16-1
+- Version 1.16
+- Drop upstreamed patch: -xdg_open
+- Add -ulimit patch for the slower builders
+- Add -format and -rightarrow patches
+- Bundle packages due to garbage collector crashes: linbox, memtailor, mathic
+- Drop the XEmacs subpackage; XEmacs support no longer works
+
* Sun Aug 16 2020 Iñaki Úcar <iucar(a)fedoraproject.org> - 1.15.1.0-5
-
https://fedoraproject.org/wiki/Changes/FlexiBLAS_as_BLAS/LAPACK_manager
diff --git a/factory-4.1.1.patch b/factory-4.1.1.patch
index 81f4286..4438666 100644
--- a/factory-4.1.1.patch
+++ b/factory-4.1.1.patch
@@ -1,3 +1,25 @@
+--- m4/flags.m4.orig 2018-02-15 07:02:18.000000000 -0700
++++ m4/flags.m4 2020-07-12 20:46:53.024384864 -0600
+@@ -122,7 +122,7 @@ AC_DEFUN([SING_CHECK_SET_ARGS], [
+ ## for clang: -Wunneeded-internal-declaration
+
+ if test "x${ENABLE_OPTIMIZATION}" != xno; then
+- OPTFLAGS="-g0 -O3 -Wno-unused-function -Wno-trigraphs -Wno-unused-parameter
-Wunknown-pragmas -Wno-unused-variable -fomit-frame-pointer -fwrapv -fvisibility=default
-finline-functions -fno-exceptions -fno-threadsafe-statics -fno-enforce-eh-specs
-fconserve-space -funroll-loops -fno-delete-null-pointer-checks"
++ OPTFLAGS="-Wno-unused-function -Wno-trigraphs -Wno-unused-parameter
-Wunknown-pragmas -Wno-unused-variable -fomit-frame-pointer -fwrapv -fvisibility=default
-finline-functions -fno-exceptions -fno-threadsafe-statics -fno-enforce-eh-specs
-fconserve-space -funroll-loops -fno-delete-null-pointer-checks"
+ # -O3 - crashes gcc???!!!
+ # -fpermissive
+ AC_LANG_PUSH([C])
+--- m4/flint-check.m4.orig 2018-02-15 07:02:18.000000000 -0700
++++ m4/flint-check.m4 2020-07-12 20:46:08.072325817 -0600
+@@ -69,7 +69,7 @@ for FLINT_HOME in ${FLINT_HOME_PATH}
+ [
+ AC_TRY_RUN(
+ [#include <flint/flint.h>
+- int main () { if ((int) version[0] < 2) return -1; else return 0; }
++ int main () { if (__FLINT_VERSION < 2) return -1; else return 0; }
+ ],[
+ flint_found="yes"
+ break
--- factory-4.1.1/cf_factory.h.orig 2017-12-06 10:37:14.000000000 -0700
+++ factory-4.1.1/cf_factory.h 2018-02-17 14:34:52.000000000 -0700
@@ -15,7 +15,7 @@
@@ -9,9 +31,9 @@
class InternalCF;
class CanonicalForm;
---- factory-4.1.1/cf_switches.cc 2017-12-06 12:37:11.000000000 -0500
-+++ factory-4.1.1/cf_switches.cc 2018-06-26 11:07:29.000000000 -0400
-@@ -31,6 +31,7 @@
+--- factory-4.1.1/cf_switches.cc.orig 2017-12-06 10:37:11.000000000 -0700
++++ factory-4.1.1/cf_switches.cc 2018-06-26 09:07:29.000000000 -0600
+@@ -31,6 +31,7 @@ CFSwitches::CFSwitches ()
// and set the default (recommended) On-values:
#ifdef HAVE_NTL
On(SW_USE_CHINREM_GCD);
@@ -20,7 +42,7 @@
#endif
On(SW_USE_EZGCD);
--- factory-4.1.1/configure.orig 2018-02-09 07:29:54.000000000 -0700
-+++ factory-4.1.1/configure 2018-05-15 12:28:52.454714806 -0600
++++ factory-4.1.1/configure 2020-07-12 20:19:22.755415850 -0600
@@ -5827,7 +5827,7 @@ done
## for clang: -Wunneeded-internal-declaration
@@ -30,6 +52,15 @@
# -O3 - crashes gcc???!!!
# -fpermissive
ac_ext=c
+@@ -22481,7 +22481,7 @@ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ #include <flint/flint.h>
+- int main () { if ((int) version[0] < 2) return -1; else return 0; }
++ int main () { if (__FLINT_VERSION < 2) return -1; else return 0; }
+
+ _ACEOF
+ if ac_fn_c_try_run "$LINENO"; then :
--- factory-4.1.1/ftmpl_inst.cc.orig 2017-12-06 10:37:12.000000000 -0700
+++ factory-4.1.1/ftmpl_inst.cc 2018-05-15 12:28:00.560409016 -0600
@@ -73,7 +73,7 @@ template List<Variable> Difference ( con
diff --git a/flint-20200414.patch b/flint-20200414.patch
deleted file mode 100644
index 494f4c1..0000000
--- a/flint-20200414.patch
+++ /dev/null
@@ -1,391 +0,0 @@
---- aprcl/test/t-unity_zp_reduce_cyclotomic.c
-+++ aprcl/test/t-unity_zp_reduce_cyclotomic.c
-@@ -72,6 +72,7 @@ int main(void)
- abort();
- }
-
-+ fmpz_clear(n);
- fmpz_mod_poly_clear(cyclo_poly);
- unity_zp_clear(f);
- unity_zp_clear(g);
---- fmpq_mpoly/test/t-get_set_term_coeff_fmpq.c
-+++ fmpq_mpoly/test/t-get_set_term_coeff_fmpq.c
-@@ -41,7 +41,12 @@ main(void)
-
- fmpq_mpoly_randtest_bits(f, state, len, coeff_bits, exp_bits, ctx);
- if (fmpq_mpoly_length(f, ctx) == WORD(0))
-+ {
-+ fmpq_mpoly_clear(f, ctx);
-+ fmpq_clear(c);
-+ fmpq_clear(d);
- continue;
-+ }
-
- for (j = 0; j < 10; j++)
- {
---- fmpq_mpoly/test/t-get_set_term_exp_fmpz.c
-+++ fmpq_mpoly/test/t-get_set_term_exp_fmpz.c
-@@ -43,7 +43,10 @@ main(void)
-
- fmpq_mpoly_randtest_bits(f, state, len, coeff_bits, exp_bits, ctx);
- if (fmpq_mpoly_length(f, ctx) == 0)
-+ {
-+ fmpq_mpoly_clear(f, ctx);
- continue;
-+ }
-
- for (j = 0; j < 10; j++)
- {
---- fmpz_factor/pollard_brent.c
-+++ fmpz_factor/pollard_brent.c
-@@ -143,6 +143,7 @@ fmpz_factor_pollard_brent(fmpz_t p_factor, flint_rand_t state, fmpz_t
n_in,
- fmpz_clear(fa);
- fmpz_clear(fy);
- fmpz_clear(maxa);
-+ fmpz_clear(maxy);
-
- TMP_END;
-
---- fmpz_factor/test/t-pollard_brent_single.c
-+++ fmpz_factor/test/t-pollard_brent_single.c
-@@ -94,6 +94,10 @@ int main(void)
- fmpz_clear(primeprod);
- fmpz_clear(fac);
- fmpz_clear(modval);
-+ fmpz_clear(a);
-+ fmpz_clear(y);
-+ fmpz_clear(maxa);
-+ fmpz_clear(maxy);
-
- flint_printf("PASS\n");
- return 0;
---- fmpz_mat/test/t-hnf_minors_transform.c
-+++ fmpz_mat/test/t-hnf_minors_transform.c
-@@ -87,6 +87,8 @@ main(void)
- abort();
- }
-
-+ fmpz_mat_clear(UA);
-+ fmpz_mat_clear(U);
- fmpz_mat_clear(H2);
- fmpz_mat_clear(H);
- fmpz_mat_clear(A);
---- fmpz_mod_poly/compose_mod_brent_kung_vec_preinv.c
-+++ fmpz_mod_poly/compose_mod_brent_kung_vec_preinv.c
-@@ -145,6 +145,7 @@ fmpz_mod_poly_compose_mod_brent_kung_vec_preinv(fmpz_mod_poly_struct
* res,
- {
- for (i = 0; i < n; i++)
- {
-+ fmpz_mod_poly_clear(res + i);
- fmpz_mod_poly_init(res + i, &poly->p);
- fmpz_mod_poly_zero(res + i);
- }
-@@ -156,6 +157,7 @@ fmpz_mod_poly_compose_mod_brent_kung_vec_preinv(fmpz_mod_poly_struct
* res,
- {
- for (i = 0; i < n; i++)
- {
-+ fmpz_mod_poly_clear(res + i);
- fmpz_mod_poly_init(res + i, &poly->p);
- fmpz_mod_poly_set(res + i, polys + i);
- }
---- fmpz_mod_poly/test/t-print_read.c
-+++ fmpz_mod_poly/test/t-print_read.c
-@@ -101,6 +101,9 @@ int main(void)
- }
- }
-
-+ for (j = 0; j < n; j++)
-+ fmpz_mod_poly_clear(a[j]);
-+ flint_free(a);
- fclose(out);
- exit(0);
- }
---- fmpz_mod_poly/test/t-product_roots_fmpz_vec.c
-+++ fmpz_mod_poly/test/t-product_roots_fmpz_vec.c
-@@ -80,6 +80,7 @@ main(void)
- fmpz_poly_clear(Q);
- fmpz_poly_clear(tmp);
- _fmpz_vec_clear(x, n);
-+ fmpz_clear(mod);
- }
-
- FLINT_TEST_CLEANUP(state);
---- fmpz_mpoly/test/t-get_set_term_exp_fmpz.c
-+++ fmpz_mpoly/test/t-get_set_term_exp_fmpz.c
-@@ -45,7 +45,11 @@ main(void)
-
- fmpz_mpoly_randtest_bits(f, state, len, coeff_bits, exp_bits, ctx);
- if (f->length == WORD(0))
-+ {
-+ fmpz_mpoly_clear(f, ctx);
-+ fmpz_mpoly_ctx_clear(ctx);
- continue;
-+ }
-
- for (j = 0; j < 10; j++)
- {
---- fmpz_poly/div_basecase.c
-+++ fmpz_poly/div_basecase.c
-@@ -56,6 +56,7 @@ _fmpz_poly_div_basecase(fmpz * Q, fmpz * R, const fmpz * A, slong
lenA,
- {
- if (exact && !fmpz_is_zero(R + lenA - 1))
- {
-+ fmpz_clear(r);
- if (alloc)
- _fmpz_vec_clear(R, alloc);
-
-@@ -71,8 +72,9 @@ _fmpz_poly_div_basecase(fmpz * Q, fmpz * R, const fmpz * A, slong
lenA,
-
- if (!fmpz_is_zero(r))
- {
-+ fmpz_clear(r);
- if (alloc)
-- _fmpz_vec_clear(R, alloc);
-+ _fmpz_vec_clear(R, alloc);
-
- return 0;
- }
---- fmpz_poly/div_series_divconquer.c
-+++ fmpz_poly/div_series_divconquer.c
-@@ -27,7 +27,7 @@ _fmpz_poly_div_series_divconquer(fmpz * Q, const fmpz * A, slong Alen,
- if (!_fmpz_poly_div(Q, Arev, 2*n - 1, Brev, n, 1))
- {
- _fmpz_vec_clear(Arev, 2*n - 1);
-- _fmpz_vec_clear(Brev, n - 1);
-+ _fmpz_vec_clear(Brev, n);
-
- flint_printf("Not an exact division\n");
- flint_abort();
-@@ -36,7 +36,7 @@ _fmpz_poly_div_series_divconquer(fmpz * Q, const fmpz * A, slong Alen,
- _fmpz_poly_reverse(Q, Q, n, n);
-
- _fmpz_vec_clear(Arev, 2*n - 1);
-- _fmpz_vec_clear(Brev, n - 1);
-+ _fmpz_vec_clear(Brev, n);
- }
-
- void fmpz_poly_div_series_divconquer(fmpz_poly_t Q, const fmpz_poly_t A,
---- fmpz_poly/mullow_SS_precache.c
-+++ fmpz_poly/mullow_SS_precache.c
-@@ -145,6 +145,7 @@ void _fmpz_poly_mullow_SS_precache(fmpz * output, const fmpz *
input1,
- len_out, t1, t2, s1, tt);
-
- _fmpz_vec_set_fft(output, trunc, ii, pre->limbs, 1); /* write output */
-+ flint_free(ii);
- }
-
- void
---- fq_embed_templates/test/t-composition_matrix.c
-+++ fq_embed_templates/test/t-composition_matrix.c
-@@ -39,7 +39,10 @@ main(void)
- TEMPLATE(T, ctx_randtest)(ctx, state);
- d = TEMPLATE(T, ctx_degree)(ctx);
- if (d == 1)
-+ {
-+ TEMPLATE(T, ctx_clear)(ctx);
- continue;
-+ }
- modulus = TEMPLATE(T, ctx_modulus)(ctx);
-
- TEMPLATE(T, init)(frob, ctx);
---- fq_embed_templates/test/t-embed_matrices.c
-+++ fq_embed_templates/test/t-embed_matrices.c
-@@ -86,6 +86,7 @@ main(void)
- n = m*j;
- if (m == 1) {
- i--;
-+ TEMPLATE(T, ctx_clear)(ctx1);
- continue;
- }
- modulus = TEMPLATE(T, ctx_modulus)(ctx1);
---- fq_mat_templates/charpoly_danilevsky.c
-+++ fq_mat_templates/charpoly_danilevsky.c
-@@ -189,6 +189,8 @@ TEMPLATE(T, mat_charpoly_danilevsky) (TEMPLATE(T, poly_t) p,
-
- cleanup:
-
-+ TEMPLATE(T, clear) (c, ctx);
-+ TEMPLATE(T, clear) (h, ctx);
- TEMPLATE(T, poly_clear) (b, ctx);
- _TEMPLATE(T, vec_clear) (T, A->r, ctx);
- _TEMPLATE(T, vec_clear) (V, A->r, ctx);
---- fq_mat_templates/lu_classical.c
-+++ fq_mat_templates/lu_classical.c
-@@ -76,7 +76,10 @@ TEMPLATE(T, mat_lu_classical) (slong * P,
- if (TEMPLATE(T, mat_pivot) (A, P, row, col, ctx) == 0)
- {
- if (rank_check)
-- return 0;
-+ {
-+ rank = 0;
-+ goto cleanup;
-+ }
- col++;
- continue;
- }
-@@ -105,6 +108,7 @@ TEMPLATE(T, mat_lu_classical) (slong * P,
- col++;
- }
-
-+cleanup:
- TEMPLATE(T, clear) (d, ctx);
- TEMPLATE(T, clear) (e, ctx);
- TEMPLATE(T, clear) (neg_e, ctx);
---- fq_templates/test/t-multiplicative_order.c
-+++ fq_templates/test/t-multiplicative_order.c
-@@ -71,24 +71,24 @@ main(void)
- fmpz_init(pm1);
-
- TEMPLATE(T, gen)(X, ctx);
-- if (!TEMPLATE(T, is_primitive)(X, ctx))
-- continue;
--
-- fmpz_sub_ui(pm1, TEMPLATE(T, ctx_prime)(ctx), 1);
-- TEMPLATE(T, pow)(a, X, pm1, ctx);
-- result = TEMPLATE(T, multiplicative_order)(ord, a, ctx);
-- fmpz_mul(ord, ord, pm1);
--
-- TEMPLATE(T, ctx_order)(size, ctx);
-- fmpz_sub(size, size, ord);
--
-- if (result && !fmpz_is_one(size))
-+ if (TEMPLATE(T, is_primitive)(X, ctx))
- {
-- flint_printf("FAIL:\n\n");
-- flint_printf("a = "), TEMPLATE(T, print_pretty)(a, ctx),
flint_printf("\n");
-- flint_printf("ord = "), fmpz_print(ord),
flint_printf("\n");
-- TEMPLATE(T, ctx_print)(ctx);
-- abort();
-+ fmpz_sub_ui(pm1, TEMPLATE(T, ctx_prime)(ctx), 1);
-+ TEMPLATE(T, pow)(a, X, pm1, ctx);
-+ result = TEMPLATE(T, multiplicative_order)(ord, a, ctx);
-+ fmpz_mul(ord, ord, pm1);
-+
-+ TEMPLATE(T, ctx_order)(size, ctx);
-+ fmpz_sub(size, size, ord);
-+
-+ if (result && !fmpz_is_one(size))
-+ {
-+ flint_printf("FAIL:\n\n");
-+ flint_printf("a = "), TEMPLATE(T, print_pretty)(a, ctx),
flint_printf("\n");
-+ flint_printf("ord = "), fmpz_print(ord),
flint_printf("\n");
-+ TEMPLATE(T, ctx_print)(ctx);
-+ abort();
-+ }
- }
-
- fmpz_clear(pm1);
---- mpn_extras/test/t-mulmod_preinvn.c
-+++ mpn_extras/test/t-mulmod_preinvn.c
-@@ -74,6 +74,11 @@ int main(void)
- while (size_d && r2->_mp_d[size_d - 1] == 0) size_d--;
- r2->_mp_size = size_d;
- r2->_mp_alloc = size_d;
-+ if (size_d == 0)
-+ {
-+ flint_free(r2->_mp_d);
-+ r2->_mp_d = NULL;
-+ }
-
- mpz_div_2exp(r2, r2, norm);
- mpz_div_2exp(a, a, norm);
-@@ -93,7 +98,8 @@ int main(void)
- abort();
- }
-
-- flint_free(r2->_mp_d);
-+ if (r2->_mp_d != NULL)
-+ flint_free(r2->_mp_d);
- flint_free(dinv);
- }
-
---- nmod_mpoly/test/t-mul_array.c
-+++ nmod_mpoly/test/t-mul_array.c
-@@ -77,6 +77,8 @@ main(void)
- nmod_mpoly_clear(g, ctx);
- nmod_mpoly_clear(h, ctx);
- nmod_mpoly_clear(k, ctx);
-+
-+ nmod_mpoly_ctx_clear(ctx);
- }
-
- /* Check aliasing first argument */
-@@ -129,6 +131,8 @@ main(void)
- nmod_mpoly_clear(f, ctx);
- nmod_mpoly_clear(g, ctx);
- nmod_mpoly_clear(h, ctx);
-+
-+ nmod_mpoly_ctx_clear(ctx);
- }
-
- /* Check aliasing second argument */
-@@ -181,6 +185,8 @@ main(void)
- nmod_mpoly_clear(f, ctx);
- nmod_mpoly_clear(g, ctx);
- nmod_mpoly_clear(h, ctx);
-+
-+ nmod_mpoly_ctx_clear(ctx);
- }
-
- FLINT_TEST_CLEANUP(state);
---- qsieve/test/t-primes_init.c
-+++ qsieve/test/t-primes_init.c
-@@ -52,12 +52,12 @@ int main(void)
-
- fmpz_randtest_unsigned(n, state, 130);
-
-- if (fmpz_is_zero(n) || fmpz_is_one(n)) continue;
-+ if (fmpz_is_zero(n) || fmpz_is_one(n)) goto cleanup;
-
- qsieve_init(qs_inf, n);
- small_factor = qsieve_knuth_schroeppel(qs_inf);
-
-- if (small_factor) continue;
-+ if (small_factor) goto cleanup;
-
- fmpz_mul_ui(qs_inf->kn, qs_inf->n, qs_inf->k); /*
haven't calculated earlier */
- small_factor = qsieve_primes_init(qs_inf);
-@@ -73,7 +73,7 @@ int main(void)
- flint_printf("\n");
- abort();
- }
-- else continue;
-+ else goto cleanup;
- }
-
- for (j = 3; j < qs_inf->num_primes; j++)
-@@ -120,7 +120,7 @@ int main(void)
- flint_printf("\n");
- abort();
- }
-- else continue;
-+ else goto cleanup;
- }
-
- for (j = k; j < qs_inf->num_primes; j++)
-@@ -164,7 +164,7 @@ int main(void)
- flint_printf("\n");
- abort();
- }
-- else continue;
-+ else goto cleanup;
- }
-
- for (j = k; j < qs_inf->num_primes; j++)
-@@ -208,7 +208,7 @@ int main(void)
- flint_printf("\n");
- abort();
- }
-- else continue;
-+ else goto cleanup;
- }
-
- for (j = k; j < qs_inf->num_primes; j++)
-@@ -239,6 +239,7 @@ int main(void)
- }
- }
-
-+cleanup:
- qsieve_clear(qs_inf);
- fmpz_clear(n);
- fmpz_clear(x);
diff --git a/linbox-1.6.3.patch b/linbox-1.6.3.patch
new file mode 100644
index 0000000..f2481c0
--- /dev/null
+++ b/linbox-1.6.3.patch
@@ -0,0 +1,35 @@
+--- linbox-1.6.3/configure.ac.orig 2019-06-07 07:22:08.000000000 -0600
++++ linbox-1.6.3/configure.ac 2020-06-05 12:24:32.920910975 -0600
+@@ -65,9 +65,8 @@ AC_PROG_CXX
+
+ AC_COMPILER_NAME
+
+-STDFLAG=${CXXFLAGS}
++STDFLAG=""
+
+-CXXFLAGS=""
+
+ # We need a C++11 compiler now - AB 2014-12-12
+ # clang-3.8 does not support __float128 without explicitly passing it -std=c++11
+@@ -187,10 +186,6 @@ echo "----------------------------------
+ echo " START LINBOX CONFIG "
+ echo "-----------------------------------------------"
+
+-# Checks which SIMD optimization flags to use and set SIMD_CFLAGS accordingly
+-INSTR_SET
+-AC_SUBST(SIMD_FLAGS)
+-
+ dnl gcc-4.9.2 bug See
https://trac.sagemath.org/ticket/17635#comment:178
+ AS_IF([ test "x$CCNAM" = "xgcc492" ],[CXXFLAGS="${CXXFLAGS}
-fpermissive"],[])
+
+--- linbox-1.6.3/linbox/algorithms/gauss/gauss-solve-gf2.inl.orig 2019-06-07
07:22:08.000000000 -0600
++++ linbox-1.6.3/linbox/algorithms/gauss/gauss-solve-gf2.inl 2020-02-01
16:19:20.692143829 -0700
+@@ -72,7 +72,7 @@ namespace LinBox
+
+ Vector1 w(F2, A.coldim());
+
+- for(typename Vector1::iterator it=w.begin()+(ptrdiff_t)Rank;it!=w.end();++it)
++ for(typename Vector1::iterator it=w.begin()+(long)Rank;it!=w.end();++it)
+ F2.assign(*it,F2.zero);
+
+ return this->solve(x, w, Rank, Q, L, A, P, b);
diff --git a/mathicgb-1.0.patch b/mathicgb-1.0.patch
index a92d072..bcadb6a 100644
--- a/mathicgb-1.0.patch
+++ b/mathicgb-1.0.patch
@@ -1,43 +1,42 @@
---- src/mathicgb/MonoMonoid.hpp.orig 2018-11-23 16:20:05.000000000 -0700
-+++ src/mathicgb/MonoMonoid.hpp 2020-02-12 13:29:57.348568082 -0700
-@@ -18,6 +18,18 @@
- #include <cctype>
- #include <mathic.h>
-
-+#ifdef _MSC_VER
-+// So far as I am aware, Windows runs on little endian CPUs only
-+#define le64toh(x) (x)
-+#elif defined(__APPLE__)
-+#include <libkern/OSByteOrder.h>
-+#define le64toh(x) OSSwapLittleToHostInt64(x)
-+#elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) ||
defined(__OpenBSD__)
-+#include <sys/endian.h>
-+#else
-+#include <endian.h>
-+#endif
-+
- MATHICGB_NAMESPACE_BEGIN
-
- /// Implements the monoid of (monic) monomials with integer
-@@ -589,6 +601,9 @@ public:
+--- src/mathicgb/MonoMonoid.hpp.orig 2017-06-06 10:08:53.000000000 -0600
++++ src/mathicgb/MonoMonoid.hpp 2018-10-06 16:57:04.776068625 -0600
+@@ -582,6 +582,7 @@ public:
+ MATHICGB_ASSERT(i == varCount() / 2 || access(a, i*2+1) >= 0);
+
+ uint64 A, B, AB;
++#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ // We have to use std::memcpy here because just casting to a int64 breaks
+ // the strict aliasing rule which implies undefined behavior. Both MSVC and
+ // gcc don't actually call memcpy here. MSVC is a tiny bit slower for this
+@@ -589,6 +590,11 @@ public:
std::memcpy(&A, ptr(a, i*2), 8);
std::memcpy(&B, ptr(b, i*2), 8);
std::memcpy(&AB, ptr(ab, i*2), 8);
-+ A = le64toh(A);
-+ B = le64toh(B);
-+ AB = le64toh(AB);
++#else
++ A = *ptr(a, i*2) | (((uint64)*ptr(a, i*2 + 1)) << 32);
++ B = *ptr(b, i*2) | (((uint64)*ptr(b, i*2 + 1)) << 32);
++ AB = *ptr(ab, i*2) | (((uint64)*ptr(ab, i*2 + 1)) << 32);
++#endif
orOfXor |= AB ^ (A + B);
}
MATHICGB_ASSERT((orOfXor == 0) == isProductOf(a, b, ab));
-@@ -613,6 +628,11 @@ public:
+@@ -608,11 +614,19 @@ public:
+ uint64 orOfXor = 0;
+ for (VarIndex i = varCount() / 2; i != beforeEntriesIndexBegin(); --i) {
+ uint64 A1, A2, B, A1B, A2B;
++#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ std::memcpy(&A1, ptr(a1, i*2), 8);
+ std::memcpy(&A2, ptr(a2, i*2), 8);
std::memcpy(&B, ptr(b, i*2), 8);
std::memcpy(&A1B, ptr(a1b, i*2), 8);
std::memcpy(&A2B, ptr(a2b, i*2), 8);
-+ A1 = le64toh(A1);
-+ A2 = le64toh(A2);
-+ B = le64toh(B);
-+ A1B = le64toh(A1B);
-+ A2B = le64toh(A2B);
++#else
++ A1 = *ptr(a1, i*2) | (((uint64)*ptr(a1, i*2 + 1)) << 32);
++ A2 = *ptr(a2, i*2) | (((uint64)*ptr(a2, i*2 + 1)) << 32);
++ B = *ptr(b, i*2) | (((uint64)*ptr(b, i*2 + 1)) << 32);
++ A1B = *ptr(a1b, i*2) | (((uint64)*ptr(a1b, i*2 + 1)) << 32);
++ A2B = *ptr(a2b, i*2) | (((uint64)*ptr(a2b, i*2 + 1)) << 32);
++#endif
orOfXor |= (A1B ^ (A1 + B)) | (A2B ^ (A2 + B));
}
MATHICGB_ASSERT
diff --git a/mpfr-4.0.2.patch b/mpfr-4.0.2.patch
deleted file mode 100644
index 15d7526..0000000
--- a/mpfr-4.0.2.patch
+++ /dev/null
@@ -1,1614 +0,0 @@
---- mpfr-4.0.2/PATCHES 2019-06-02 17:05:36.121226916 +0000
-+++ mpfr-4.0.2/PATCHES 2019-06-02 17:05:36.157226621 +0000
-@@ -0,0 +1 @@
-+include-float
---- mpfr-4.0.2/VERSION 2019-01-31 20:29:48.000000000 +0000
-+++ mpfr-4.0.2/VERSION 2019-06-02 17:05:36.157226621 +0000
-@@ -1 +1 @@
--4.0.2
-+4.0.2-p1
---- mpfr-4.0.2/src/mpfr-impl.h 2019-01-27 18:30:16.000000000 +0000
-+++ mpfr-4.0.2/src/mpfr-impl.h 2019-06-02 17:05:36.145226719 +0000
-@@ -57,6 +57,7 @@
-
- #include <stdlib.h>
- #include <limits.h>
-+#include <float.h> /* for FLT_RADIX, etc., tested below */
-
-
- /******************************************************
---- mpfr-4.0.2/src/mpfr.h 2019-01-31 20:29:48.000000000 +0000
-+++ mpfr-4.0.2/src/mpfr.h 2019-06-02 17:05:36.153226653 +0000
-@@ -27,7 +27,7 @@
- #define MPFR_VERSION_MAJOR 4
- #define MPFR_VERSION_MINOR 0
- #define MPFR_VERSION_PATCHLEVEL 2
--#define MPFR_VERSION_STRING "4.0.2"
-+#define MPFR_VERSION_STRING "4.0.2-p1"
-
- /* User macros:
- MPFR_USE_FILE: Define it to make MPFR define functions dealing
---- mpfr-4.0.2/src/version.c 2019-01-31 20:29:48.000000000 +0000
-+++ mpfr-4.0.2/src/version.c 2019-06-02 17:05:36.153226653 +0000
-@@ -25,5 +25,5 @@
- const char *
- mpfr_get_version (void)
- {
-- return "4.0.2";
-+ return "4.0.2-p1";
- }
---- mpfr-4.0.2/PATCHES 2020-03-30 13:02:08.103248669 +0000
-+++ mpfr-4.0.2/PATCHES 2020-03-30 13:02:08.143248189 +0000
-@@ -0,0 +1 @@
-+int-overflow
---- mpfr-4.0.2/VERSION 2019-06-02 17:05:36.157226621 +0000
-+++ mpfr-4.0.2/VERSION 2020-03-30 13:02:08.143248189 +0000
-@@ -1 +1 @@
--4.0.2-p1
-+4.0.2-p2
---- mpfr-4.0.2/src/agm.c 2019-01-07 13:53:20.000000000 +0000
-+++ mpfr-4.0.2/src/agm.c 2020-03-30 13:02:08.131248333 +0000
-@@ -220,7 +220,7 @@
- mpfr_add (vf, u, v, MPFR_RNDN); /* No overflow? */
- mpfr_div_2ui (vf, vf, 1, MPFR_RNDN);
- /* See proof in algorithms.tex */
-- if (4*eq > p)
-+ if (eq > p / 4)
- {
- mpfr_t w;
- MPFR_BLOCK_DECL (flags3);
---- mpfr-4.0.2/src/mpfr.h 2019-06-02 17:05:36.153226653 +0000
-+++ mpfr-4.0.2/src/mpfr.h 2020-03-30 13:02:08.143248189 +0000
-@@ -27,7 +27,7 @@
- #define MPFR_VERSION_MAJOR 4
- #define MPFR_VERSION_MINOR 0
- #define MPFR_VERSION_PATCHLEVEL 2
--#define MPFR_VERSION_STRING "4.0.2-p1"
-+#define MPFR_VERSION_STRING "4.0.2-p2"
-
- /* User macros:
- MPFR_USE_FILE: Define it to make MPFR define functions dealing
---- mpfr-4.0.2/src/pow.c 2019-01-07 13:53:20.000000000 +0000
-+++ mpfr-4.0.2/src/pow.c 2020-03-30 13:02:08.131248333 +0000
-@@ -34,8 +34,7 @@
- mpfr_rnd_t rnd_mode, int *inexact)
- {
- mpz_t a, c;
-- mpfr_exp_t d, b;
-- unsigned long i;
-+ mpfr_exp_t d, b, i;
- int res;
-
- MPFR_ASSERTD (!MPFR_IS_SINGULAR (y));
-@@ -48,7 +47,9 @@
- if (MPFR_IS_NEG (y))
- return 0; /* x is not a power of two => x^-y is not exact */
-
-- /* compute d such that y = c*2^d with c odd integer */
-+ /* Compute d such that y = c*2^d with c odd integer.
-+ Since c comes from a regular MPFR number, due to the constraints on the
-+ exponent and the precision, there can be no integer overflow below. */
- mpz_init (c);
- d = mpfr_get_z_2exp (c, y);
- i = mpz_scan1 (c, 0);
-@@ -58,7 +59,9 @@
- /* Since y is not an integer, d is necessarily < 0 */
- MPFR_ASSERTD (d < 0);
-
-- /* Compute a,b such that x=a*2^b */
-+ /* Compute a,b such that x=a*2^b.
-+ Since a comes from a regular MPFR number, due to the constrainst on the
-+ exponent and the precision, there can be no integer overflow below. */
- mpz_init (a);
- b = mpfr_get_z_2exp (a, x);
- i = mpz_scan1 (a, 0);
---- mpfr-4.0.2/src/rem1.c 2019-01-07 13:53:20.000000000 +0000
-+++ mpfr-4.0.2/src/rem1.c 2020-03-30 13:02:08.131248333 +0000
-@@ -100,9 +100,11 @@
- mpz_abs (my, my);
- q_is_odd = 0;
-
-- /* divide my by 2^k if possible to make operations mod my easier */
-+ /* Divide my by 2^k if possible to make operations mod my easier.
-+ Since my comes from a regular MPFR number, due to the constraints on the
-+ exponent and the precision, there can be no integer overflow below. */
- {
-- unsigned long k = mpz_scan1 (my, 0);
-+ mpfr_exp_t k = mpz_scan1 (my, 0);
- ey += k;
- mpz_fdiv_q_2exp (my, my, k);
- }
---- mpfr-4.0.2/src/version.c 2019-06-02 17:05:36.153226653 +0000
-+++ mpfr-4.0.2/src/version.c 2020-03-30 13:02:08.143248189 +0000
-@@ -25,5 +25,5 @@
- const char *
- mpfr_get_version (void)
- {
-- return "4.0.2-p1";
-+ return "4.0.2-p2";
- }
---- mpfr-4.0.2/PATCHES 2020-03-30 13:05:16.224990169 +0000
-+++ mpfr-4.0.2/PATCHES 2020-03-30 13:05:16.264989689 +0000
-@@ -0,0 +1 @@
-+set-int
---- mpfr-4.0.2/VERSION 2020-03-30 13:02:08.143248189 +0000
-+++ mpfr-4.0.2/VERSION 2020-03-30 13:05:16.264989689 +0000
-@@ -1 +1 @@
--4.0.2-p2
-+4.0.2-p3
---- mpfr-4.0.2/src/mpfr.h 2020-03-30 13:02:08.143248189 +0000
-+++ mpfr-4.0.2/src/mpfr.h 2020-03-30 13:05:16.260989737 +0000
-@@ -27,7 +27,7 @@
- #define MPFR_VERSION_MAJOR 4
- #define MPFR_VERSION_MINOR 0
- #define MPFR_VERSION_PATCHLEVEL 2
--#define MPFR_VERSION_STRING "4.0.2-p2"
-+#define MPFR_VERSION_STRING "4.0.2-p3"
-
- /* User macros:
- MPFR_USE_FILE: Define it to make MPFR define functions dealing
---- mpfr-4.0.2/src/set_si_2exp.c 2019-01-07 13:53:20.000000000 +0000
-+++ mpfr-4.0.2/src/set_si_2exp.c 2020-03-30 13:05:16.248989881 +0000
-@@ -40,6 +40,15 @@
- mp_limb_t ai, *xp;
- int inex = 0;
-
-+ /* Early underflow/overflow checking is necessary to avoid
-+ integer overflow or errors due to special exponent values. */
-+ if (MPFR_UNLIKELY (e < __gmpfr_emin - (mpfr_exp_t)
-+ (sizeof (unsigned long) * CHAR_BIT + 1)))
-+ return mpfr_underflow (x, rnd_mode == MPFR_RNDN ?
-+ MPFR_RNDZ : rnd_mode, i < 0 ? -1 : 1);
-+ if (MPFR_UNLIKELY (e >= __gmpfr_emax))
-+ return mpfr_overflow (x, rnd_mode, i < 0 ? -1 : 1);
-+
- /* FIXME: support int limbs (e.g. 16-bit limbs on 16-bit proc) */
- ai = SAFE_ABS (unsigned long, i);
- MPFR_ASSERTN (SAFE_ABS (unsigned long, i) == ai);
---- mpfr-4.0.2/src/set_ui_2exp.c 2019-01-07 13:53:20.000000000 +0000
-+++ mpfr-4.0.2/src/set_ui_2exp.c 2020-03-30 13:05:16.248989881 +0000
-@@ -41,6 +41,15 @@
- mp_limb_t *xp;
- int inex = 0;
-
-+ /* Early underflow/overflow checking is necessary to avoid
-+ integer overflow or errors due to special exponent values. */
-+ if (MPFR_UNLIKELY (e < __gmpfr_emin - (mpfr_exp_t)
-+ (sizeof (unsigned long) * CHAR_BIT + 1)))
-+ return mpfr_underflow (x, rnd_mode == MPFR_RNDN ?
-+ MPFR_RNDZ : rnd_mode, i < 0 ? -1 : 1);
-+ if (MPFR_UNLIKELY (e >= __gmpfr_emax))
-+ return mpfr_overflow (x, rnd_mode, i < 0 ? -1 : 1);
-+
- /* FIXME: support int limbs (e.g. 16-bit limbs on 16-bit proc) */
- MPFR_ASSERTD (i == (mp_limb_t) i);
-
---- mpfr-4.0.2/src/set_uj.c 2019-01-07 13:53:20.000000000 +0000
-+++ mpfr-4.0.2/src/set_uj.c 2020-03-30 13:05:16.248989881 +0000
-@@ -41,7 +41,7 @@
- int
- mpfr_set_uj_2exp (mpfr_t x, uintmax_t j, intmax_t e, mpfr_rnd_t rnd)
- {
-- int cnt;
-+ int cnt, inex;
- mp_size_t i, k;
- mp_limb_t limb;
- mp_limb_t yp[uintmaxpml];
-@@ -57,6 +57,10 @@
- MPFR_RET(0);
- }
-
-+ /* early overflow detection to avoid a possible integer overflow below */
-+ if (MPFR_UNLIKELY(e >= __gmpfr_emax))
-+ return mpfr_overflow (x, rnd, MPFR_SIGN_POS);
-+
- MPFR_ASSERTN (sizeof(uintmax_t) % sizeof(mp_limb_t) == 0);
-
- /* Create an auxiliary var */
-@@ -107,7 +111,9 @@
- e += k * GMP_NUMB_BITS - cnt; /* Update Expo */
- MPFR_ASSERTD (MPFR_LIMB_MSB(yp[numberof (yp) - 1]) != 0);
-
-- /* Check expo underflow / overflow (can't use mpfr_check_range) */
-+ MPFR_RNDRAW (inex, x, yp, uintmax_bit_size, rnd, MPFR_SIGN_POS, e++);
-+
-+ /* Check expo underflow / overflow */
- if (MPFR_UNLIKELY(e < __gmpfr_emin))
- {
- /* The following test is necessary because in the rounding to the
-@@ -116,16 +122,18 @@
- * _ |x| < 2^(emin-2), or
- * _ |x| = 2^(emin-2) and the absolute value of the exact
- * result is <= 2^(emin-2). */
-- if (rnd == MPFR_RNDN && (e+1 < __gmpfr_emin || mpfr_powerof2_raw(y)))
-+ if (rnd == MPFR_RNDN &&
-+ (e + 1 < __gmpfr_emin ||
-+ (mpfr_powerof2_raw (x) && inex >= 0)))
- rnd = MPFR_RNDZ;
- return mpfr_underflow (x, rnd, MPFR_SIGN_POS);
- }
- if (MPFR_UNLIKELY(e > __gmpfr_emax))
- return mpfr_overflow (x, rnd, MPFR_SIGN_POS);
-- MPFR_SET_EXP (y, e);
-
-- /* Final: set x to y (rounding if necessary) */
-- return mpfr_set (x, y, rnd);
-+ MPFR_SET_SIGN (x, MPFR_SIGN_POS);
-+ MPFR_SET_EXP (x, e);
-+ MPFR_RET (inex);
- }
-
- #endif
---- mpfr-4.0.2/src/version.c 2020-03-30 13:02:08.143248189 +0000
-+++ mpfr-4.0.2/src/version.c 2020-03-30 13:05:16.264989689 +0000
-@@ -25,5 +25,5 @@
- const char *
- mpfr_get_version (void)
- {
-- return "4.0.2-p2";
-+ return "4.0.2-p3";
- }
---- mpfr-4.0.2/tests/tset_si.c 2019-01-07 13:53:20.000000000 +0000
-+++ mpfr-4.0.2/tests/tset_si.c 2020-03-30 13:05:16.248989881 +0000
-@@ -90,6 +90,135 @@
- mpfr_clear (x);
- }
-
-+#define REXP 1024
-+
-+static void
-+test_2exp_extreme_aux (void)
-+{
-+ mpfr_t x1, x2, y;
-+ mpfr_exp_t e, ep[1 + 8 * 5], eb[] =
-+ { MPFR_EMIN_MIN, -REXP, REXP, MPFR_EMAX_MAX, MPFR_EXP_MAX };
-+ mpfr_flags_t flags1, flags2;
-+ int i, j, rnd, inex1, inex2;
-+ char s;
-+
-+ ep[0] = MPFR_EXP_MIN;
-+ for (i = 0; i < numberof(eb); i++)
-+ for (j = 0; j < 8; j++)
-+ ep[1 + 8 * i + j] = eb[i] - j;
-+
-+ mpfr_inits2 (3, x1, x2, (mpfr_ptr) 0);
-+ mpfr_init2 (y, 32);
-+
-+ for (i = 0; i < numberof(ep); i++)
-+ for (j = -31; j <= 31; j++)
-+ RND_LOOP_NO_RNDF (rnd)
-+ {
-+ int sign = j < 0 ? -1 : 1;
-+
-+ /* Compute the expected value, inex and flags */
-+ inex1 = mpfr_set_si (y, j, MPFR_RNDN);
-+ MPFR_ASSERTN (inex1 == 0);
-+ inex1 = mpfr_set (x1, y, (mpfr_rnd_t) rnd);
-+ /* x1 is the rounded value and inex1 the ternary value,
-+ assuming that the exponent argument is 0 (this is the
-+ rounded significand of the final result, assuming an
-+ unbounded exponent range). The multiplication by a
-+ power of 2 is exact, unless underflow/overflow occurs.
-+ The tests on the exponent below avoid integer overflows
-+ (ep[i] may take extreme values). */
-+ e = mpfr_get_exp (x1);
-+ mpfr_clear_flags ();
-+ if (j != 0 && ep[i] < __gmpfr_emin - e) /* underflow */
-+ {
-+ mpfr_rnd_t r =
-+ (rnd == MPFR_RNDN &&
-+ (ep[i] < __gmpfr_emin - mpfr_get_exp (y) - 1 ||
-+ IS_POW2 (sign * j))) ?
-+ MPFR_RNDZ : (mpfr_rnd_t) rnd;
-+ inex1 = mpfr_underflow (x1, r, sign);
-+ flags1 = __gmpfr_flags;
-+ }
-+ else if (j != 0 && ep[i] > __gmpfr_emax - e) /* overflow */
-+ {
-+ inex1 = mpfr_overflow (x1, (mpfr_rnd_t) rnd, sign);
-+ flags1 = __gmpfr_flags;
-+ }
-+ else
-+ {
-+ if (j != 0)
-+ mpfr_set_exp (x1, ep[i] + e);
-+ flags1 = inex1 != 0 ? MPFR_FLAGS_INEXACT : 0;
-+ }
-+
-+ /* Test mpfr_set_si_2exp */
-+ mpfr_clear_flags ();
-+ inex2 = mpfr_set_si_2exp (x2, j, ep[i], (mpfr_rnd_t) rnd);
-+ flags2 = __gmpfr_flags;
-+
-+ if (! (flags1 == flags2 && SAME_SIGN (inex1, inex2) &&
-+ mpfr_equal_p (x1, x2)))
-+ {
-+ s = 's';
-+ goto err_extreme;
-+ }
-+
-+ if (j < 0)
-+ continue;
-+
-+ /* Test mpfr_set_ui_2exp */
-+ mpfr_clear_flags ();
-+ inex2 = mpfr_set_ui_2exp (x2, j, ep[i], (mpfr_rnd_t) rnd);
-+ flags2 = __gmpfr_flags;
-+
-+ if (! (flags1 == flags2 && SAME_SIGN (inex1, inex2) &&
-+ mpfr_equal_p (x1, x2)))
-+ {
-+ s = 'u';
-+ err_extreme:
-+ printf ("Error in extreme mpfr_set_%ci_2exp for i=%d j=%d
%s\n",
-+ s, i, j, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd));
-+ printf ("emin=%" MPFR_EXP_FSPEC "d "
-+ "emax=%" MPFR_EXP_FSPEC "d\n",
-+ (mpfr_eexp_t) __gmpfr_emin,
-+ (mpfr_eexp_t) __gmpfr_emax);
-+ printf ("ep[%d] = %" MPFR_EXP_FSPEC "d\n",
-+ i, (mpfr_eexp_t) ep[i]);
-+ printf ("Expected ");
-+ mpfr_dump (x1);
-+ printf ("with inex = %d and flags =", inex1);
-+ flags_out (flags1);
-+ printf ("Got ");
-+ mpfr_dump (x2);
-+ printf ("with inex = %d and flags =", inex2);
-+ flags_out (flags2);
-+ exit (1);
-+ }
-+ }
-+
-+ mpfr_clears (x1, x2, y, (mpfr_ptr) 0);
-+}
-+
-+static void
-+test_2exp_extreme (void)
-+{
-+ mpfr_exp_t emin, emax;
-+
-+ emin = mpfr_get_emin ();
-+ emax = mpfr_get_emax ();
-+
-+ set_emin (MPFR_EMIN_MIN);
-+ set_emax (MPFR_EMAX_MAX);
-+ test_2exp_extreme_aux ();
-+
-+ set_emin (-REXP);
-+ set_emax (REXP);
-+ test_2exp_extreme_aux ();
-+
-+ set_emin (emin);
-+ set_emax (emax);
-+}
-+
- static void
- test_macros (void)
- {
-@@ -639,6 +768,7 @@
- mpfr_clear (x);
-
- test_2exp ();
-+ test_2exp_extreme ();
- test_macros ();
- test_macros_keyword ();
- test_get_ui_smallneg ();
---- mpfr-4.0.2/tests/tset_sj.c 2019-01-07 13:53:20.000000000 +0000
-+++ mpfr-4.0.2/tests/tset_sj.c 2020-03-30 13:05:16.248989881 +0000
-@@ -176,6 +176,154 @@
- mpfr_clear (x);
- }
-
-+#define REXP 1024
-+
-+static void
-+test_2exp_extreme_aux (void)
-+{
-+ mpfr_t x1, x2, y;
-+ mpfr_exp_t e, ep[1 + 8 * 5], eb[] =
-+ { MPFR_EMIN_MIN, -REXP, REXP, MPFR_EMAX_MAX, MPFR_EXP_MAX };
-+ mpfr_flags_t flags1, flags2;
-+ int i, j, rnd, inex1, inex2;
-+ char s;
-+
-+ ep[0] = MPFR_EXP_MIN;
-+ for (i = 0; i < numberof(eb); i++)
-+ for (j = 0; j < 8; j++)
-+ ep[1 + 8 * i + j] = eb[i] - j;
-+
-+ mpfr_inits2 (3, x1, x2, (mpfr_ptr) 0);
-+ mpfr_init2 (y, 32);
-+
-+ /* The cast to int is needed if numberof(ep) is of unsigned type, in
-+ which case the condition without the cast would be always false. */
-+ for (i = -2; i < (int) numberof(ep); i++)
-+ for (j = -31; j <= 31; j++)
-+ RND_LOOP_NO_RNDF (rnd)
-+ {
-+ int sign = j < 0 ? -1 : 1;
-+ intmax_t em;
-+
-+ if (i < 0)
-+ {
-+ em = i == -2 ? INTMAX_MIN : INTMAX_MAX;
-+ mpfr_clear_flags ();
-+ inex1 = j == 0 ?
-+ (mpfr_set_zero (x1, +1), 0) : i == -2 ?
-+ mpfr_underflow (x1, rnd == MPFR_RNDN ?
-+ MPFR_RNDZ : (mpfr_rnd_t) rnd, sign) :
-+ mpfr_overflow (x1, (mpfr_rnd_t) rnd, sign);
-+ flags1 = __gmpfr_flags;
-+ }
-+ else
-+ {
-+ em = ep[i];
-+ /* Compute the expected value, inex and flags */
-+ inex1 = mpfr_set_si (y, j, MPFR_RNDN);
-+ MPFR_ASSERTN (inex1 == 0);
-+ inex1 = mpfr_set (x1, y, (mpfr_rnd_t) rnd);
-+ /* x1 is the rounded value and inex1 the ternary value,
-+ assuming that the exponent argument is 0 (this is the
-+ rounded significand of the final result, assuming an
-+ unbounded exponent range). The multiplication by a
-+ power of 2 is exact, unless underflow/overflow occurs.
-+ The tests on the exponent below avoid integer overflows
-+ (ep[i] may take extreme values). */
-+ e = mpfr_get_exp (x1);
-+ mpfr_clear_flags ();
-+ if (j != 0 && ep[i] < __gmpfr_emin - e) /* underflow */
-+ {
-+ mpfr_rnd_t r =
-+ (rnd == MPFR_RNDN &&
-+ (ep[i] < __gmpfr_emin - mpfr_get_exp (y) - 1 ||
-+ IS_POW2 (sign * j))) ?
-+ MPFR_RNDZ : (mpfr_rnd_t) rnd;
-+ inex1 = mpfr_underflow (x1, r, sign);
-+ flags1 = __gmpfr_flags;
-+ }
-+ else if (j != 0 && ep[i] > __gmpfr_emax - e) /* overflow */
-+ {
-+ inex1 = mpfr_overflow (x1, (mpfr_rnd_t) rnd, sign);
-+ flags1 = __gmpfr_flags;
-+ }
-+ else
-+ {
-+ if (j != 0)
-+ mpfr_set_exp (x1, ep[i] + e);
-+ flags1 = inex1 != 0 ? MPFR_FLAGS_INEXACT : 0;
-+ }
-+ }
-+
-+ /* Test mpfr_set_sj_2exp */
-+ mpfr_clear_flags ();
-+ inex2 = mpfr_set_sj_2exp (x2, j, em, (mpfr_rnd_t) rnd);
-+ flags2 = __gmpfr_flags;
-+
-+ if (! (flags1 == flags2 && SAME_SIGN (inex1, inex2) &&
-+ mpfr_equal_p (x1, x2)))
-+ {
-+ s = 's';
-+ goto err_extreme;
-+ }
-+
-+ if (j < 0)
-+ continue;
-+
-+ /* Test mpfr_set_uj_2exp */
-+ mpfr_clear_flags ();
-+ inex2 = mpfr_set_uj_2exp (x2, j, em, (mpfr_rnd_t) rnd);
-+ flags2 = __gmpfr_flags;
-+
-+ if (! (flags1 == flags2 && SAME_SIGN (inex1, inex2) &&
-+ mpfr_equal_p (x1, x2)))
-+ {
-+ s = 'u';
-+ err_extreme:
-+ printf ("Error in extreme mpfr_set_%cj_2exp for i=%d j=%d
%s\n",
-+ s, i, j, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd));
-+ printf ("emin=%" MPFR_EXP_FSPEC "d "
-+ "emax=%" MPFR_EXP_FSPEC "d\n",
-+ (mpfr_eexp_t) __gmpfr_emin,
-+ (mpfr_eexp_t) __gmpfr_emax);
-+#ifdef MPFR_PRINTF_MAXLM
-+ printf ("e = %" MPFR_PRINTF_MAXLM "d\n", em);
-+#endif
-+ printf ("Expected ");
-+ mpfr_dump (x1);
-+ printf ("with inex = %d and flags =", inex1);
-+ flags_out (flags1);
-+ printf ("Got ");
-+ mpfr_dump (x2);
-+ printf ("with inex = %d and flags =", inex2);
-+ flags_out (flags2);
-+ exit (1);
-+ }
-+ }
-+
-+ mpfr_clears (x1, x2, y, (mpfr_ptr) 0);
-+}
-+
-+static void
-+test_2exp_extreme (void)
-+{
-+ mpfr_exp_t emin, emax;
-+
-+ emin = mpfr_get_emin ();
-+ emax = mpfr_get_emax ();
-+
-+ set_emin (MPFR_EMIN_MIN);
-+ set_emax (MPFR_EMAX_MAX);
-+ test_2exp_extreme_aux ();
-+
-+ set_emin (-REXP);
-+ set_emax (REXP);
-+ test_2exp_extreme_aux ();
-+
-+ set_emin (emin);
-+ set_emax (emax);
-+}
-+
- int
- main (int argc, char *argv[])
- {
-@@ -185,6 +333,7 @@
- check_set_uj_2exp ();
- check_set_sj ();
- check_set_sj_2exp ();
-+ test_2exp_extreme ();
-
- tests_end_mpfr ();
- return 0;
---- mpfr-4.0.2/PATCHES 2020-03-30 13:09:17.466071979 +0000
-+++ mpfr-4.0.2/PATCHES 2020-03-30 13:09:17.502071540 +0000
-@@ -0,0 +1 @@
-+sub1-ubf
---- mpfr-4.0.2/VERSION 2020-03-30 13:05:16.264989689 +0000
-+++ mpfr-4.0.2/VERSION 2020-03-30 13:09:17.502071540 +0000
-@@ -1 +1 @@
--4.0.2-p3
-+4.0.2-p4
---- mpfr-4.0.2/src/add1.c 2019-01-07 13:53:20.000000000 +0000
-+++ mpfr-4.0.2/src/add1.c 2020-03-30 13:09:17.490071686 +0000
-@@ -41,7 +41,7 @@
-
- if (MPFR_UNLIKELY (MPFR_IS_UBF (b)))
- {
-- exp = mpfr_ubf_zexp2exp (MPFR_ZEXP (b));
-+ exp = MPFR_UBF_GET_EXP (b);
- if (exp > __gmpfr_emax)
- return mpfr_overflow (a, rnd_mode, MPFR_SIGN (b));;
- }
---- mpfr-4.0.2/src/mpfr-impl.h 2019-06-02 17:05:36.145226719 +0000
-+++ mpfr-4.0.2/src/mpfr-impl.h 2020-03-30 13:09:17.490071686 +0000
-@@ -2406,11 +2406,28 @@
- }
- #endif
-
--#define MPFR_ZEXP(x) \
-- ((void) (x)->_mpfr_exp /* to check that x has a correct type */, \
-+/* Get the _mpfr_zexp field (pointer to a mpz_t) of a UBF object.
-+ For practical reasons, the type of the argument x can be either
-+ mpfr_ubf_ptr or mpfr_ptr, since the latter is used in functions
-+ that accept both MPFR numbers and UBF's; this is checked by the
-+ code "(x)->_mpfr_exp" (the "sizeof" prevents an access, which
-+ could be invalid when MPFR_ZEXP(x) is used for an assignment,
-+ and also avoids breaking the aliasing rules if they are dealt
-+ with in the future).
-+ This macro can be used when building a UBF. So we do not check
-+ that the _mpfr_exp field has the value MPFR_EXP_UBF. */
-+#define MPFR_ZEXP(x) \
-+ ((void) sizeof ((x)->_mpfr_exp), \
- ((mpfr_ubf_ptr) (x))->_mpfr_zexp)
-
-+/* If x is a UBF, clear its mpz_t exponent. */
- #define MPFR_UBF_CLEAR_EXP(x) \
- ((void) (MPFR_IS_UBF (x) && (mpz_clear (MPFR_ZEXP (x)), 0)))
-
-+/* Like MPFR_GET_EXP, but accepts UBF (with exponent saturated to
-+ the interval [MPFR_EXP_MIN,MPFR_EXP_MAX]). */
-+#define MPFR_UBF_GET_EXP(x) \
-+ (MPFR_IS_UBF (x) ? mpfr_ubf_zexp2exp (MPFR_ZEXP (x)) : \
-+ MPFR_GET_EXP ((mpfr_ptr) (x)))
-+
- #endif /* __MPFR_IMPL_H__ */
---- mpfr-4.0.2/src/mpfr.h 2020-03-30 13:05:16.260989737 +0000
-+++ mpfr-4.0.2/src/mpfr.h 2020-03-30 13:09:17.498071589 +0000
-@@ -27,7 +27,7 @@
- #define MPFR_VERSION_MAJOR 4
- #define MPFR_VERSION_MINOR 0
- #define MPFR_VERSION_PATCHLEVEL 2
--#define MPFR_VERSION_STRING "4.0.2-p3"
-+#define MPFR_VERSION_STRING "4.0.2-p4"
-
- /* User macros:
- MPFR_USE_FILE: Define it to make MPFR define functions dealing
---- mpfr-4.0.2/src/sub1.c 2019-01-07 13:53:20.000000000 +0000
-+++ mpfr-4.0.2/src/sub1.c 2020-03-30 13:09:17.490071686 +0000
-@@ -91,9 +91,20 @@
-
- if (MPFR_UNLIKELY (MPFR_IS_UBF (b) || MPFR_IS_UBF (c)))
- {
-- exp_b = MPFR_IS_UBF (b) ?
-- mpfr_ubf_zexp2exp (MPFR_ZEXP (b)) : MPFR_GET_EXP (b);
-+ exp_b = MPFR_UBF_GET_EXP (b);
-+ /* Early underflow detection. Rare, but a test is needed anyway
-+ since in the "MAX (aq, bq) + 2 <= diff_exp" branch, the exponent
-+ may decrease and MPFR_EXP_MIN would yield an integer overflow. */
-+ if (MPFR_UNLIKELY (exp_b < __gmpfr_emin - 1))
-+ {
-+ if (rnd_mode == MPFR_RNDN)
-+ rnd_mode = MPFR_RNDZ;
-+ return mpfr_underflow (a, rnd_mode, MPFR_SIGN(a));
-+ }
- diff_exp = mpfr_ubf_diff_exp (b, c);
-+ /* mpfr_set4 below used with MPFR_RNDF does not support UBF. */
-+ if (rnd_mode == MPFR_RNDF)
-+ rnd_mode = MPFR_RNDN;
- }
- else
- {
-@@ -123,11 +134,11 @@
- if (rnd_mode == MPFR_RNDF)
- return mpfr_set4 (a, b, MPFR_RNDZ, MPFR_SIGN (a));
-
-- MPFR_EXP (a) = exp_b; /* may be up to MPFR_EXP_MAX */
-+ exp_a = exp_b; /* may be any out-of-range value due to UBF */
- MPFR_RNDRAW_EVEN (inexact, a, MPFR_MANT (b), bq,
- rnd_mode, MPFR_SIGN (a),
-- if (MPFR_EXP (a) != MPFR_EXP_MAX)
-- ++ MPFR_EXP (a));
-+ if (exp_a != MPFR_EXP_MAX)
-+ exp_a ++);
- MPFR_LOG_MSG (("inexact=%d\n", inexact));
- if (inexact == 0)
- {
-@@ -139,7 +150,7 @@
- if (! MPFR_IS_LIKE_RNDZ (rnd_mode, MPFR_IS_NEG (a)))
- {
- inexact = MPFR_INT_SIGN (a);
-- goto check_overflow;
-+ goto end_of_c_small;
- }
- }
- else /* inexact != 0 */
-@@ -164,7 +175,7 @@
- which means we get a wrong rounded result if x == 1,
- i.e. inexact == MPFR_EVEN_INEX (for positive numbers). */
- if (MPFR_LIKELY (inexact != MPFR_EVEN_INEX * MPFR_INT_SIGN (a)))
-- goto check_overflow;
-+ goto end_of_c_small;
- }
- /* We need to take the value preceding |a|. We can't use
- mpfr_nexttozero due to a possible out-of-range exponent.
-@@ -174,16 +185,26 @@
- mpn_sub_1 (ap, ap, an, MPFR_LIMB_ONE << sh);
- if (MPFR_UNLIKELY (MPFR_LIMB_MSB (ap[an-1]) == 0))
- {
-- MPFR_EXP (a) --;
-+ exp_a --;
- /* The following is valid whether an = 1 or an > 1. */
- ap[an-1] |= MPFR_LIMB_HIGHBIT;
- }
- inexact = - MPFR_INT_SIGN (a);
-- check_overflow:
-- if (MPFR_UNLIKELY (MPFR_EXP (a) > __gmpfr_emax))
-+ end_of_c_small:
-+ /* The underflow case is possible only with UBF. The overflow case
-+ is also possible with normal FP due to rounding. */
-+ if (MPFR_UNLIKELY (exp_a > __gmpfr_emax))
- return mpfr_overflow (a, rnd_mode, MPFR_SIGN (a));
-- else
-- MPFR_RET (inexact);
-+ if (MPFR_UNLIKELY (exp_a < __gmpfr_emin))
-+ {
-+ if (rnd_mode == MPFR_RNDN &&
-+ (exp_a < __gmpfr_emin - 1 ||
-+ (inexact * MPFR_INT_SIGN (a) >= 0 && mpfr_powerof2_raw (a))))
-+ rnd_mode = MPFR_RNDZ;
-+ return mpfr_underflow (a, rnd_mode, MPFR_SIGN(a));
-+ }
-+ MPFR_SET_EXP (a, exp_a);
-+ MPFR_RET (inexact);
- }
-
- /* reserve a space to store b aligned with the result, i.e. shifted by
-@@ -656,6 +677,15 @@
- if (MPFR_LIKELY(cancel))
- {
- cancel -= add_exp; /* OK: add_exp is an int equal to 0 or 1 */
-+ MPFR_ASSERTD (cancel >= 0);
-+ /* Detect an underflow case to avoid a possible integer overflow
-+ with UBF in the computation of exp_a. */
-+ if (MPFR_UNLIKELY (exp_b < __gmpfr_emin - 1))
-+ {
-+ if (rnd_mode == MPFR_RNDN)
-+ rnd_mode = MPFR_RNDZ;
-+ return mpfr_underflow (a, rnd_mode, MPFR_SIGN(a));
-+ }
- exp_a = exp_b - cancel;
- /* The following assertion corresponds to a limitation of the MPFR
- implementation. It may fail with a 32-bit ABI and huge precisions,
---- mpfr-4.0.2/src/version.c 2020-03-30 13:05:16.264989689 +0000
-+++ mpfr-4.0.2/src/version.c 2020-03-30 13:09:17.502071540 +0000
-@@ -25,5 +25,5 @@
- const char *
- mpfr_get_version (void)
- {
-- return "4.0.2-p3";
-+ return "4.0.2-p4";
- }
---- mpfr-4.0.2/tests/tfma.c 2019-01-07 13:53:20.000000000 +0000
-+++ mpfr-4.0.2/tests/tfma.c 2020-03-30 13:09:17.490071686 +0000
-@@ -47,7 +47,7 @@
- mpfr_add (r1, r1, c, (mpfr_rnd_t) rnd))
- {
- if (rnd == MPFR_RNDF)
-- break;
-+ continue;
- printf ("test_exact internal error for (%d,%d,%d,%d,%s)\n",
- i, j, k, rnd, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd));
- exit (1);
-@@ -664,7 +664,7 @@
- Note: The purpose of the s * 2^(emin-7) term is to yield
- double rounding when scaling for k = 4, s != 0, MPFR_RNDN. */
-
-- RND_LOOP (rnd)
-+ RND_LOOP_NO_RNDF (rnd)
- {
- mpfr_clear_flags ();
- inex1 = mpfr_set_si_2exp (t1, sign * (8*k+s-64), e-6,
---- mpfr-4.0.2/tests/tfmma.c 2019-01-07 13:53:20.000000000 +0000
-+++ mpfr-4.0.2/tests/tfmma.c 2020-03-30 13:09:17.490071686 +0000
-@@ -480,6 +480,123 @@
- mpfr_clears (x, y, z, (mpfr_ptr) 0);
- }
-
-+static void
-+underflow_tests (void)
-+{
-+ mpfr_t x, y, z;
-+ mpfr_prec_t p;
-+ mpfr_exp_t emin;
-+
-+ emin = mpfr_get_emin ();
-+ mpfr_set_emin (-17);
-+ for (p = MPFR_PREC_MIN; p <= 1024; p++)
-+ {
-+ mpfr_inits2 (p, x, y, (mpfr_ptr) 0);
-+ mpfr_init2 (z, p + 1);
-+ mpfr_set_str_binary (x, "1e-10");
-+ mpfr_set_str_binary (y, "1e-11");
-+ mpfr_clear_underflow ();
-+ mpfr_fmms (z, x, x, y, y, MPFR_RNDN);
-+ /* the exact result is 2^-20-2^-22, and should underflow */
-+ MPFR_ASSERTN(mpfr_underflow_p ());
-+ MPFR_ASSERTN(mpfr_zero_p (z));
-+ MPFR_ASSERTN(mpfr_signbit (z) == 0);
-+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
-+ }
-+ mpfr_set_emin (emin);
-+}
-+
-+static void
-+bug20180604 (void)
-+{
-+ mpfr_t x, y, yneg, z;
-+ mpfr_exp_t emin;
-+ int ret;
-+
-+ emin = mpfr_get_emin ();
-+ mpfr_set_emin (-1073741821);
-+ mpfr_inits2 (564, x, y, yneg, (mpfr_ptr) 0);
-+ mpfr_init2 (z, 2256);
-+ mpfr_set_str_binary (x,
"1.10010000111100110011001101111111101000111001011000110100110010000101000100010001000000111100010000101001011011111001111000110101111100101111001100001100011101100100011110000000011000010110111100111000100101010001011111010111011001110010001011101111001011001110110000010000011100010001010001011100100110111110101001001111001011101111110011101110101010110100010010111011111100010101111100011110111001011111101110101101101110100101111010000101011110100000000110111101000001100001000100010110100111010011011010110011100111010000101110010101111001011100110101100001100E-737194993");
-+ mpfr_set_str_binary (y,
"-1.00101000100001001101011110100010110011101010011011010111100110101011111100000100101000111010111101100100110010001110011011100100110110000001011001000111101111101111110101100110111000000011000001101001010100010010001110001000011010000100111001001100101111111100010101110101001101101101111010100011011110001000010000010100011000011000010110101100000111111110111001100100100001101011111011100101110111000100101010110100010011101010110010100110100111000000100111101101101000000011110000100110100100011000010011110010001010000110100011111101101101110001110001101101010E-737194903");
-+
-+ mpfr_clear_underflow ();
-+ ret = mpfr_fmms (z, x, x, y, y, MPFR_RNDN);
-+ MPFR_ASSERTN(mpfr_underflow_p ());
-+ MPFR_ASSERTN(mpfr_zero_p (z));
-+ MPFR_ASSERTN(mpfr_signbit (z) == 1);
-+ MPFR_ASSERTN(ret > 0);
-+
-+ mpfr_clear_underflow ();
-+ ret = mpfr_fmms (z, y, y, x, x, MPFR_RNDN);
-+ MPFR_ASSERTN(mpfr_underflow_p ());
-+ MPFR_ASSERTN(mpfr_zero_p (z));
-+ MPFR_ASSERTN(mpfr_signbit (z) == 0);
-+ MPFR_ASSERTN(ret < 0);
-+
-+ mpfr_neg (yneg, y, MPFR_RNDN);
-+ mpfr_clear_underflow ();
-+ ret = mpfr_fmms (z, x, x, y, yneg, MPFR_RNDN);
-+ MPFR_ASSERTN(mpfr_underflow_p ());
-+ MPFR_ASSERTN(mpfr_zero_p (z));
-+ MPFR_ASSERTN(mpfr_signbit (z) == 0);
-+ MPFR_ASSERTN(ret < 0);
-+
-+ mpfr_clear_underflow ();
-+ ret = mpfr_fmms (z, y, yneg, x, x, MPFR_RNDN);
-+ MPFR_ASSERTN(mpfr_underflow_p ());
-+ MPFR_ASSERTN(mpfr_zero_p (z));
-+ MPFR_ASSERTN(mpfr_signbit (z) == 1);
-+ MPFR_ASSERTN(ret > 0);
-+
-+ mpfr_clears (x, y, yneg, z, (mpfr_ptr) 0);
-+ mpfr_set_emin (emin);
-+}
-+
-+/* this bug was discovered from mpc_mul */
-+static void
-+bug20200206 (void)
-+{
-+ mpfr_exp_t emin = mpfr_get_emin ();
-+ mpfr_t xre, xim, yre, yim, zre;
-+
-+ mpfr_set_emin (-1073);
-+ mpfr_inits2 (53, xre, xim, yre, yim, zre, (mpfr_ptr) 0);
-+ mpfr_set_str (xre, "-0x8.294611b331c8p-904", 16, MPFR_RNDN);
-+ mpfr_set_str (xim, "-0x1.859278c2992fap-676", 16, MPFR_RNDN);
-+ mpfr_set_str (yre, "0x9.ac54802a95f8p-820", 16, MPFR_RNDN);
-+ mpfr_set_str (yim, "0x3.17e59e7612aap-412", 16, MPFR_RNDN);
-+ mpfr_fmms (zre, xre, yre, xim, yim, MPFR_RNDN);
-+ if (mpfr_regular_p (zre) && mpfr_get_exp (zre) < -1073)
-+ {
-+ printf ("Error, mpfr_fmms returns an out-of-range exponent:\n");
-+ mpfr_dump (zre);
-+ exit (1);
-+ }
-+ mpfr_clears (xre, xim, yre, yim, zre, (mpfr_ptr) 0);
-+ mpfr_set_emin (emin);
-+}
-+
-+/* check for integer overflow (see bug fixed in r13798) */
-+static void
-+extreme_underflow (void)
-+{
-+ mpfr_t x, y, z;
-+ mpfr_exp_t emin = mpfr_get_emin ();
-+
-+ set_emin (MPFR_EMIN_MIN);
-+ mpfr_inits2 (64, x, y, z, (mpfr_ptr) 0);
-+ mpfr_set_ui_2exp (x, 1, MPFR_EMIN_MIN - 1, MPFR_RNDN);
-+ mpfr_set (y, x, MPFR_RNDN);
-+ mpfr_nextabove (x);
-+ mpfr_clear_flags ();
-+ mpfr_fmms (z, x, x, y, y, MPFR_RNDN);
-+ MPFR_ASSERTN (__gmpfr_flags == (MPFR_FLAGS_UNDERFLOW | MPFR_FLAGS_INEXACT));
-+ MPFR_ASSERTN (MPFR_IS_ZERO (z) && MPFR_IS_POS (z));
-+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
-+ set_emin (emin);
-+}
-+
- /* Test double-rounding cases in mpfr_set_1_2, which is called when
- all the precisions are the same. With set.c before r13347, this
- triggers errors for neg=0. */
-@@ -548,6 +665,9 @@
- {
- tests_start_mpfr ();
-
-+ bug20200206 ();
-+ bug20180604 ();
-+ underflow_tests ();
- random_tests ();
- zero_tests ();
- max_tests ();
-@@ -555,6 +675,7 @@
- half_plus_half ();
- bug20170405 ();
- double_rounding ();
-+ extreme_underflow ();
-
- tests_end_mpfr ();
- return 0;
---- mpfr-4.0.2/tests/tsub.c 2019-01-07 13:53:20.000000000 +0000
-+++ mpfr-4.0.2/tests/tsub.c 2020-03-30 13:09:17.490071686 +0000
-@@ -1159,6 +1159,358 @@
- }
- }
-
-+/* Tests on UBF.
-+ *
-+ * Note: mpfr_sub1sp will never be used as it does not support UBF.
-+ * Thus there is no need to generate tests for both mpfr_sub1 and
-+ * mpfr_sub1sp.
-+ *
-+ * Note that mpfr_sub1 has a special branch "c small", where the second
-+ * argument c is sufficiently smaller than the ulp of the first argument
-+ * and the ulp of the result: MAX (aq, bq) + 2 <= diff_exp.
-+ * Tests should be done for both the main branch and this special branch
-+ * when this makes sense.
-+ */
-+#define REXP 1024
-+
-+static void test_ubf_aux (void)
-+{
-+ mpfr_ubf_t x[11];
-+ mpfr_ptr p[11];
-+ int ex[11];
-+ mpfr_t ee, y, z, w;
-+ int i, j, k, neg, inexact, rnd;
-+ const int kn = 2;
-+ mpfr_exp_t e[] =
-+ { MPFR_EXP_MIN, MPFR_EMIN_MIN, -REXP, 0,
-+ REXP, MPFR_EMAX_MAX, MPFR_EXP_MAX };
-+
-+ mpfr_init2 (ee, sizeof (mpfr_exp_t) * CHAR_BIT);
-+ mpfr_inits2 (64, y, z, (mpfr_ptr) 0);
-+ mpfr_init2 (w, 2);
-+
-+ for (i = 0; i < 11; i++)
-+ p[i] = (mpfr_ptr) x[i];
-+
-+ /* exact zero result, with small and large exponents */
-+ for (i = 0; i < 2; i++)
-+ {
-+ mpfr_init2 (p[i], 5 + (randlimb () % 128));
-+ mpfr_set_ui (p[i], 17, MPFR_RNDN);
-+ mpz_init (MPFR_ZEXP (p[i]));
-+ MPFR_SET_UBF (p[i]);
-+ }
-+ for (j = 0; j < numberof (e); j++)
-+ {
-+ inexact = mpfr_set_exp_t (ee, e[j], MPFR_RNDN);
-+ MPFR_ASSERTD (inexact == 0);
-+ inexact = mpfr_get_z (MPFR_ZEXP (p[0]), ee, MPFR_RNDN);
-+ MPFR_ASSERTD (inexact == 0);
-+ mpz_sub_ui (MPFR_ZEXP (p[0]), MPFR_ZEXP (p[0]), kn);
-+
-+ for (k = -kn; k <= kn; k++)
-+ {
-+ /* exponent: e[j] + k, with |k| <= kn */
-+ mpz_set (MPFR_ZEXP (p[1]), MPFR_ZEXP (p[0]));
-+
-+ for (neg = 0; neg <= 1; neg++)
-+ {
-+ RND_LOOP (rnd)
-+ {
-+ /* Note: x[0] and x[1] are equal MPFR numbers, but do not
-+ test mpfr_sub with arg2 == arg3 as pointers in order to
-+ skip potentially optimized mpfr_sub code. */
-+ inexact = mpfr_sub (z, p[0], p[1], (mpfr_rnd_t) rnd);
-+ if (inexact != 0 || MPFR_NOTZERO (z) ||
-+ (rnd != MPFR_RNDD ? MPFR_IS_NEG (z) : MPFR_IS_POS (z)))
-+ {
-+ printf ("Error 1 in test_ubf for exact zero result: "
-+ "j=%d k=%d neg=%d, rnd=%s\nGot ", j, k, neg,
-+ mpfr_print_rnd_mode ((mpfr_rnd_t) rnd));
-+ mpfr_dump (z);
-+ printf ("inexact = %d\n", inexact);
-+ exit (1);
-+ }
-+ }
-+
-+ for (i = 0; i < 2; i++)
-+ MPFR_CHANGE_SIGN (p[i]);
-+ }
-+
-+ mpz_add_ui (MPFR_ZEXP (p[0]), MPFR_ZEXP (p[0]), 1);
-+ }
-+ }
-+ for (i = 0; i < 2; i++)
-+ {
-+ MPFR_UBF_CLEAR_EXP (p[i]);
-+ mpfr_clear (p[i]);
-+ }
-+
-+ /* Up to a given exponent (for the result) and sign, test:
-+ * (t + .11010) - (t + .00001) = .11001
-+ * (t + 8) - (t + 111.00111) = .11001
-+ * where t = 0 or a power of 2, e.g. 2^200. Test various exponents
-+ * (including those near the underflow/overflow boundaries) so that
-+ * the subtraction yields a normal number, an overflow or an underflow.
-+ * In MPFR_RNDA, also test with a 2-bit precision target, as this
-+ * yields an exponent change.
-+ *
-+ * Also test the "MAX (aq, bq) + 2 <= diff_exp" branch of sub1.c with
-+ * .1 - epsilon (possible decrease of the exponent) and .111 - epsilon
-+ * in precision 2 (possible increase of the exponent). The first test
-+ * triggers a possible decrease of the exponent (see bug fixed in r13806).
-+ * The second test triggers a possible increase of the exponent (see the
-+ * "exp_a != MPFR_EXP_MAX" test to avoid an integer overflow).
-+ */
-+ for (i = 0; i < 8; i++)
-+ {
-+ static int v[4] = { 26, 1, 256, 231 };
-+
-+ mpfr_init2 (p[i], i < 4 ? 5 + (randlimb () % 128) : 256);
-+ if (i < 4)
-+ mpfr_set_si_2exp (p[i], v[i], -5, MPFR_RNDN);
-+ else
-+ {
-+ mpfr_set_si_2exp (p[i], 1, 200, MPFR_RNDN);
-+ mpfr_add (p[i], p[i], p[i-4], MPFR_RNDN);
-+ }
-+ ex[i] = mpfr_get_exp (p[i]) + 5;
-+ MPFR_ASSERTD (ex[i] >= 0);
-+ }
-+ mpfr_inits2 (3, p[8], p[9], p[10], (mpfr_ptr) 0);
-+ mpfr_set_si_2exp (p[8], 1, 0, MPFR_RNDN);
-+ ex[8] = 5;
-+ mpfr_set_si_2exp (p[9], 1, 0, MPFR_RNDN); /* will be epsilon */
-+ ex[9] = 0;
-+ mpfr_set_si_2exp (p[10], 7, 0, MPFR_RNDN);
-+ ex[10] = 5;
-+
-+ for (i = 0; i < 11; i++)
-+ {
-+ mpz_init (MPFR_ZEXP (p[i]));
-+ MPFR_SET_UBF (p[i]);
-+ }
-+
-+ for (j = 0; j < numberof (e); j++)
-+ {
-+ inexact = mpfr_set_exp_t (ee, e[j], MPFR_RNDN);
-+ MPFR_ASSERTD (inexact == 0);
-+ inexact = mpfr_get_z (MPFR_ZEXP (p[0]), ee, MPFR_RNDN);
-+ MPFR_ASSERTD (inexact == 0);
-+ for (i = 1; i < 11; i++)
-+ mpz_set (MPFR_ZEXP (p[i]), MPFR_ZEXP (p[0]));
-+ for (i = 0; i < 11; i++)
-+ {
-+ mpz_add_ui (MPFR_ZEXP (p[i]), MPFR_ZEXP (p[i]), ex[i]);
-+ mpz_sub_ui (MPFR_ZEXP (p[i]), MPFR_ZEXP (p[i]), 5 + kn);
-+ }
-+ mpz_sub_ui (MPFR_ZEXP (p[9]), MPFR_ZEXP (p[9]), 256);
-+ for (k = -kn; k <= kn; k++)
-+ {
-+ for (neg = 0; neg <= 1; neg++)
-+ {
-+ int sign = neg ? -1 : 1;
-+
-+ RND_LOOP (rnd)
-+ for (i = 0; i <= 10; i += 2)
-+ {
-+ mpfr_exp_t e0;
-+ mpfr_flags_t flags, flags_y;
-+ int inex_y;
-+
-+ if (i >= 8)
-+ {
-+ int d;
-+
-+ e0 = MPFR_UBF_GET_EXP (p[i]);
-+ if (e0 < MPFR_EXP_MIN + 3)
-+ e0 += 3;
-+
-+ if (rnd == MPFR_RNDN)
-+ d = i == 8 ? (e0 == __gmpfr_emin - 1 ? 3 : 4) : 6;
-+ else if (MPFR_IS_LIKE_RNDZ (rnd, neg))
-+ d = i == 8 ? 3 : 6;
-+ else
-+ d = i == 8 ? 4 : 8;
-+
-+ mpfr_clear_flags ();
-+ inex_y = mpfr_set_si_2exp (w, sign * d, e0 - 3,
-+ (mpfr_rnd_t) rnd);
-+ flags_y = __gmpfr_flags | MPFR_FLAGS_INEXACT;
-+ if (inex_y == 0)
-+ inex_y = rnd == MPFR_RNDN ?
-+ sign * (i == 8 ? 1 : -1) :
-+ MPFR_IS_LIKE_RNDD ((mpfr_rnd_t) rnd, sign) ?
-+ -1 : 1;
-+ mpfr_set (y, w, MPFR_RNDN);
-+
-+ mpfr_clear_flags ();
-+ inexact = mpfr_sub (w, p[i], p[9], (mpfr_rnd_t) rnd);
-+ flags = __gmpfr_flags;
-+
-+ /* For MPFR_RNDF, only do a basic test. */
-+ MPFR_ASSERTN (mpfr_check (w));
-+ if (rnd == MPFR_RNDF)
-+ continue;
-+
-+ goto testw;
-+ }
-+
-+ mpfr_clear_flags ();
-+ inexact = mpfr_sub (z, p[i], p[i+1], (mpfr_rnd_t) rnd);
-+ flags = __gmpfr_flags;
-+
-+ /* For MPFR_RNDF, only do a basic test. */
-+ MPFR_ASSERTN (mpfr_check (z));
-+ if (rnd == MPFR_RNDF)
-+ continue;
-+
-+ e0 = MPFR_UBF_GET_EXP (p[0]);
-+
-+ if (e0 < __gmpfr_emin)
-+ {
-+ mpfr_rnd_t r =
-+ rnd == MPFR_RNDN && e0 < __gmpfr_emin - 1 ?
-+ MPFR_RNDZ : (mpfr_rnd_t) rnd;
-+ flags_y = MPFR_FLAGS_UNDERFLOW | MPFR_FLAGS_INEXACT;
-+ inex_y = mpfr_underflow (y, r, sign);
-+ }
-+ else if (e0 > __gmpfr_emax)
-+ {
-+ flags_y = MPFR_FLAGS_OVERFLOW | MPFR_FLAGS_INEXACT;
-+ inex_y = mpfr_overflow (y, (mpfr_rnd_t) rnd, sign);
-+ }
-+ else
-+ {
-+ mpfr_set_si_2exp (y, sign * 25, e0 - 5, MPFR_RNDN);
-+ flags_y = 0;
-+ inex_y = 0;
-+ }
-+
-+ if (flags != flags_y ||
-+ ! SAME_SIGN (inexact, inex_y) ||
-+ ! mpfr_equal_p (y, z))
-+ {
-+ printf ("Error 2 in test_ubf with "
-+ "j=%d k=%d neg=%d i=%d rnd=%s\n",
-+ j, k, neg, i,
-+ mpfr_print_rnd_mode ((mpfr_rnd_t) rnd));
-+ printf ("emin=%" MPFR_EXP_FSPEC "d "
-+ "emax=%" MPFR_EXP_FSPEC "d\n",
-+ (mpfr_eexp_t) __gmpfr_emin,
-+ (mpfr_eexp_t) __gmpfr_emax);
-+ printf ("b = ");
-+ mpfr_dump (p[i]);
-+ printf ("c = ");
-+ mpfr_dump (p[i+1]);
-+ printf ("Expected ");
-+ mpfr_dump (y);
-+ printf ("with inex = %d and flags =", inex_y);
-+ flags_out (flags_y);
-+ printf ("Got ");
-+ mpfr_dump (z);
-+ printf ("with inex = %d and flags =", inexact);
-+ flags_out (flags);
-+ exit (1);
-+ }
-+
-+ /* Do the following 2-bit precision test only in RNDA. */
-+ if (rnd != MPFR_RNDA)
-+ continue;
-+
-+ mpfr_clear_flags ();
-+ inexact = mpfr_sub (w, p[i], p[i+1], MPFR_RNDA);
-+ flags = __gmpfr_flags;
-+ if (e0 < MPFR_EXP_MAX)
-+ e0++;
-+
-+ if (e0 < __gmpfr_emin)
-+ {
-+ flags_y = MPFR_FLAGS_UNDERFLOW | MPFR_FLAGS_INEXACT;
-+ inex_y = mpfr_underflow (y, MPFR_RNDA, sign);
-+ }
-+ else if (e0 > __gmpfr_emax)
-+ {
-+ flags_y = MPFR_FLAGS_OVERFLOW | MPFR_FLAGS_INEXACT;
-+ inex_y = mpfr_overflow (y, MPFR_RNDA, sign);
-+ }
-+ else
-+ {
-+ mpfr_set_si_2exp (y, sign, e0 - 1, MPFR_RNDN);
-+ flags_y = MPFR_FLAGS_INEXACT;
-+ inex_y = sign;
-+ }
-+
-+ testw:
-+ if (flags != flags_y ||
-+ ! SAME_SIGN (inexact, inex_y) ||
-+ ! mpfr_equal_p (y, w))
-+ {
-+ printf ("Error 3 in test_ubf with "
-+ "j=%d k=%d neg=%d i=%d rnd=%s\n",
-+ j, k, neg, i,
-+ mpfr_print_rnd_mode ((mpfr_rnd_t) rnd));
-+ printf ("emin=%" MPFR_EXP_FSPEC "d "
-+ "emax=%" MPFR_EXP_FSPEC "d\n",
-+ (mpfr_eexp_t) __gmpfr_emin,
-+ (mpfr_eexp_t) __gmpfr_emax);
-+ printf ("b = ");
-+ mpfr_dump (p[i]);
-+ printf ("c = ");
-+ mpfr_dump (p[i <= 8 ? i+1 : 9]);
-+ printf ("Expected ");
-+ /* Set y to a 2-bit precision just for the output.
-+ Since we exit, this will have no other effect. */
-+ mpfr_prec_round (y, 2, MPFR_RNDA);
-+ mpfr_dump (y);
-+ printf ("with inex = %d and flags =", inex_y);
-+ flags_out (flags_y);
-+ printf ("Got ");
-+ mpfr_dump (w);
-+ printf ("with inex = %d and flags =", inexact);
-+ flags_out (flags);
-+ exit (1);
-+ }
-+ }
-+
-+ for (i = 0; i < 11; i++)
-+ MPFR_CHANGE_SIGN (p[i]);
-+ }
-+
-+ for (i = 0; i < 11; i++)
-+ mpz_add_ui (MPFR_ZEXP (p[i]), MPFR_ZEXP (p[i]), 1);
-+ }
-+ }
-+ for (i = 0; i < 11; i++)
-+ {
-+ MPFR_UBF_CLEAR_EXP (p[i]);
-+ mpfr_clear (p[i]);
-+ }
-+
-+ mpfr_clears (ee, y, z, w, (mpfr_ptr) 0);
-+}
-+
-+/* Run the tests on UBF with the maximum exponent range and with a
-+ reduced exponent range. */
-+static void test_ubf (void)
-+{
-+ mpfr_exp_t emin, emax;
-+
-+ emin = mpfr_get_emin ();
-+ emax = mpfr_get_emax ();
-+
-+ set_emin (MPFR_EMIN_MIN);
-+ set_emax (MPFR_EMAX_MAX);
-+ test_ubf_aux ();
-+
-+ set_emin (-REXP);
-+ set_emax (REXP);
-+ test_ubf_aux ();
-+
-+ set_emin (emin);
-+ set_emax (emax);
-+}
-+
- #define TEST_FUNCTION test_sub
- #define TWO_ARGS
- #define RAND_FUNCTION(x) mpfr_random2(x, MPFR_LIMB_SIZE (x), randlimb () % 100, RANDS)
-@@ -1188,6 +1540,7 @@
- for (i=0; i<50; i++)
- check_two_sum (p);
- test_generic (MPFR_PREC_MIN, 800, 100);
-+ test_ubf ();
-
- tests_end_mpfr ();
- return 0;
---- mpfr-4.0.2/PATCHES 2020-03-30 16:31:45.813415121 +0000
-+++ mpfr-4.0.2/PATCHES 2020-03-30 16:33:54.623893528 +0000
-@@ -0,0 +1 @@
-+const
---- mpfr-4.0.2/VERSION 2020-03-30 13:09:17.502071540 +0000
-+++ mpfr-4.0.2/VERSION 2020-03-30 15:17:31.535330224 +0000
-@@ -1 +1 @@
--4.0.2-p4
-+4.0.2-p5
---- mpfr-4.0.2/acinclude.m4 2019-01-27 18:30:16.000000000 +0000
-+++ mpfr-4.0.2/acinclude.m4 2019-01-27 18:30:16.000000000 +0000
-@@ -438,12 +438,14 @@
- AC_MSG_WARN([platform and/or document the behavior.])
- fi
-
--dnl Check if the chars '0' to '9' are consecutive values
-+dnl Check if the chars '0' to '9', 'a' to 'z', and
'A' to 'Z' are
-+dnl consecutive values.
-+dnl The const is necessary with GCC's "-Wwrite-strings -Werror".
- AC_MSG_CHECKING([if charset has consecutive values])
- AC_RUN_IFELSE([AC_LANG_PROGRAM([[
--char *number = "0123456789";
--char *lower = "abcdefghijklmnopqrstuvwxyz";
--char *upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-+const char *number = "0123456789";
-+const char *lower = "abcdefghijklmnopqrstuvwxyz";
-+const char *upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- ]],[[
- int i;
- unsigned char *p;
---- mpfr-4.0.2/configure 2019-01-31 20:43:19.000000000 +0000
-+++ mpfr-4.0.2/configure 2020-03-30 16:33:29.340190160 +0000
-@@ -15868,9 +15868,9 @@
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
-
--char *number = "0123456789";
--char *lower = "abcdefghijklmnopqrstuvwxyz";
--char *upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-+const char *number = "0123456789";
-+const char *lower = "abcdefghijklmnopqrstuvwxyz";
-+const char *upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-
- int
- main (void)
---- mpfr-4.0.2/src/mpfr.h 2020-03-30 13:09:17.498071589 +0000
-+++ mpfr-4.0.2/src/mpfr.h 2020-03-30 15:17:31.535330224 +0000
-@@ -27,7 +27,7 @@
- #define MPFR_VERSION_MAJOR 4
- #define MPFR_VERSION_MINOR 0
- #define MPFR_VERSION_PATCHLEVEL 2
--#define MPFR_VERSION_STRING "4.0.2-p4"
-+#define MPFR_VERSION_STRING "4.0.2-p5"
-
- /* User macros:
- MPFR_USE_FILE: Define it to make MPFR define functions dealing
---- mpfr-4.0.2/src/version.c 2020-03-30 13:09:17.502071540 +0000
-+++ mpfr-4.0.2/src/version.c 2020-03-30 15:17:31.535330224 +0000
-@@ -25,5 +25,5 @@
- const char *
- mpfr_get_version (void)
- {
-- return "4.0.2-p4";
-+ return "4.0.2-p5";
- }
---- mpfr-4.0.2/tests/tdiv.c 2019-01-07 13:53:20.000000000 +0000
-+++ mpfr-4.0.2/tests/tdiv.c 2020-03-30 15:17:31.523330366 +0000
-@@ -23,7 +23,7 @@
- #include "mpfr-test.h"
-
- static void
--check_equal (mpfr_srcptr a, mpfr_srcptr a2, char *s,
-+check_equal (mpfr_srcptr a, mpfr_srcptr a2, const char *s,
- mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t r)
- {
- if (SAME_VAL (a, a2))
---- mpfr-4.0.2/tests/tfpif.c 2019-01-07 13:53:20.000000000 +0000
-+++ mpfr-4.0.2/tests/tfpif.c 2020-03-30 15:17:31.523330366 +0000
-@@ -30,8 +30,8 @@
- static void
- doit (int argc, char *argv[], mpfr_prec_t p1, mpfr_prec_t p2)
- {
-- char *filenameCompressed = FILE_NAME_RW;
-- char *data = FILE_NAME_R;
-+ const char *filenameCompressed = FILE_NAME_RW;
-+ const char *data = FILE_NAME_R;
- int status;
- FILE *fh;
- mpfr_t x[9];
-@@ -198,7 +198,7 @@
- static void
- check_bad (void)
- {
-- char *filenameCompressed = FILE_NAME_RW;
-+ const char *filenameCompressed = FILE_NAME_RW;
- int status;
- FILE *fh;
- mpfr_t x;
-@@ -340,7 +340,7 @@
- static void
- extra (void)
- {
-- char *data = FILE_NAME_R2;
-+ const char *data = FILE_NAME_R2;
- mpfr_t x;
- FILE *fp;
- int ret;
---- mpfr-4.0.2/tests/tmul_2exp.c 2019-01-07 13:53:20.000000000 +0000
-+++ mpfr-4.0.2/tests/tmul_2exp.c 2020-03-30 15:17:31.523330366 +0000
-@@ -258,7 +258,7 @@
- mpfr_exp_t old_emax;
- mpfr_t x, y1, y2;
- int neg, r, op;
-- static char *sop[4] = { "mul_2ui", "mul_2si", "div_2ui",
"div_2si" };
-+ static const char *sop[4] = { "mul_2ui", "mul_2si",
"div_2ui", "div_2si" };
-
- old_emax = mpfr_get_emax ();
- set_emax (emax);
---- mpfr-4.0.2/tests/trandom.c 2019-01-07 13:53:20.000000000 +0000
-+++ mpfr-4.0.2/tests/trandom.c 2020-03-30 15:17:31.523330366 +0000
-@@ -185,7 +185,7 @@
- {
- gmp_randstate_t s;
- mpfr_t x;
-- char *str = "0.1010111100000000000000000000000000000000E-32";
-+ const char *str = "0.1010111100000000000000000000000000000000E-32";
- int k;
-
- gmp_randinit_default (s);
---- mpfr-4.0.2/tests/trint.c 2019-01-25 02:00:06.000000000 +0000
-+++ mpfr-4.0.2/tests/trint.c 2020-03-30 15:17:31.523330366 +0000
-@@ -308,7 +308,7 @@
- #if __MPFR_STDC (199901L)
-
- static void
--test_fct (double (*f)(double), int (*g)(), char *s, mpfr_rnd_t r)
-+test_fct (double (*f)(double), int (*g)(), const char *s, mpfr_rnd_t r)
- {
- double d, y;
- mpfr_t dd, yy;
---- mpfr-4.0.2/tests/tsum.c 2019-01-07 13:53:20.000000000 +0000
-+++ mpfr-4.0.2/tests/tsum.c 2020-03-30 15:17:31.523330366 +0000
-@@ -285,7 +285,7 @@
- static void
- check_more_special (void)
- {
-- char *str[NC] = { "NaN", "+Inf", "-Inf", "+0",
"-0", "+1", "-1" };
-+ const char *str[NC] = { "NaN", "+Inf", "-Inf",
"+0", "-0", "+1", "-1" };
- int i, r, k[NS];
- mpfr_t c[NC], s[NS], sum;
- mpfr_ptr p[NS];
-@@ -724,7 +724,7 @@
- {
- mpfr_t sum, t[4];
- mpfr_ptr p[4];
-- char *s[4] = {
-+ const char *s[4] = {
- "0x1p1000",
- "-0x0.fffffffffffff80000000000000001p1000",
- "-0x1p947",
-@@ -771,7 +771,11 @@
- {
- mpfr_t sum1, sum2, t[3];
- mpfr_ptr p[3];
-- char *s[3] = { "0.10000111110101000010101011100001", "1E-100",
"0.1E95" };
-+ const char *s[3] = {
-+ "0.10000111110101000010101011100001",
-+ "1E-100",
-+ "0.1E95"
-+ };
- int i, r;
-
- mpfr_inits2 (58, sum1, sum2, (mpfr_ptr) 0);
-@@ -1268,7 +1272,7 @@
- {
- mpfr_t r, t[4];
- mpfr_ptr p[4];
-- char *s[4] = { "0.10E20", "0", "0.11E382",
"0.10E826" };
-+ const char *s[4] = { "0.10E20", "0", "0.11E382",
"0.10E826" };
- int i;
-
- mpfr_init2 (r, 2);
---- mpfr-4.0.2/tests/turandom.c 2019-01-07 13:53:20.000000000 +0000
-+++ mpfr-4.0.2/tests/turandom.c 2020-03-30 15:17:31.523330366 +0000
-@@ -526,7 +526,7 @@
- #define N 6
- /* Run this program with the MPFR_REPROD_ABI_OUTPUT environment variable
- set to get the array of strings. */
-- char *t[5 * N] = {
-+ const char *t[5 * N] = {
- "1.0@-1",
- "3.0@-1",
- "7.0@-1",
---- mpfr-4.0.2/PATCHES 2020-03-30 16:50:17.064231191 +0000
-+++ mpfr-4.0.2/PATCHES 2020-03-30 16:50:17.096230810 +0000
-@@ -0,0 +1 @@
-+array-length
---- mpfr-4.0.2/VERSION 2020-03-30 15:17:31.535330224 +0000
-+++ mpfr-4.0.2/VERSION 2020-03-30 16:50:17.096230810 +0000
-@@ -1 +1 @@
--4.0.2-p5
-+4.0.2-p6
---- mpfr-4.0.2/src/mpfr-impl.h 2020-03-30 13:09:17.490071686 +0000
-+++ mpfr-4.0.2/src/mpfr-impl.h 2020-03-30 16:50:17.084230953 +0000
-@@ -2026,7 +2026,21 @@
- struct mpfr_group_t {
- size_t alloc;
- mp_limb_t *mant;
-+#if MPFR_GROUP_STATIC_SIZE != 0
- mp_limb_t tab[MPFR_GROUP_STATIC_SIZE];
-+#else
-+ /* In order to detect memory leaks when testing, MPFR_GROUP_STATIC_SIZE
-+ can be set to 0, in which case tab will not be used. ISO C does not
-+ support zero-length arrays[*], thus let's use a flexible array member
-+ (which will be equivalent here). Note: this is new in C99, but this
-+ is just used for testing.
-+ [*] Zero-length arrays are a GNU extension:
-+
https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
-+ and as such an extension is forbidden in ISO C, it triggers an
-+ error with -Werror=pedantic.
-+ */
-+ mp_limb_t tab[];
-+#endif
- };
-
- #define MPFR_GROUP_DECL(g) struct mpfr_group_t g
---- mpfr-4.0.2/src/mpfr.h 2020-03-30 15:17:31.535330224 +0000
-+++ mpfr-4.0.2/src/mpfr.h 2020-03-30 16:50:17.096230810 +0000
-@@ -27,7 +27,7 @@
- #define MPFR_VERSION_MAJOR 4
- #define MPFR_VERSION_MINOR 0
- #define MPFR_VERSION_PATCHLEVEL 2
--#define MPFR_VERSION_STRING "4.0.2-p5"
-+#define MPFR_VERSION_STRING "4.0.2-p6"
-
- /* User macros:
- MPFR_USE_FILE: Define it to make MPFR define functions dealing
---- mpfr-4.0.2/src/version.c 2020-03-30 15:17:31.535330224 +0000
-+++ mpfr-4.0.2/src/version.c 2020-03-30 16:50:17.096230810 +0000
-@@ -25,5 +25,5 @@
- const char *
- mpfr_get_version (void)
- {
-- return "4.0.2-p5";
-+ return "4.0.2-p6";
- }
---- mpfr-4.0.2/PATCHES 2020-04-03 13:54:03.807946879 +0000
-+++ mpfr-4.0.2/PATCHES 2020-04-03 13:54:03.891945830 +0000
-@@ -0,0 +1 @@
-+sub1-ubftest
---- mpfr-4.0.2/VERSION 2020-03-30 16:50:17.096230810 +0000
-+++ mpfr-4.0.2/VERSION 2020-04-03 13:54:03.891945830 +0000
-@@ -1 +1 @@
--4.0.2-p6
-+4.0.2-p7
---- mpfr-4.0.2/src/mpfr.h 2020-03-30 16:50:17.096230810 +0000
-+++ mpfr-4.0.2/src/mpfr.h 2020-04-03 13:54:03.891945830 +0000
-@@ -27,7 +27,7 @@
- #define MPFR_VERSION_MAJOR 4
- #define MPFR_VERSION_MINOR 0
- #define MPFR_VERSION_PATCHLEVEL 2
--#define MPFR_VERSION_STRING "4.0.2-p6"
-+#define MPFR_VERSION_STRING "4.0.2-p7"
-
- /* User macros:
- MPFR_USE_FILE: Define it to make MPFR define functions dealing
---- mpfr-4.0.2/src/version.c 2020-03-30 16:50:17.096230810 +0000
-+++ mpfr-4.0.2/src/version.c 2020-04-03 13:54:03.891945830 +0000
-@@ -25,5 +25,5 @@
- const char *
- mpfr_get_version (void)
- {
-- return "4.0.2-p6";
-+ return "4.0.2-p7";
- }
---- mpfr-4.0.2/tests/tsub.c 2020-03-30 13:09:17.490071686 +0000
-+++ mpfr-4.0.2/tests/tsub.c 2020-04-03 13:54:03.827946629 +0000
-@@ -1203,9 +1203,9 @@
- for (j = 0; j < numberof (e); j++)
- {
- inexact = mpfr_set_exp_t (ee, e[j], MPFR_RNDN);
-- MPFR_ASSERTD (inexact == 0);
-+ MPFR_ASSERTN (inexact == 0);
- inexact = mpfr_get_z (MPFR_ZEXP (p[0]), ee, MPFR_RNDN);
-- MPFR_ASSERTD (inexact == 0);
-+ MPFR_ASSERTN (inexact == 0);
- mpz_sub_ui (MPFR_ZEXP (p[0]), MPFR_ZEXP (p[0]), kn);
-
- for (k = -kn; k <= kn; k++)
-@@ -1266,23 +1266,31 @@
- {
- static int v[4] = { 26, 1, 256, 231 };
-
-- mpfr_init2 (p[i], i < 4 ? 5 + (randlimb () % 128) : 256);
-+ mpfr_init2 (p[i], i < 4 ? 8 + (randlimb () % 128) : 256);
- if (i < 4)
-- mpfr_set_si_2exp (p[i], v[i], -5, MPFR_RNDN);
-+ {
-+ inexact = mpfr_set_si_2exp (p[i], v[i], -5, MPFR_RNDN);
-+ MPFR_ASSERTN (inexact == 0);
-+ }
- else
- {
-- mpfr_set_si_2exp (p[i], 1, 200, MPFR_RNDN);
-- mpfr_add (p[i], p[i], p[i-4], MPFR_RNDN);
-+ inexact = mpfr_set_si_2exp (p[i], 1, 200, MPFR_RNDN);
-+ MPFR_ASSERTN (inexact == 0);
-+ inexact = mpfr_add (p[i], p[i], p[i-4], MPFR_RNDN);
-+ MPFR_ASSERTN (inexact == 0);
- }
- ex[i] = mpfr_get_exp (p[i]) + 5;
-- MPFR_ASSERTD (ex[i] >= 0);
-+ MPFR_ASSERTN (ex[i] >= 0);
- }
- mpfr_inits2 (3, p[8], p[9], p[10], (mpfr_ptr) 0);
-- mpfr_set_si_2exp (p[8], 1, 0, MPFR_RNDN);
-+ inexact = mpfr_set_si_2exp (p[8], 1, 0, MPFR_RNDN);
-+ MPFR_ASSERTN (inexact == 0);
- ex[8] = 5;
-- mpfr_set_si_2exp (p[9], 1, 0, MPFR_RNDN); /* will be epsilon */
-+ inexact = mpfr_set_si_2exp (p[9], 1, 0, MPFR_RNDN); /* will be epsilon */
-+ MPFR_ASSERTN (inexact == 0);
- ex[9] = 0;
-- mpfr_set_si_2exp (p[10], 7, 0, MPFR_RNDN);
-+ inexact = mpfr_set_si_2exp (p[10], 7, 0, MPFR_RNDN);
-+ MPFR_ASSERTN (inexact == 0);
- ex[10] = 5;
-
- for (i = 0; i < 11; i++)
-@@ -1294,9 +1302,9 @@
- for (j = 0; j < numberof (e); j++)
- {
- inexact = mpfr_set_exp_t (ee, e[j], MPFR_RNDN);
-- MPFR_ASSERTD (inexact == 0);
-+ MPFR_ASSERTN (inexact == 0);
- inexact = mpfr_get_z (MPFR_ZEXP (p[0]), ee, MPFR_RNDN);
-- MPFR_ASSERTD (inexact == 0);
-+ MPFR_ASSERTN (inexact == 0);
- for (i = 1; i < 11; i++)
- mpz_set (MPFR_ZEXP (p[i]), MPFR_ZEXP (p[0]));
- for (i = 0; i < 11; i++)
diff --git a/sources b/sources
index 454bac6..dfff0b4 100644
--- a/sources
+++ b/sources
@@ -1,21 +1,25 @@
SHA512 (Macaulay2-icons.tar.xz) =
069aa0ad70a0253583b00091c094da9b79d2a2f0f2d38aa97f543081f5df5fd3b5a9e1463febd6947c3151cf01844133174c7372f57e158c2d3faba6baed5d1d
-SHA512 (version-1.15.1.0.tar.gz) =
7ffe9f5e15ab43cec72100ccb5ee4fd646d34f6c5096e2f8b6e856a556f4e05627721836321836fea21d14c978e37f653b3e3e32c26aa71c9a58b29f083c95bd
+SHA512 (Macaulay2-1.16.tar.gz) =
3e69e2dc407af9bc6b4f7db2046788e509effb543286a98406655828ab1c462cb406abe350f91ba5d204934fa3f5d04f82d454cd441dce428f8d02ded68f2372
SHA512 (4ti2-1.6.9.tar.gz) =
f02b61ba04d7512e86d9574574669ec764d053fc5d01744dc6b521518d4165b41355ae12344923f1549b323406130c6562a4d9272b1b88de2ecc2c20d3d892d5
SHA512 (cddlib-094h.tar.gz) =
94a3ef03fd86ece7e61e4f9bec283862594b05a6faca76897e33ad15762527c885cee5439bb8a5d337a608ceb17baff24910da326071a3107df17a0c07f5e774
-SHA512 (cohomCalg-0.32.tar.gz) =
70e72363467e557c32a2d20192cfcb12bcce77edc251ebfaeb9062fa456043b749758a9e3273325613d4b5572c7771aee7853fc244a3ed8957145e02d80de128
+SHA512 (cohomCalg-0.32.tar.gz) =
b76d8de00b13a8fe8881222178247c5e99c15075c46290830f6c3afffb9dfc18af0d57f738ac5a0d7c00044db81b4465d1e0563c95f7f656a2440be5765c6818
SHA512 (Csdp-6.2.0.tgz) =
6f6c44abcb7b0e277f5a42a1e31acbd41c8fbdce0c1641982a48199fe1d922b28d86433d1a98ac71ae521bea04188a830c441db1e9d8eebf174debf501430e82
SHA512 (factory-4.1.1.tar.gz) =
f08d74cb860145c07b9f1cc0a3fe44cb6fb2fc158a9b992f0db55eeef9e93d280cf66a5c8822236389e54b8084d2a37c174b32864e4dc12b8ee3c4760e9fe2bf
-SHA512 (flint-20200414.tar.gz) =
06f8d4fc5dde0476ed18c37d9342d4350745a92410eb80c6d98cf10f557bdba1134d2d5a97db5f0d226ae5617fbd0d9db0b36b81ce350576e5615bbcdac3ab1e
+SHA512 (flint-2.6.3.tar.gz) =
8e71570364c789b1d4eaaa5f5adf10212cab47bf1a9f45c333211035ed021a86bb7b1de1feec51e83b2e113e8168853e370f127d2d2b1e941a12aec71fe8ae9e
SHA512 (frobby_v0.9.0.tar.gz) =
bc96ff20ec334932b5eaa8a3d15d0e36eab41eb85e8b74dbdc374dcaafc9873e44a8af16f6caae649aeea17cd6284caf244d4d345689ad43288f199c591a68a6
SHA512 (gfan0.6.2.tar.gz) =
08a9cc543967771af959a506b79db5b55e0e4942e4170dad8691db35ef7d381d878e1ea6534a3cacc0f5d30ec31564ec94cc20b46792d06f18a3a8a3c0aac91d
-SHA512 (givaro-4.1.1.tar.gz) =
415c24146fb41ed5db1ffbe687bf0fd62a68e82b69e1aece7721ad75ae9fede2d37223a3fa11f770f41bcd2d426e5aa9b2b8f1bc1e62eac44821c6e1a215114e
+SHA512 (givaro-4.1.1.tar.gz) =
baaf139f42176838c541143a5b69acf47a8f31c17020a85cf413ce18ade2c3048e009d15c2acf4d71041c0776cd42f5fedb1c183ce1cc0f85cb8672ceac00ee7
SHA512 (glpk-4.59.tar.gz) =
ca05bd085880143acf4a440cf7efd2392d4dde89bed53a0e5726526cb210eee004bfcd434aeb8ca8abb1dc89ff93e72054489911e5e2c843e0ed631d50c55f56
SHA512 (gtest-1.10.0.tar.gz) =
bd52abe938c3722adc2347afad52ea3a17ecc76730d8d16b065e165bc7477d762bce0997a427131866a89f1001e3f3315198204ffa5d643a9355f1f4d0d7b1a9
SHA512 (lapack-3.6.0.tgz) =
0975c721abe38ef46cda2ba446060428e2f576ec4558cc0205ca6af2af2bd8f7f4c31fd0c90d77a92719a73e1942fade19b4c17e6fe2da29d54ad1adccf5a6b2
SHA512 (libfplll-5.2.0.tar.gz) =
67d1a8deb92d3f9245983b09b7593b19c5d43c8fe77cfea893ea9dfb744bcb77b7239d73e4f619450cc6960f4c48fb1c6ba46268208b0f31f855cf1af6bfaa29
+SHA512 (linbox-1.6.3.tar.gz) =
7585f51b46b65a90328b4ff82f7c74eb59510c912a0bb0ce49263f4c7c1e777c0f9961e4672fa36be6fb84035a019b8e212615c363fd62d632e37c327d6ed3c0
SHA512 (lrslib-062.tar.gz) =
78fa6d470b2dd9cb06d1d15023debd8fafc27ed4df93cd90ef746071755f6b1fe9ee2c6a24659030b9a8851bd3ee3a699407586d320f3760c3d8a3a1c79d7116
-SHA512 (mathicgb-1.0.tar.gz) =
de4917f88771e17f0f3446ac4254a142f179bc87cb5596c18c30b4547ff0c1131694a18247d0a6f91cbe39d91590d0dedebd74e6634c3aad344935722c037afc
-SHA512 (mpfr-4.0.2.tar.xz) =
d583555d08863bf36c89b289ae26bae353d9a31f08ee3894520992d2c26e5683c4c9c193d7ad139632f71c0a476d85ea76182702a98bf08dde7b6f65a54f8b88
-SHA512 (mpsolve-3.1.8.tar.gz) =
843ab1e2719600740e95a6f5e740bb6731c7b74039a2d7ccabff680fd455e5a350e0709a3261b551d80da76b49448b9ea9ac480e3a07c03a35576c4eb6746f9e
+SHA512 (M2-emacs-7460c44.tar.gz) =
295e78238300dbefaa82ac0ea5b7d3eb538e2ec5677dd7f0588ee89c515ab29de899a0d1aa11b35f9d5c1e883e6f53059042662579740d43fc980e595100d11c
+SHA512 (mathic-1.0.tar.gz) =
3bf767f77cec8aed0267752f8328d0599b2f4d31c3e4cffea69d9e9aa26a163d6a38e52e5b371e2ffc391f954003008cf734a75440b538d7ae4107ee1dd95f90
+SHA512 (mathicgb-1.0.tar.gz) =
b7fdcbf20dc0bfaa3251bd681f4a61d5bbb16f62f4a577a902ad9bf176c359ad8ab10dd20b6ef06040c9955e149d8e022ce98c15531a6dd339876fa3a187ea68
+SHA512 (memtailor-1.0.tar.gz) =
f3f185200b9f9cd381e9b920f0d6feb4bc721c5235a38b0d68515184430ca2fcb7d1c87762e6489d735d4791bd8cb63eb8bf1400b86e439188df8d9741dea943
+SHA512 (mpfr-4.1.0.tar.xz) =
1bd1c349741a6529dfa53af4f0da8d49254b164ece8a46928cdb13a99460285622d57fe6f68cef19c6727b3f9daa25ddb3d7d65c201c8f387e421c7f7bee6273
+SHA512 (mpsolve-3.2.1.tar.gz) =
8f0cb1be303767bf5a68c150df01c98f7f5e17bfaee685ea4cb9300c0dbf740069c774d647f141a4a1eb46fa54f23d9e75a800ce195cd522527c72e3c6aeed0f
SHA512 (normaliz-3.7.2.tar.gz) =
044a1b5c7e877cdfceedbe6b283b982b66e58f0cc5b0ccf6a63a293044d1348290fde92531b4c4a0a58f5263bb7696a2511b5a1dff94222c9e56a2fe3fccb69b
SHA512 (TOPCOM-0.17.8.tar.gz) =
8611e8bd36eda00646fb40794435f23e6af81ecbee93c40e8fe5f73905e673e6244cb0f8cc1fe5c29050e40c7d53a44c615c60cbbecc8452b3c85f1d8a816d7a