Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 3917048

Browse files
committed
Merge branch 'develop' of git://trac.sagemath.org/sage into rank_metric
2 parents 1e32a0c + 7d561d8 commit 3917048

File tree

76 files changed

+3655
-1495
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+3655
-1495
lines changed

VERSION.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
SageMath version 8.9.beta6, Release Date: 2019-08-10
1+
SageMath version 8.9.beta7, Release Date: 2019-08-18

build/pkgs/configure/checksums.ini

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
tarball=configure-VERSION.tar.gz
2-
sha1=e9fc4a6b98663c0f625707d699638017b65688ae
3-
md5=fe7bb18c282553543c98688e78dab7d0
4-
cksum=3711812649
2+
sha1=e1f5fb67f8895c261043e4203c654772c15011e9
3+
md5=cb0bcc975697113d75adad861af22570
4+
cksum=593852789
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
442411009b7c99f34315b76fe35ad092aa3a6962
1+
8c985712aebdb887c2e66308af1d29907a6fc242

build/pkgs/eclib/spkg-configure.m4

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
SAGE_SPKG_CONFIGURE([eclib], [
2+
AC_REQUIRE([SAGE_SPKG_CONFIGURE_NTL])
3+
AC_REQUIRE([SAGE_SPKG_CONFIGURE_PARI])
4+
AC_MSG_CHECKING([installing ntl or pari? ])
5+
if test x$sage_spkg_install_ntl = xyes -o x$sage_spkg_install_pari = xyes; then
6+
AC_MSG_RESULT([yes; install eclib as well])
7+
sage_spkg_install_eclib=yes
8+
else
9+
dnl header types.h appeared in v20180710
10+
AC_CHECK_HEADER([eclib/types.h], [
11+
AC_MSG_CHECKING([whether we can link and run a program using eclib])
12+
ECLIB_SAVED_LIBS=$LIBS
13+
LIBS="$LIBS -lec"
14+
AC_RUN_IFELSE([
15+
AC_LANG_PROGRAM([[#include <eclib/version.h>]
16+
[#include <eclib/interface.h>]],
17+
[[set_bit_precision(42); /* test for versions >= v20190226 */
18+
show_version();
19+
return 0;]]
20+
)], [AC_MSG_RESULT([yes; use eclib from the system])], [
21+
AC_MSG_RESULT([no; install eclib])
22+
sage_spkg_install_eclib=yes
23+
LIBS=$ECLIB_SAVED_LIBS
24+
])
25+
], [sage_spkg_install_eclib=yes])
26+
fi
27+
])

build/pkgs/eclib/spkg-install

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ cd src/
2929

3030

3131
sdh_configure $SAGE_CONFIGURE_NTL \
32-
--with-pari="$SAGE_LOCAL" \
33-
$SAGE_CONFIGURE_FLINT \
32+
$SAGE_CONFIGURE_PARI \
33+
--with-flint=$SAGE_FLINT_PREFIX \
3434
--with-boost="no" \
3535
--disable-allprogs
3636
sdh_make

build/pkgs/gap/package-version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.10.2.p0
1+
4.10.2.p1

build/pkgs/gap/patches/3435.patch

+246
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
Patch for https://trac.sagemath.org/ticket/27724
2+
Can be removed when updating to GAP >= 4.11
3+
From abd23b1360bc569fca9bbb36e2fc167d55c7a872 Mon Sep 17 00:00:00 2001
4+
From: "Erik M. Bray" <[email protected]>
5+
Date: Thu, 2 May 2019 16:03:15 +0200
6+
Subject: [PATCH 1/5] Initial fix for #3434: Add ENSURE_BAG helper which
7+
ensures memory is really committed by the OS for a new bag.
8+
9+
Call ENSURE_BAG on new bags created in integer.c if they might be
10+
passed as an argument to a GMP function.
11+
---
12+
src/gasman.h | 12 ++++++++++++
13+
src/integer.c | 9 +++++++++
14+
2 files changed, 21 insertions(+)
15+
16+
diff --git a/src/gasman.h b/src/gasman.h
17+
index 62d637baa9..e8c3d9eca1 100644
18+
--- a/src/gasman.h
19+
+++ b/src/gasman.h
20+
@@ -553,6 +553,18 @@ EXPORT_INLINE UInt ResizeWordSizedBag(Bag bag, UInt size)
21+
}
22+
23+
24+
+#if defined(SYS_IS_CYGWIN32) && defined(SYS_IS_64_BIT)
25+
+EXPORT_INLINE void ENSURE_BAG(Bag bag)
26+
+{
27+
+ memset(PTR_BAG(bag), 0, SIZE_BAG(bag));
28+
+}
29+
+#else
30+
+EXPORT_INLINE void ENSURE_BAG(Bag bag)
31+
+{
32+
+}
33+
+#endif
34+
+
35+
+
36+
/****************************************************************************
37+
**
38+
*F CollectBags(<size>,<full>) . . . . . . . . . . . . . . collect dead bags
39+
diff --git a/src/integer.c b/src/integer.c
40+
index c15acdb415..ed740684ca 100644
41+
--- a/src/integer.c
42+
+++ b/src/integer.c
43+
@@ -274,6 +274,7 @@ static void NEW_FAKEMPZ( fake_mpz_t fake, UInt size )
44+
}
45+
else {
46+
fake->obj = NewBag( T_INTPOS, size * sizeof(mp_limb_t) );
47+
+ ENSURE_BAG(fake->obj);
48+
}
49+
}
50+
51+
@@ -1789,9 +1790,11 @@ Obj ModInt(Obj opL, Obj opR)
52+
}
53+
54+
mod = NewBag( TNUM_OBJ(opL), (SIZE_INT(opL)+1)*sizeof(mp_limb_t) );
55+
+ ENSURE_BAG(mod);
56+
57+
quo = NewBag( T_INTPOS,
58+
(SIZE_INT(opL)-SIZE_INT(opR)+1)*sizeof(mp_limb_t) );
59+
+ ENSURE_BAG(quo);
60+
61+
/* and let gmp do the work */
62+
mpn_tdiv_qr( (mp_ptr)ADDR_INT(quo), (mp_ptr)ADDR_INT(mod), 0,
63+
@@ -1888,6 +1891,8 @@ Obj QuoInt(Obj opL, Obj opR)
64+
quo = NewBag( T_INTPOS, SIZE_OBJ(opL) );
65+
else
66+
quo = NewBag( T_INTNEG, SIZE_OBJ(opL) );
67+
+
68+
+ ENSURE_BAG(quo);
69+
70+
if ( k < 0 ) k = -k;
71+
72+
@@ -1906,6 +1911,7 @@ Obj QuoInt(Obj opL, Obj opR)
73+
74+
/* create a new bag for the remainder */
75+
rem = NewBag( TNUM_OBJ(opL), (SIZE_INT(opL)+1)*sizeof(mp_limb_t) );
76+
+ ENSURE_BAG(rem);
77+
78+
/* allocate a bag for the quotient */
79+
if ( TNUM_OBJ(opL) == TNUM_OBJ(opR) )
80+
@@ -1914,6 +1920,7 @@ Obj QuoInt(Obj opL, Obj opR)
81+
else
82+
quo = NewBag( T_INTNEG,
83+
(SIZE_INT(opL)-SIZE_INT(opR)+1)*sizeof(mp_limb_t) );
84+
+ ENSURE_BAG(quo);
85+
86+
mpn_tdiv_qr( (mp_ptr)ADDR_INT(quo), (mp_ptr)ADDR_INT(rem), 0,
87+
(mp_srcptr)CONST_ADDR_INT(opL), SIZE_INT(opL),
88+
@@ -2035,9 +2042,11 @@ Obj RemInt(Obj opL, Obj opR)
89+
return opL;
90+
91+
rem = NewBag( TNUM_OBJ(opL), (SIZE_INT(opL)+1)*sizeof(mp_limb_t) );
92+
+ ENSURE_BAG(rem);
93+
94+
quo = NewBag( T_INTPOS,
95+
(SIZE_INT(opL)-SIZE_INT(opR)+1)*sizeof(mp_limb_t) );
96+
+ ENSURE_BAG(quo);
97+
98+
/* and let gmp do the work */
99+
mpn_tdiv_qr( (mp_ptr)ADDR_INT(quo), (mp_ptr)ADDR_INT(rem), 0,
100+
101+
From 95324a2b978444ccd783b16cf50625b390107d97 Mon Sep 17 00:00:00 2001
102+
From: "Erik M. Bray" <[email protected]>
103+
Date: Fri, 3 May 2019 14:19:57 +0200
104+
Subject: [PATCH 2/5] Just limit the scope of ENSURE_BAG to integer.c for now
105+
since it's the only known use case.
106+
107+
---
108+
src/gasman.h | 12 ------------
109+
src/integer.c | 10 +++++++++-
110+
2 files changed, 9 insertions(+), 13 deletions(-)
111+
112+
diff --git a/src/gasman.h b/src/gasman.h
113+
index e8c3d9eca1..62d637baa9 100644
114+
--- a/src/gasman.h
115+
+++ b/src/gasman.h
116+
@@ -553,18 +553,6 @@ EXPORT_INLINE UInt ResizeWordSizedBag(Bag bag, UInt size)
117+
}
118+
119+
120+
-#if defined(SYS_IS_CYGWIN32) && defined(SYS_IS_64_BIT)
121+
-EXPORT_INLINE void ENSURE_BAG(Bag bag)
122+
-{
123+
- memset(PTR_BAG(bag), 0, SIZE_BAG(bag));
124+
-}
125+
-#else
126+
-EXPORT_INLINE void ENSURE_BAG(Bag bag)
127+
-{
128+
-}
129+
-#endif
130+
-
131+
-
132+
/****************************************************************************
133+
**
134+
*F CollectBags(<size>,<full>) . . . . . . . . . . . . . . collect dead bags
135+
diff --git a/src/integer.c b/src/integer.c
136+
index ed740684ca..8120bd44c9 100644
137+
--- a/src/integer.c
138+
+++ b/src/integer.c
139+
@@ -141,7 +141,15 @@ static Obj ObjInt_UIntInv( UInt i );
140+
141+
GAP_STATIC_ASSERT( sizeof(mp_limb_t) == sizeof(UInt), "gmp limb size incompatible with GAP word size");
142+
143+
-
144+
+
145+
+static inline void ENSURE_BAG(Bag bag)
146+
+{
147+
+#if defined(SYS_IS_CYGWIN32) && defined(SYS_IS_64_BIT)
148+
+ memset(PTR_BAG(bag), 0, SIZE_BAG(bag));
149+
+#endif
150+
+}
151+
+
152+
+
153+
/* for fallbacks to library */
154+
static Obj String;
155+
static Obj OneAttr;
156+
157+
From f29a42c60e81732aabda0d0ab11fffdd26da059d Mon Sep 17 00:00:00 2001
158+
From: "Erik M. Bray" <[email protected]>
159+
Date: Fri, 3 May 2019 14:32:36 +0200
160+
Subject: [PATCH 3/5] Add inline documentation for ENSURE_BAG and when/how it
161+
should be used.
162+
163+
---
164+
src/integer.c | 17 +++++++++++++++++
165+
1 file changed, 17 insertions(+)
166+
167+
diff --git a/src/integer.c b/src/integer.c
168+
index 8120bd44c9..4c5cf683d8 100644
169+
--- a/src/integer.c
170+
+++ b/src/integer.c
171+
@@ -142,6 +142,23 @@ static Obj ObjInt_UIntInv( UInt i );
172+
GAP_STATIC_ASSERT( sizeof(mp_limb_t) == sizeof(UInt), "gmp limb size incompatible with GAP word size");
173+
174+
175+
+/* This ensures that all memory underlying a bag is actually committed
176+
+** to physical memory and can be written to.
177+
+** This is a workaround to a bug specific to Cygwin 64-bit and bad
178+
+** interaction with GMP, so this is only needed specifically for new
179+
+** bags created in this module to hold the outputs of GMP routines.
180+
+**
181+
+** Thus, any time NewBag is called, it is also necessary to call
182+
+** ENSURE_BAG(bag) on the newly created bag if some GMP function will be
183+
+** the first place that bag's data is written to.
184+
+**
185+
+** To give a counter-example, ENSURE_BAG is *not* needed in ObjInt_Int,
186+
+** because it just creates a bag to hold a single mp_limb_t, and
187+
+** immediately assigns it a value.
188+
+**
189+
+** The bug this works around is explained more in
190+
+** https://github.com/gap-system/gap/issues/3434
191+
+*/
192+
static inline void ENSURE_BAG(Bag bag)
193+
{
194+
#if defined(SYS_IS_CYGWIN32) && defined(SYS_IS_64_BIT)
195+
196+
From 1a6eb168f005ddd1fe6d5591be310112aa4de393 Mon Sep 17 00:00:00 2001
197+
From: "Erik M. Bray" <[email protected]>
198+
Date: Fri, 3 May 2019 14:36:19 +0200
199+
Subject: [PATCH 4/5] Disable the workaround if gmp.h comes from MPIR, in which
200+
case __MPIR_VERSION should be defined.
201+
202+
---
203+
src/integer.c | 3 ++-
204+
1 file changed, 2 insertions(+), 1 deletion(-)
205+
206+
diff --git a/src/integer.c b/src/integer.c
207+
index 4c5cf683d8..b31c5f3d65 100644
208+
--- a/src/integer.c
209+
+++ b/src/integer.c
210+
@@ -161,7 +161,8 @@ GAP_STATIC_ASSERT( sizeof(mp_limb_t) == sizeof(UInt), "gmp limb size incompatibl
211+
*/
212+
static inline void ENSURE_BAG(Bag bag)
213+
{
214+
-#if defined(SYS_IS_CYGWIN32) && defined(SYS_IS_64_BIT)
215+
+// Note: This workaround is only required with the original GMP and not with MPIR
216+
+#if defined(SYS_IS_CYGWIN32) && defined(SYS_IS_64_BIT) && !defined(__MPIR_VERSION)
217+
memset(PTR_BAG(bag), 0, SIZE_BAG(bag));
218+
#endif
219+
}
220+
221+
From 95a011a793a326f14a0b63d5f53044d9f8d330bb Mon Sep 17 00:00:00 2001
222+
From: "Erik M. Bray" <[email protected]>
223+
Date: Fri, 3 May 2019 12:33:03 +0000
224+
Subject: [PATCH 5/5] clang-format tweaks
225+
226+
---
227+
src/integer.c | 6 ++++--
228+
1 file changed, 4 insertions(+), 2 deletions(-)
229+
230+
diff --git a/src/integer.c b/src/integer.c
231+
index b31c5f3d65..b34d6c382b 100644
232+
--- a/src/integer.c
233+
+++ b/src/integer.c
234+
@@ -161,8 +161,10 @@ GAP_STATIC_ASSERT( sizeof(mp_limb_t) == sizeof(UInt), "gmp limb size incompatibl
235+
*/
236+
static inline void ENSURE_BAG(Bag bag)
237+
{
238+
-// Note: This workaround is only required with the original GMP and not with MPIR
239+
-#if defined(SYS_IS_CYGWIN32) && defined(SYS_IS_64_BIT) && !defined(__MPIR_VERSION)
240+
+// Note: This workaround is only required with the original GMP and not with
241+
+// MPIR
242+
+#if defined(SYS_IS_CYGWIN32) && defined(SYS_IS_64_BIT) && \
243+
+ !defined(__MPIR_VERSION)
244+
memset(PTR_BAG(bag), 0, SIZE_BAG(bag));
245+
#endif
246+
}

build/pkgs/gp2c/spkg-configure.m4

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
SAGE_SPKG_CONFIGURE([gp2c], [
2+
AC_REQUIRE([SAGE_SPKG_CONFIGURE_PARI])
3+
AC_MSG_CHECKING([installing pari? ])
4+
if test x$sage_spkg_install_pari = xyes; then
5+
AC_MSG_RESULT([yes; install gp2c as well])
6+
sage_spkg_install_gp2c=yes
7+
libpari_pari_cfg='$SAGE_LOCAL/lib/pari/pari.cfg'
8+
AC_MSG_NOTICE([pari.cfg is $libpari_pari_cfg ])
9+
else
10+
AC_MSG_RESULT([no])
11+
AC_PATH_PROG([GP2C], [gp2c])
12+
if test x$GP2C = x; then
13+
AC_MSG_NOTICE([using pari/gp from the system, but building gp2c])
14+
AC_MSG_NOTICE([one might prefer to install a system-wide gp2c, instead])
15+
AC_MSG_NOTICE([and re-run configure.])
16+
dnl need to figure out libpari prefix
17+
gp_prefix=`dirname $GP`
18+
gp_prefix=`dirname $gp_prefix`
19+
AC_MSG_NOTICE([gp prefix is $gp_prefix ])
20+
libpari_pari_cfg=`find $gp_prefix -name pari.cfg`
21+
AC_MSG_NOTICE([pari.cfg is $libpari_pari_cfg ])
22+
sage_spkg_install_gp2c=yes
23+
fi
24+
fi
25+
], [], [], [
26+
if test x$sage_spkg_install_gp2c = xyes; then
27+
AC_SUBST(SAGE_PARI_CFG, [$libpari_pari_cfg])
28+
AC_MSG_RESULT([using Sage's gp2c SPKG])
29+
else
30+
AC_SUBST(SAGE_PARI_CFG, [''])
31+
AC_MSG_RESULT([using gp2c from the system])
32+
fi
33+
])

build/pkgs/gp2c/spkg-install

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
cd src
2-
sdh_configure --with-paricfg="$SAGE_LOCAL/lib/pari/pari.cfg"
2+
sdh_configure --with-paricfg=$SAGE_PARI_CFG
33
sdh_make
44
sdh_make_install

build/pkgs/isl/spkg-configure.m4

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
SAGE_SPKG_CONFIGURE([isl], [
2+
AC_REQUIRE([SAGE_SPKG_CONFIGURE_GMP])
3+
AC_MSG_CHECKING([installing gmp/mpir? ])
4+
if test x$sage_spkg_install_mpir = xyes -o x$sage_spkg_install_gmp = xyes; then
5+
AC_MSG_RESULT([yes; install isl as well])
6+
sage_spkg_install_isl=yes
7+
else
8+
AC_MSG_RESULT([no])
9+
PKG_CHECK_MODULES([ISL], [isl >= 0.20], [], [
10+
sage_spkg_install_isl=yes])
11+
fi
12+
])
13+

build/pkgs/ntl/spkg-configure.m4

+4-5
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,15 @@ SAGE_SPKG_CONFIGURE([ntl], [
1414
if test x$sage_spkg_install_ntl != xyes; then
1515
AC_CHECK_HEADER([NTL/ZZ.h], [], [sage_spkg_install_ntl=yes])
1616
AC_MSG_CHECKING([whether we can link a program using NTL])
17-
NTL_SAVED_LDFLAGS=$LDFLAGS
18-
LDFLAGS="$LDFLAGS -lntl"
17+
NTL_SAVED_LIBS=$LIBS
18+
LIBS="$LIBS -lntl"
1919
AC_LINK_IFELSE([
2020
AC_LANG_PROGRAM([[#include <NTL/ZZ.h>]],
2121
[[NTL::ZZ a;]]
22-
)], [LIBS="$LIBS -lntl"]
23-
[AC_MSG_RESULT([yes])], [
22+
)], [AC_MSG_RESULT([yes])], [
2423
AC_MSG_RESULT([no]); sage_spkg_install_ntl=yes
24+
LIBS=$NTL_SAVED_LIBS
2525
])
26-
LDFLAGS=$NTL_SAVED_LDFLAGS
2726
AC_MSG_CHECKING([NTL version >= ]SAGE_NTL_VERSION_MAJOR[.]SAGE_NTL_VERSION_MINOR)
2827
AC_RUN_IFELSE([
2928
AC_LANG_PROGRAM(

0 commit comments

Comments
 (0)