From 6e4937edc339bc2a6710f0fc801436f5fd1796c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Bissey?= Date: Wed, 11 May 2016 22:38:37 +1200 Subject: [PATCH 1/2] Upgrade to ecl 16.1.2: spkg-src and patches. --- build/pkgs/ecl/checksums.ini | 6 +- build/pkgs/ecl/package-version.txt | 2 +- build/pkgs/ecl/patches/src/gmp.patch | 2 +- build/pkgs/ecl/patches/src/implib.patch | 150 +++++++++++------------ build/pkgs/ecl/patches/write_error.patch | 25 ++-- build/pkgs/ecl/spkg-src | 4 +- 6 files changed, 94 insertions(+), 95 deletions(-) diff --git a/build/pkgs/ecl/checksums.ini b/build/pkgs/ecl/checksums.ini index 145f1351a3d..5e56dd5cdda 100644 --- a/build/pkgs/ecl/checksums.ini +++ b/build/pkgs/ecl/checksums.ini @@ -1,4 +1,4 @@ tarball=ecl-VERSION.tar.bz2 -sha1=a2ba6f17df11e77149869d7d71c2175c284778ce -md5=fdca3688a9171518f301e4200f82532a -cksum=3217462385 +sha1=66f99db852b23660668e8c1d5304ec842558d1a2 +md5=14740f65bb971127bb10caaff855361e +cksum=1956945543 diff --git a/build/pkgs/ecl/package-version.txt b/build/pkgs/ecl/package-version.txt index 43747ab3f96..38dc13a4277 100644 --- a/build/pkgs/ecl/package-version.txt +++ b/build/pkgs/ecl/package-version.txt @@ -1 +1 @@ -15.3.7.p1 +16.1.2.p0 diff --git a/build/pkgs/ecl/patches/src/gmp.patch b/build/pkgs/ecl/patches/src/gmp.patch index 50a5a7966ba..362b97e0805 100644 --- a/build/pkgs/ecl/patches/src/gmp.patch +++ b/build/pkgs/ecl/patches/src/gmp.patch @@ -3,7 +3,7 @@ index bc8d84b..e076e09 100644 --- b/src/configure.ac +++ a/src/configure.ac @@ -11,7 +11,7 @@ dnl - AC_INIT([ecl],[15.3.7],[]) + AC_INIT([ecl],[16.1.2],[]) AC_REVISION([$Revision$]) AC_CONFIG_SRCDIR([bare.lsp.in]) -AC_CONFIG_AUX_DIR([gmp]) diff --git a/build/pkgs/ecl/patches/src/implib.patch b/build/pkgs/ecl/patches/src/implib.patch index ab11e189ab7..2d612fb8349 100644 --- a/build/pkgs/ecl/patches/src/implib.patch +++ b/build/pkgs/ecl/patches/src/implib.patch @@ -1,8 +1,27 @@ -diff --git a/src/aclocal.m4 b/src/aclocal.m4 -index 63d8997..79ff24d 100644 ---- a/src/aclocal.m4 -+++ b/src/aclocal.m4 -@@ -233,6 +233,8 @@ AC_SUBST(LIBPREFIX)dnl Name components of a statically linked library +diff -Naur a/src/Makefile.in b/src/Makefile.in +--- a/src/Makefile.in 2016-05-11 13:10:51.816673752 +1200 ++++ b/src/Makefile.in 2016-05-11 13:33:52.743812049 +1200 +@@ -184,10 +184,14 @@ + if test -s $$i ; then \ + if echo $$i | grep dll; then \ + $(INSTALL_LIBRARY) $$i $(DESTDIR)$(bindir); \ +- fi; \ +- $(INSTALL_LIBRARY) $$i $(DESTDIR)$(libdir); \ ++ else \ ++ $(INSTALL_LIBRARY) $$i $(DESTDIR)$(libdir); \ ++ fi \ + fi \ + done ++ if [ "x@IMPLIB_NAME@" != "x" -a -f "@IMPLIB_NAME@" ]; then \ ++ $(INSTALL_LIBRARY) @IMPLIB_NAME@ $(DESTDIR)$(libdir); \ ++ fi + if [ "x@SONAME3@" != "x" -a -f "@SONAME3@" ]; then \ + ( $(INSTALL_LIBRARY) @SONAME3@ $(DESTDIR)$(libdir) && \ + cd $(DESTDIR)$(libdir) && $(RM) -f @SONAME2@ @SONAME1@ @SONAME@ && \ +diff -Naur a/src/aclocal.m4 b/src/aclocal.m4 +--- a/src/aclocal.m4 2016-05-11 13:10:51.816673752 +1200 ++++ b/src/aclocal.m4 2016-05-11 13:27:44.983968151 +1200 +@@ -232,6 +232,8 @@ AC_SUBST(LIBEXT) AC_SUBST(SHAREDEXT)dnl Name components of a dynamically linked library AC_SUBST(SHAREDPREFIX) @@ -11,7 +30,7 @@ index 63d8997..79ff24d 100644 AC_SUBST(OBJEXT)dnl These are set by autoconf AC_SUBST(EXEEXT) AC_SUBST(INSTALL_TARGET)dnl Which type of installation: flat directory or unix like. -@@ -242,6 +244,8 @@ ECL_GC_DIR=gc-unstable +@@ -241,6 +243,8 @@ ECL_LDRPATH='' SHAREDEXT='so' SHAREDPREFIX='lib' @@ -20,55 +39,56 @@ index 63d8997..79ff24d 100644 LIBPREFIX='lib' LIBEXT='a' PICFLAG='-fPIC' -@@ -253,6 +257,8 @@ THREAD_OBJ="$THREAD_OBJ threads/process threads/queue threads/mutex threads/cond +@@ -252,6 +256,8 @@ clibs='' SONAME='' SONAME_LDFLAGS='' +IMPLIB_NAME='' +IMPLIB_LDFLAGS='' case "${host_os}" in - # libdir may have a dollar expression inside - linux*) -@@ -355,10 +361,14 @@ case "${host_os}" in - shared='yes' - THREAD_CFLAGS='-D_THREAD_SAFE' - THREAD_LIBS='-lpthread' -- SHARED_LDFLAGS="-shared ${LDFLAGS}" -- BUNDLE_LDFLAGS="-shared ${LDFLAGS}" -- SHAREDPREFIX='' -+ SHARED_LDFLAGS="-shared -Wl,--enable-auto-image-base ${LDFLAGS}" -+ BUNDLE_LDFLAGS="-shared -Wl,--enable-auto-image-base ${LDFLAGS}" -+ SHAREDPREFIX='cyg' - SHAREDEXT='dll' -+ IMPLIB_PREFIX='lib' -+ IMPLIB_EXT='dll.a' -+ IMPLIB_NAME="${IMPLIB_PREFIX}ecl.${IMPLIB_EXT}" -+ IMPLIB_LDFLAGS="-Wl,--out-implib,${IMPLIB_NAME}" - PICFLAG='' - if test "x$host_cpu" = "xx86_64" ; then - # Our GMP library is too old and does not support -@@ -373,10 +383,14 @@ case "${host_os}" in + linux-androideabi) + thehost='android' +@@ -369,10 +375,14 @@ + shared='yes' + THREAD_CFLAGS='-D_THREAD_SAFE' + THREAD_LIBS='-lpthread' +- SHARED_LDFLAGS="-shared ${LDFLAGS}" +- BUNDLE_LDFLAGS="-shared ${LDFLAGS}" +- SHAREDPREFIX='' ++ SHARED_LDFLAGS="-shared -Wl,--enable-auto-image-base ${LDFLAGS}" ++ BUNDLE_LDFLAGS="-shared -Wl,--enable-auto-image-base ${LDFLAGS}" ++ SHAREDPREFIX='cyg' + SHAREDEXT='dll' ++ IMPLIB_PREFIX='lib' ++ IMPLIB_EXT='dll.a' ++ IMPLIB_NAME="${IMPLIB_PREFIX}ecl.${IMPLIB_EXT}" ++ IMPLIB_LDFLAGS="-Wl,--out-implib,${IMPLIB_NAME}" + PICFLAG='' + if test "x$host_cpu" = "xx86_64" ; then + # Our GMP library is too old and does not support +@@ -387,11 +397,15 @@ enable_threads='yes' - THREAD_CFLAGS='-D_THREAD_SAFE' - THREAD_GC_FLAGS='--enable-threads=win32' -- SHARED_LDFLAGS='' -- BUNDLE_LDFLAGS='' -+ SHARED_LDFLAGS="-shared -Wl,--enable-auto-image-base ${LDFLAGS}" -+ BUNDLE_LDFLAGS="-shared -Wl,--enable-auto-image-base ${LDFLAGS}" - SHAREDPREFIX='' - SHAREDEXT='dll' -+ IMPLIB_PREFIX='lib' -+ IMPLIB_EXT='dll.a' -+ IMPLIB_NAME="${IMPLIB_PREFIX}ecl.${IMPLIB_EXT}" -+ IMPLIB_LDFLAGS="-Wl,--out-implib,${IMPLIB_NAME}" - PICFLAG='' - INSTALL_TARGET='flatinstall' - TCPLIBS='-lws2_32' -diff --git a/src/compile.lsp.in b/src/compile.lsp.in -index 773fe99..697c115 100755 ---- a/src/compile.lsp.in -+++ b/src/compile.lsp.in -@@ -58,7 +58,7 @@ + THREAD_CFLAGS='-D_THREAD_SAFE' + THREAD_GC_FLAGS='--enable-threads=win32' +- SHARED_LDFLAGS='' +- BUNDLE_LDFLAGS='' ++ SHARED_LDFLAGS="-shared -Wl,--enable-auto-image-base ${LDFLAGS}" ++ BUNDLE_LDFLAGS="-shared -Wl,--enable-auto-image-base ${LDFLAGS}" + SHAREDPREFIX='' + SHAREDEXT='dll' +- PICFLAG='' ++ IMPLIB_PREFIX='lib' ++ IMPLIB_EXT='dll.a' ++ IMPLIB_NAME="${IMPLIB_PREFIX}ecl.${IMPLIB_EXT}" ++ IMPLIB_LDFLAGS="-Wl,--out-implib,${IMPLIB_NAME}" ++ PICFLAG='' + INSTALL_TARGET='flatinstall' + TCPLIBS='-lws2_32' + ;; +diff -Naur a/src/compile.lsp.in b/src/compile.lsp.in +--- a/src/compile.lsp.in 2016-05-11 13:10:51.888673915 +1200 ++++ b/src/compile.lsp.in 2016-05-11 13:30:13.270308872 +1200 +@@ -61,7 +61,7 @@ ;;; ;;; * Add include path to not yet installed headers, and remove include flag ;;; (-I) to installed directory, and Notice that we must explicitely mention @@ -77,20 +97,19 @@ index 773fe99..697c115 100755 ;;; with an already installed copy of ECL. ;;; (setq c::*cc-flags* -@@ -140,7 +140,7 @@ +@@ -143,7 +143,7 @@ ;;; ;;; We do not need the -rpath flag for the library, nor -lecl. ;;; -(let* ((c::*ld-shared-flags* #-msvc "@SHARED_LDFLAGS@ @LDFLAGS@ @SONAME_LDFLAGS@ @CORE_LIBS@ @FASL_LIBS@ @LIBS@" +(let* ((c::*ld-shared-flags* #-msvc " @IMPLIB_LDFLAGS@ @SHARED_LDFLAGS@ @LDFLAGS@ @SONAME_LDFLAGS@ @CORE_LIBS@ @FASL_LIBS@ @LIBS@" - #+msvc "@SHARED_LDFLAGS@ @LDFLAGS@ @STATICLIBS@ @CLIBS@") + #+msvc "@SHARED_LDFLAGS@ @LDFLAGS@ @STATICLIBS@ @CLIBS@") (c::*cc-flags* (concatenate 'string "-DECL_API -I@true_builddir@/c " c::*cc-flags*)) (extra-args nil)) -diff --git a/src/configure.ac b/src/configure.ac -index e076e09..15d307a 100644 ---- a/src/configure.ac -+++ b/src/configure.ac -@@ -588,6 +588,20 @@ AC_SUBST(SONAME1) +diff -Naur a/src/configure.ac b/src/configure.ac +--- a/src/configure.ac 2016-05-11 13:10:51.889673917 +1200 ++++ b/src/configure.ac 2016-05-11 13:19:07.721791089 +1200 +@@ -600,6 +600,20 @@ AC_SUBST(SONAME) AC_SUBST(SONAME_LDFLAGS) @@ -111,24 +130,3 @@ index e076e09..15d307a 100644 dnl Related to that, the package version number ECL_VERSION_NUMBER=$(($PACKAGE_MAJOR * 10000 + $PACKAGE_MINOR * 100 + $PACKAGE_LEAST)) AC_SUBST(ECL_VERSION_NUMBER) -diff --git a/src/Makefile.in b/src/Makefile.in -index 12e9f05..74bc216 100644 ---- a/src/Makefile.in -+++ b/src/Makefile.in -@@ -174,10 +174,14 @@ install: - if test -s $$i ; then \ - if echo $$i | grep dll; then \ - $(INSTALL_LIBRARY) $$i $(DESTDIR)$(bindir); \ -- fi; \ -- $(INSTALL_LIBRARY) $$i $(DESTDIR)$(libdir); \ -+ else \ -+ $(INSTALL_LIBRARY) $$i $(DESTDIR)$(libdir); \ -+ fi \ - fi \ - done -+ if [ "x@IMPLIB_NAME@" != "x" -a -f "@IMPLIB_NAME@" ]; then \ -+ $(INSTALL_LIBRARY) @IMPLIB_NAME@ $(DESTDIR)$(libdir); \ -+ fi - if [ "x@SONAME@" != "x" -a -f "@SONAME@" ]; then \ - ( cd $(DESTDIR)$(libdir) && $(RM) -f @SONAME3@ @SONAME2@ @SONAME1@ && \ - mv @SONAME@ @SONAME3@ && \ diff --git a/build/pkgs/ecl/patches/write_error.patch b/build/pkgs/ecl/patches/write_error.patch index 658b864a606..7f09fbe9a92 100644 --- a/build/pkgs/ecl/patches/write_error.patch +++ b/build/pkgs/ecl/patches/write_error.patch @@ -1,15 +1,16 @@ -diff --git b/src/c/file.d a/src/c/file.d -index de7ba7b..c1f8c1e 100755 ---- b/src/c/file.d -+++ a/src/c/file.d -@@ -3341,7 +3341,9 @@ output_stream_write_byte8(cl_object strm, unsigned char *c, cl_index n) - ecl_disable_interrupts(); - do { - out = fwrite(c, sizeof(char), n, IO_STREAM_FILE(strm)); -- } while (out < n && restartable_io_error(strm, "fwrite")); -+ /* Ignore write errors to stderr to avoid an infinite loop */ +diff -Naur ecl-16.1.2.orig/src/c/file.d ecl-16.1.2/src/c/file.d +--- ecl-16.1.2.orig/src/c/file.d 2016-05-11 13:10:51.867673867 +1200 ++++ ecl-16.1.2/src/c/file.d 2016-05-11 14:44:48.121907307 +1200 +@@ -3354,8 +3354,10 @@ + ecl_disable_interrupts(); + do { + out = fwrite(c, sizeof(char), n, IO_STREAM_FILE(strm)); +- } while (out < n && restartable_io_error(strm, "fwrite")); +- ecl_enable_interrupts(); ++ /* Ignore write errors to stderr to avoid an infinite loop */ + } while (out < n && (IO_STREAM_FILE(strm) != stderr) && restartable_io_error(strm, "fwrite")); + - ecl_enable_interrupts(); - return out; ++ ecl_enable_interrupts(); + return out; } + diff --git a/build/pkgs/ecl/spkg-src b/build/pkgs/ecl/spkg-src index d0cb70c6a0c..6333c7f3c8c 100755 --- a/build/pkgs/ecl/spkg-src +++ b/build/pkgs/ecl/spkg-src @@ -31,7 +31,7 @@ ECLTARBALL="$SAGE_DISTFILES/ecl-$ECLVERSION.tar.bz2" rm -rf ecl-* # Download and extract upstream tarball -sage-download-file https://common-lisp.net/project/ecl/files/release/$ECLVERSION/ecl-$ECLVERSION.tgz |tar xz +sage-download-file https://common-lisp.net/project/ecl/static/files/release/ecl-$ECLVERSION.tgz |tar xz cd ecl-$ECLVERSION # Some patches are applied here, if they need to be applied before @@ -44,7 +44,7 @@ for patch in ../patches/src/*.patch; do done # Remove unneeded files to save space -rm -r msvc src/gc-unstable src/gmp/ src/libffi +rm -r msvc src/gmp/ src/libffi # Run autotools cd src From f7973e0215aa55d30b568d2cf21101c44e9003ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Bissey?= Date: Wed, 11 May 2016 22:47:47 +1200 Subject: [PATCH 2/2] fix formatting and numerical noise in doctest --- src/sage/calculus/calculus.py | 2 +- src/sage/interfaces/interface.py | 4 ++-- src/sage/interfaces/maxima_abstract.py | 2 +- src/sage/modules/free_module_element.pyx | 4 ++-- src/sage/tests/french_book/integration_doctest.py | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py index 95fd22add37..7794328c82c 100644 --- a/src/sage/calculus/calculus.py +++ b/src/sage/calculus/calculus.py @@ -723,7 +723,7 @@ def nintegral(ex, x, a, b, Now numerically integrating, we see why the answer is wrong:: sage: f.nintegrate(x,0,1) - (-480.0000000000001, 5.329070518200754e-12, 21, 0) + (-480.0000000000001, 5.32907051820075e-12, 21, 0) It is just because every floating point evaluation of return -480.0 in floating point. diff --git a/src/sage/interfaces/interface.py b/src/sage/interfaces/interface.py index a9b0f00e232..6ecd5aede2c 100644 --- a/src/sage/interfaces/interface.py +++ b/src/sage/interfaces/interface.py @@ -521,9 +521,9 @@ def function_call(self, function, args=None, kwds=None): EXAMPLES:: sage: maxima.quad_qags(x, x, 0, 1, epsrel=1e-4) - [0.5,5.5511151231257...e-15,21,0] + [0.5,0.55511151231257...e-14,21,0] sage: maxima.function_call('quad_qags', [x, x, 0, 1], {'epsrel':'1e-4'}) - [0.5,5.5511151231257...e-15,21,0] + [0.5,0.55511151231257...e-14,21,0] """ args, kwds = self._convert_args_kwds(args, kwds) self._check_valid_function_name(function) diff --git a/src/sage/interfaces/maxima_abstract.py b/src/sage/interfaces/maxima_abstract.py index 98623ef76ea..9cb9836f0ee 100644 --- a/src/sage/interfaces/maxima_abstract.py +++ b/src/sage/interfaces/maxima_abstract.py @@ -1518,7 +1518,7 @@ def nintegral(self, var='x', a=0, b=1, EXAMPLES:: sage: maxima('exp(-sqrt(x))').nintegral('x',0,1) - (0.5284822353142306, 4.16331413788384...e-11, 231, 0) + (0.5284822353142306, 0.41633141378838...e-10, 231, 0) Note that GP also does numerical integration, and can do so to very high precision very quickly:: diff --git a/src/sage/modules/free_module_element.pyx b/src/sage/modules/free_module_element.pyx index 5fac41e73b3..8a2904801c2 100644 --- a/src/sage/modules/free_module_element.pyx +++ b/src/sage/modules/free_module_element.pyx @@ -3857,11 +3857,11 @@ cdef class FreeModuleElement(Vector): # abstract base class sage: type(vec) sage: answers - [(0.5, 5.551115123125784e-15, 21, 0), (0.3333333333333..., 3.70074341541719e-15, 21, 0), (0.45969769413186..., 5.103669643922841e-15, 21, 0)] + [(0.5, 5.55111512312578e-15, 21, 0), (0.3333333333333..., 3.70074341541719e-15, 21, 0), (0.45969769413186..., 5.10366964392284e-15, 21, 0)] sage: r=vector([t,0,1], sparse=True) sage: r.nintegral(t,0,1) - ((0.5, 0.0, 1.0), {0: (0.5, 5.551115123125784e-15, 21, 0), 2: (1.0, 1.11022302462515...e-14, 21, 0)}) + ((0.5, 0.0, 1.0), {0: (0.5, 5.55111512312578e-15, 21, 0), 2: (1.0, 1.11022302462515...e-14, 21, 0)}) """ # If Cython supported lambda functions, we would just do diff --git a/src/sage/tests/french_book/integration_doctest.py b/src/sage/tests/french_book/integration_doctest.py index 83a1863bba6..0c28098d295 100644 --- a/src/sage/tests/french_book/integration_doctest.py +++ b/src/sage/tests/french_book/integration_doctest.py @@ -68,13 +68,13 @@ Sage example in ./integration.tex, line 430:: sage: sage.calculus.calculus.nintegral(sin(sin(x)), x, 0, 1) - (0.430606103120690..., 4.780688102287053...e-15, 21, 0) + (0.430606103120690..., 4.78068810228705...e-15, 21, 0) Sage example in ./integration.tex, line 436:: sage: g(x) = sin(sin(x)) sage: g.nintegral(x, 0, 1) - (0.430606103120690..., 4.780688102287053...e-15, 21, 0) + (0.430606103120690..., 4.78068810228705...e-15, 21, 0) Sage example in ./integration.tex, line 465::