Date: Monday, September 30, 2019 @ 06:58:23 Author: arojas Revision: 512151
Update to 8.9 Modified: sagemath/trunk/PKGBUILD sagemath/trunk/latte-count.patch sagemath/trunk/sagemath-cremona.patch sagemath/trunk/sagemath-python3-notebook.patch Deleted: sagemath/trunk/meataxe-tables.patch sagemath/trunk/sagemath-env.patch sagemath/trunk/sagemath-linbox-1.6.patch sagemath/trunk/sagemath-threejs-dir-structure.patch sagemath/trunk/sagemath-threejs.patch --------------------------------------+ PKGBUILD | 36 - latte-count.patch | 8 meataxe-tables.patch | 34 - sagemath-cremona.patch | 8 sagemath-env.patch | 141 ------- sagemath-linbox-1.6.patch | 650 --------------------------------- sagemath-python3-notebook.patch | 67 +++ sagemath-threejs-dir-structure.patch | 40 -- sagemath-threejs.patch | 11 9 files changed, 80 insertions(+), 915 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2019-09-30 06:15:10 UTC (rev 512150) +++ PKGBUILD 2019-09-30 06:58:23 UTC (rev 512151) @@ -7,8 +7,8 @@ pkgbase=sagemath pkgname=(sagemath sagemath-jupyter) -pkgver=8.8 -pkgrel=11 +pkgver=8.9 +pkgrel=1 pkgdesc="Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab" arch=(x86_64) url="http://www.sagemath.org" @@ -20,7 +20,7 @@ iml libgiac libhomfly libbraiding symmetrica three.js) optdepends=('cython2: to compile cython code' 'python2-pkgconfig: to compile cython code' 'jmol: 3D plots' 'sage-notebook: Flask notebook interface (deprecated)' - 'sagemath-doc: Documentation and inline help' 'python2-igraph: igraph backend for graph theory' + 'sagemath-doc: HTML documentation' 'python2-igraph: igraph backend for graph theory' 'coin-or-cbc: COIN backend for numerical computations' 'coin-or-csdp: for computing Lovász theta-function of graphs' 'buckygen: for generating fullerene graphs' 'plantri: for generating some classes of graphs' 'benzene: for generating fusenes and benzenoids' 'ffmpeg: to export animations to video' 'imagemagick: to show animations' @@ -35,34 +35,24 @@ makedepends=(cython2 boost ratpoints python2-jinja coin-or-cbc sirocco mcqd coxeter bliss tdlib python2-pkgconfig shared_meataxe libfes primecount) source=("$pkgname-$pkgver.tar.gz::https://github.com/sagemath/sage/archive/$pkgver.tar.gz" - sagemath-env.patch package.patch latte-count.patch sagemath-python3-notebook.patch test-optional.patch fes02.patch - sagemath-threejs.patch sagemath-cremona.patch sagemath-singular-4.1.2.patch sagemath-ecl-sigfpe.patch - sagemath-linbox-1.6.patch - sagemath-threejs-dir-structure.patch - meataxe-tables.patch sagemath-primecount-5.1.patch) -sha256sums=('d012ff4f0f34e086fcaf576e25220fc647826116c69b62b887bc0b8ced5c1e9f' - '20f5d7a1b5b16f4de43edcd4184e99e4687d9cccce70058f3f58f5d909bda300' +sha256sums=('4f9f18a08142fed69342b58ffc6221ec16fe8daf1042086b351e1308489ec5d4' '328e45e78065b5f6527174bda48cfff6828acbf107c2535b0a9a92c3ceb35842' - '596d03daf53a76b04029b120619253250b0e58d530d69f14afa169e27e06f446' - 'e554cdf689100c787a5fbcb7fe281cd68bef081e08bd58df8be1d113a4665d7e' + '1a82372a96ffd5e6d475b0e620935967ce5eb9b4484607d39da90824a77b07c4' + '8b19aee28cb36b43815c206afee41a08a522f2502581f49b6bbc4a274fcf9dff' '1f2a34e15bf732ec8687c467a52e897615505dc3ddd792d811e8b6a7e19f1517' '7fcb52e96935dccb0f958d37c2f4e3918392480b9af53e08562f6cba6c68cb94' - 'a8c1409f4b4f1553b4f7602d4a6f0f3c6297ed258feed079f6560b0ec2dc62c6' - '4c6df9e4e5a7b29ecf6189eda3e5a79f69b6e1b4d29c1b9559663149b8c0af96' + '5281e5c715ff14ffa4003f643a508863ca58efb9e083cece81928f78810dc525' '961bfb5694b67d425d21240d71490cb71714b5207c23448c89be0966512ff8f9' 'a42f3b152b1aedb8abf16bc70971419919d1fe30328574e7fef8305f9d07d938' - '81fc39e39e8508f742ccc784efd0492fd04474cee75edf7bd3cbea43edd49b2e' - '779e4107f663307bc9c564e6f800364e7e1926b6cab18ea6674bd62ea7664143' - '8305de73d7a3c68ceaa001866ff933c4fa3a0706700ade2e25046f58270bc6db' '4e48ce9aa6a584a9e342e4fb0dac91a1af27cfc40bfedb54e68ccad3b9257bb6') prepare(){ @@ -71,8 +61,6 @@ # Arch-specific patches # assume all optional packages are installed patch -p0 -i ../package.patch -# set env variables - patch -p0 -i ../sagemath-env.patch # don't list optional packages when running tests patch -p0 -i ../test-optional.patch # use correct latte-count binary name @@ -79,8 +67,6 @@ patch -p1 -i ../latte-count.patch # make 'sage -notebook=jupyter' work with our python3 jupyter-notebook package patch -p1 -i ../sagemath-python3-notebook.patch -# use correct online three.js version - patch -p1 -i ../sagemath-threejs.patch # fix build with primecount 5.1 patch -p1 -i ../sagemath-primecount-5.1.patch @@ -93,12 +79,6 @@ patch -p1 -i ../sagemath-singular-4.1.2.patch # Fix SIGFPE crashes with ecl 16.1.3 https://trac.sagemath.org/ticket/22191 patch -p1 -i ../sagemath-ecl-sigfpe.patch -# fix build with linbox 1.6 https://trac.sagemath.org/ticket/26932 - patch -p1 -i ../sagemath-linbox-1.6.patch -# use upstream's three.js directory structure https://trac.sagemath.org/ticket/28007 - patch -p1 -i ../sagemath-threejs-dir-structure.patch -# use meataxe package's multiplication tables instead of generating them at runtime https://trac.sagemath.org/ticket/28188 - patch -p1 -i ../meataxe-tables.patch # use python2 sed -e 's|sage-python23|python2|' -e 's|#!/usr/bin/env python\b|#!/usr/bin/env python2|' -i src/bin/* @@ -129,7 +109,7 @@ mkdir -p "$pkgdir"/usr/bin cp bin/{sage,math-readline} "$pkgdir"/usr/bin - for _i in cachegrind callgrind cleaner coverage coverageall cython env eval fixdoctests grep grepdoc inline-fortran ipynb2rst \ + for _i in cachegrind callgrind cleaner coverage coverageall cython eval fixdoctests grep grepdoc inline-fortran ipynb2rst \ ipython massif maxima.lisp native-execute notebook num-threads.py omega open preparse python rst2sws rst2txt run \ run-cython runtests startuptime.py sws2rst valgrind version.sh do Modified: latte-count.patch =================================================================== --- latte-count.patch 2019-09-30 06:15:10 UTC (rev 512150) +++ latte-count.patch 2019-09-30 06:58:23 UTC (rev 512151) @@ -51,7 +51,7 @@ index 066cedd401..302b39910d 100644 --- a/src/sage/interfaces/latte.py +++ b/src/sage/interfaces/latte.py -@@ -94,7 +94,7 @@ def count(arg, ehrhart_polynomial=False, multivariate_generating_function=False, +@@ -96,7 +96,7 @@ def count(arg, ehrhart_polynomial=False, multivariate_generating_function=False, sage: n = count(cddin, cdd=True, verbose=True, raw_output=True) # optional - latte_int This is LattE integrale ... ... @@ -60,10 +60,10 @@ ... Total Unimodular Cones: ... Maximum number of simplicial cones in memory at once: ... -@@ -113,7 +113,7 @@ def count(arg, ehrhart_polynomial=False, multivariate_generating_function=False, - # Check that LattE is present - Latte().require() +@@ -117,7 +117,7 @@ def count(arg, ehrhart_polynomial=False, multivariate_generating_function=False, + arg = str_to_bytes(arg) + - args = ['count'] + args = ['latte-count'] if ehrhart_polynomial and multivariate_generating_function: Deleted: meataxe-tables.patch =================================================================== --- meataxe-tables.patch 2019-09-30 06:15:10 UTC (rev 512150) +++ meataxe-tables.patch 2019-09-30 06:58:23 UTC (rev 512151) @@ -1,34 +0,0 @@ -diff --git a/src/sage/env.py b/src/sage/env.py -index 27dd40c..453ccd7 100644 ---- a/src/sage/env.py -+++ b/src/sage/env.py -@@ -182,6 +182,7 @@ var('CREMONA_LARGE_DATA_DIR', join(SAGE_SHARE, 'cremona')) - var('JMOL_DIR', join(SAGE_SHARE, 'jmol')) - var('JSMOL_DIR', join(SAGE_SHARE, 'jsmol')) - var('MATHJAX_DIR', join(SAGE_SHARE, 'mathjax')) -+var('MTXLIB', join(SAGE_SHARE, 'meataxe')) - var('THREEJS_DIR', join(SAGE_SHARE, 'threejs')) - var('PPLPY_DOCS', join(SAGE_SHARE, 'doc', 'pplpy')) - var('MAXIMA_FAS') -diff --git a/src/sage/libs/meataxe.pyx b/src/sage/libs/meataxe.pyx -index 1120600..7549e55 100644 ---- a/src/sage/libs/meataxe.pyx -+++ b/src/sage/libs/meataxe.pyx -@@ -68,7 +68,6 @@ cdef Matrix_t *rawMatrix(int Field, list entries) except NULL: - - from sage.cpython.string cimport str_to_bytes, char_to_str - import os --from sage.env import DOT_SAGE - - cdef void sage_meataxe_error_handler(const MtxErrorRecord_t *err): - sig_block() -@@ -82,7 +81,8 @@ cdef inline meataxe_init(): - ## Assign to a variable that enables MeatAxe to find - ## its multiplication tables. - global MtxLibDir -- mtxdir = str_to_bytes(os.path.join(DOT_SAGE, 'meataxe')) -+ from sage import env -+ mtxdir = str_to_bytes(env.MTXLIB) - if len(mtxdir) >= 1024: - raise RuntimeError(f"the path for the meataxe library {mtxdir!r} is too long, it needs to be of length < 1024") - MtxLibDir[:len(mtxdir)] = mtxdir Modified: sagemath-cremona.patch =================================================================== --- sagemath-cremona.patch 2019-09-30 06:15:10 UTC (rev 512150) +++ sagemath-cremona.patch 2019-09-30 06:58:23 UTC (rev 512151) @@ -2,16 +2,16 @@ index 3f8dd62..ed5726a 100644 --- a/src/sage/databases/cremona.py +++ b/src/sage/databases/cremona.py -@@ -53,7 +53,7 @@ from sage.misc.prandom import randint +@@ -51,7 +51,7 @@ from sage.misc.prandom import randint import sage.schemes.elliptic_curves.constructor as elliptic from .sql_db import SQLDatabase, verify_column -from sage.misc.package import is_package_installed +from sage.features.databases import DatabaseCremona - from sage.env import CREMONA_MINI_DATA_DIR, CREMONA_LARGE_DATA_DIR + from sage.env import CREMONA_MINI_DATA_DIR, CREMONA_LARGE_DATA_DIR, SAGE_SHARE from sage.misc.all import walltime -@@ -835,7 +835,7 @@ class MiniCremonaDatabase(SQLDatabase): +@@ -843,7 +843,7 @@ class MiniCremonaDatabase(SQLDatabase): if N < self.largest_conductor(): message = "There is no elliptic curve with label " + label \ + " in the database" @@ -20,7 +20,7 @@ message = "There is no elliptic curve with label " + label \ + " in the currently available databases" else: -@@ -1683,7 +1683,7 @@ def CremonaDatabase(name=None,mini=None,set_global=None): +@@ -1695,7 +1695,7 @@ def CremonaDatabase(name=None,mini=None,set_global=None): if name is None and not set_global: return _db if set_global and name is None: Deleted: sagemath-env.patch =================================================================== --- sagemath-env.patch 2019-09-30 06:15:10 UTC (rev 512150) +++ sagemath-env.patch 2019-09-30 06:58:23 UTC (rev 512151) @@ -1,141 +0,0 @@ ---- src/bin/sage-env.orig 2015-01-06 10:46:04.469687605 +0100 -+++ src/bin/sage-env 2015-01-06 10:49:59.547762019 +0100 -@@ -111,41 +111,6 @@ - } - - --# New value for SAGE_ROOT: either SAGE_ROOT (if given) --# or a guessed value based on pwd. --if [ -n "$SAGE_ROOT" ]; then -- NEW_SAGE_ROOT="$SAGE_ROOT" --elif [ -f sage -a -d build ]; then -- NEW_SAGE_ROOT="." --elif [ -f ../../sage -a -d ../../build ]; then -- NEW_SAGE_ROOT="../.." --else -- # No idea what SAGE_ROOT should be... -- echo >&2 "Error: You must set the SAGE_ROOT environment variable or run this" -- echo >&2 "script from the SAGE_ROOT or SAGE_ROOT/local/bin/ directory." -- return 1 --fi -- --# Make NEW_SAGE_ROOT absolute --NEW_SAGE_ROOT=`cd "$NEW_SAGE_ROOT" && pwd -P` -- --# Sanity check NEW_SAGE_ROOT --if [ -f "$NEW_SAGE_ROOT/sage" -a -d "$NEW_SAGE_ROOT/build" ]; then -- : --else -- echo >&2 "Error: SAGE_ROOT is set to a bad value:" -- echo >&2 "SAGE_ROOT=$SAGE_ROOT" -- echo >&2 "You must correct it or erase it and run this script from the SAGE_ROOT" -- echo >&2 "or SAGE_ROOT/local/bin/ directory." -- return 1 --fi -- --# Warn if NEW_SAGE_ROOT does not equal the old SAGE_ROOT --if [ "$SAGE_ROOT" != "$NEW_SAGE_ROOT" -a -n "$SAGE_ROOT" ]; then -- echo >&2 "Warning: overwriting SAGE_ROOT environment variable:" -- echo >&2 "Old SAGE_ROOT=$SAGE_ROOT" -- echo >&2 "New SAGE_ROOT=$NEW_SAGE_ROOT" --fi - - - # Don't execute the commands more than once for the same version of -@@ -174,35 +174,9 @@ - export SAGE_ENV_SOURCED=$SAGE_ENV_VERSION - - export SAGE_ROOT="$NEW_SAGE_ROOT" -+export SAGE_LOCAL='/usr' -+export SAGE_SCRIPTS_DIR='/usr/bin' - -- --# sage-env must know where the Sage's script files are. --# Note that SAGE_SCRIPTS_DIR is only used here, so it does not need to --# be exported. --if [ -z "$SAGE_SCRIPTS_DIR" ]; then -- if [ -f "$SAGE_ROOT/src/bin/sage-env-config" ]; then -- # Prefer src/bin/sage-env-config because that's directly -- # generated by configure (see Trac #27422) -- SAGE_SCRIPTS_DIR="$SAGE_ROOT/src/bin" -- elif [ -n "$SAGE_LOCAL" ] && [ -f "$SAGE_LOCAL/bin/sage-env-config" ]; then -- SAGE_SCRIPTS_DIR="$SAGE_LOCAL/bin" -- else -- echo >&2 "Error: You must set either the SAGE_LOCAL or SAGE_SCRIPTS_DIR environment variable to run this" -- return 1 -- fi --elif [ ! -f "$SAGE_SCRIPTS_DIR/sage-env-config" ]; then -- echo >&2 "Error: SAGE_SCRIPTS_DIR is set to a bad value:" -- echo >&2 "SAGE_SCRIPTS_DIR=$SAGE_SCRIPTS_DIR" -- echo >&2 "You must correct it or erase it and rerun this script" -- return 1 --fi -- --# Set environment variables (like SAGE_LOCAL) depending on ./configure --. "$SAGE_SCRIPTS_DIR/sage-env-config" --if [ $? -ne 0 ]; then -- echo >&2 "Error: failed to source $SAGE_SCRIPTS_DIR/sage-env-config" -- return 1 --fi - - # The compilers are set in order of priority by - # 1) environment variables -@@ -298,8 +298,8 @@ - export SAGE_SPKG_INST="$SAGE_LOCAL/var/lib/sage/installed" - export SAGE_SPKG_SCRIPTS="$SAGE_LOCAL/var/lib/sage/scripts" - export SAGE_LOGS="$SAGE_ROOT/logs/pkgs" --export SAGE_SRC="$SAGE_ROOT/src" --export SAGE_DOC_SRC="$SAGE_SRC/doc" -+export SAGE_SRC="$SAGE_LOCAL/lib/python2.7/site-packages" -+export SAGE_DOC_SRC="$SAGE_SHARE/doc/sage" - export SAGE_DOC="$SAGE_SHARE/doc/sage" - - if [ -z "${SAGE_ORIG_PATH_SET}" ]; then -@@ -411,28 +411,6 @@ - export SAGE_STARTUP_FILE - fi - --if [ "$PYTHON_EGG_CACHE" = "" ]; then -- PYTHON_EGG_CACHE="$DOT_SAGE/.python-eggs" -- export PYTHON_EGG_CACHE --fi -- --# Set PYTHONUSERBASE to avoid picking up non-Sage versions of --# Matplotlib, numpy, etc. See http://trac.sagemath.org/ticket/19612. --# --# For more history (it used to be PYTHONNOUSERSITE=yes which killed --# the ability to do "sage -pip install PACKAGE --user"), see --# http://trac.sagemath.org/ticket/14243 and --# http://trac.sagemath.org/ticket/18955. -- --if [ "$PYTHONUSERBASE" = "" ]; then -- PYTHONUSERBASE="$DOT_SAGE/local" -- export PYTHONUSERBASE --fi -- --if [ -n "$PYTHONHOME" ]; then -- >&2 echo "Warning: PYTHONHOME must not be set when running Sage, clearing env..." -- unset PYTHONHOME --fi - - LDFLAGS="-L$SAGE_LOCAL/lib -Wl,-rpath,$SAGE_LOCAL/lib $LDFLAGS" - export LDFLAGS -@@ -497,8 +497,6 @@ - fi - fi - --export MAXIMA_PREFIX="$SAGE_LOCAL" --export MAXIMA_USERDIR="$DOT_SAGE/maxima" - - PERL5LIB="$SAGE_LOCAL/lib/perl5:$PERL5LIB" && export PERL5LIB - -@@ -609,9 +609,6 @@ - LD_LIBRARY_PATH="$SAGE_LOCAL/bin:$LD_LIBRARY_PATH" && export LD_LIBRARY_PATH - fi - --# See trac 7186 -- this is needed if ecl is moved --ECLDIR="$SAGE_LOCAL/lib/ecl/" && export ECLDIR -- - # Handle parallel building/testing/... - # See Trac Ticket #12016 - # First, figure out the right values for SAGE_NUM_THREADS (default Deleted: sagemath-linbox-1.6.patch =================================================================== --- sagemath-linbox-1.6.patch 2019-09-30 06:15:10 UTC (rev 512150) +++ sagemath-linbox-1.6.patch 2019-09-30 06:58:23 UTC (rev 512151) @@ -1,650 +0,0 @@ -diff --git a/src/sage/libs/linbox/conversion.pxd b/src/sage/libs/linbox/conversion.pxd -index 810a197..7794c9e 100644 ---- a/src/sage/libs/linbox/conversion.pxd -+++ b/src/sage/libs/linbox/conversion.pxd -@@ -45,7 +45,7 @@ from sage.modules.vector_integer_sparse cimport mpz_vector, mpz_vector_get_entr - - ctypedef enum linbox_specifier: - METHOD_DEFAULT # no specification -- METHOD_BLAS_ELIMINATION # BlasElimination -+ METHOD_DENSE_ELIMINATION # DenseElimination - METHOD_SPARSE_ELIMINATION # SparseElimination - METHOD_BLACKBOX # Blackbox - METHOD_WIEDEMANN # Wiedeman -@@ -54,10 +54,10 @@ ctypedef enum linbox_specifier: - cdef inline linbox_specifier get_method(str algo) except ERROR: - if algo is None or algo == "default": - return METHOD_DEFAULT -- elif algo == "blas_elimination" or \ -- algo == "linbox_blas_elimination" or \ -- algo == "LinBox::BlasElimination": -- return METHOD_BLAS_ELIMINATION -+ elif algo == "dense_elimination" or \ -+ algo == "linbox_dense_elimination" or \ -+ algo == "LinBox::DenseElimination": -+ return METHOD_DENSE_ELIMINATION - elif algo == "sparse_elimination" or \ - algo == "linbox_sparse_elimination" or \ - algo == "LinBox::SparseElimination": -diff --git a/src/sage/libs/linbox/fflas.pxd b/src/sage/libs/linbox/fflas.pxd -index f3a7ce3..8bf62f1 100644 ---- a/src/sage/libs/linbox/fflas.pxd -+++ b/src/sage/libs/linbox/fflas.pxd -@@ -63,8 +63,7 @@ cdef extern from "fflas-ffpack/fflas-ffpack.h" namespace "FFPACK": - Modular_double.Element* Invert (Modular_double F, size_t order, - Modular_double.Element* A, size_t A_stride, int nullity) - -- Modular_double.Element Det (Modular_double F, -- size_t nrows, size_t ncols, -+ Modular_double.Element Det (Modular_double F, Modular_double.Element& d, size_t n, - Modular_double.Element* A, size_t A_stride) - - int Rank (Modular_double, -@@ -97,8 +96,7 @@ cdef extern from "fflas-ffpack/fflas-ffpack.h" namespace "FFPACK": - Modular_float.Element* Invert (Modular_float F, size_t order, - Modular_float.Element* A, size_t A_stride, int nullity) - -- Modular_float.Element Det (Modular_float F, -- size_t nrows, size_t ncols, -+ Modular_float.Element Det (Modular_float F, Modular_float.Element& d, size_t n, - Modular_float.Element* A, size_t A_stride) - - int Rank (Modular_float, -diff --git a/src/sage/libs/linbox/linbox.pxd b/src/sage/libs/linbox/linbox.pxd -index 35a3fa0..fb0e0dc 100644 ---- a/src/sage/libs/linbox/linbox.pxd -+++ b/src/sage/libs/linbox/linbox.pxd -@@ -10,10 +10,10 @@ from .givaro cimport * - - cdef extern from "linbox/matrix/dense-matrix.h": - ## template <class _Field, class _blasRep=typename Vector<_Field>::Dense > -- ## class BlasMatrix ; -+ ## class DenseMatrix ; - ## - ## template <class _Field> -- ## using DenseMatrix = BlasMatrix<_Field> ; -+ ## using DenseMatrix = DenseMatrix<_Field> ; - cdef cppclass DenseMatrix_integer "LinBox::DenseMatrix<Givaro::ZRing<Givaro::Integer>>": - ctypedef ZRing Field - ctypedef Integer Element -@@ -30,6 +30,7 @@ cdef extern from "linbox/matrix/dense-matrix.h": - ctypedef Modular_double Field - ctypedef double Element - DenseMatrix_Modular_double(Field F, size_t m, size_t n) -+ DenseMatrix_Modular_double(Field F, Element*, size_t m, size_t n) - void setEntry(size_t i, size_t j, Element& a) - Element &getEntry(size_t i, size_t j) - -@@ -39,6 +40,7 @@ cdef extern from "linbox/matrix/dense-matrix.h": - ctypedef Modular_float Field - ctypedef float Element - DenseMatrix_Modular_float(Field F, size_t m, size_t n) -+ DenseMatrix_Modular_float(Field F, Element*, size_t m, size_t n) - void setEntry(size_t i, size_t j, Element& a) - Element &getEntry(size_t i, size_t j) - -@@ -125,7 +127,7 @@ cdef extern from "linbox/solutions/methods.h" namespace "LinBox": - pass - cdef struct WiedemannTraits: - pass -- cdef struct BlasEliminationTraits: -+ cdef struct DenseEliminationTraits: - pass - cdef struct SparseEliminationTraits: - pass -@@ -135,7 +137,7 @@ cdef extern from "linbox/solutions/methods.h" namespace "LinBox": - ctypedef BlackboxSpecifier Blackbox - ctypedef EliminationSpecifier Elimination - ctypedef WiedemannTraits Wiedemann -- ctypedef BlasEliminationTraits BlasElimination -+ ctypedef DenseEliminationTraits DenseElimination - ctypedef SparseEliminationTraits SparseElimination - - cdef extern from "linbox/solutions/charpoly.h" namespace "LinBox": -@@ -157,18 +159,24 @@ cdef extern from "linbox/algorithms/gauss.h": - unsigned long Ni, - unsigned long Nj) - --cdef extern from "linbox/algorithms/echelon-form.h": -- ## template<class Field> -- ## class EchelonFormDomain -- cdef cppclass EchelonForm_Modular_double "LinBox::EchelonFormDomain<Givaro::Modular<double>>": -- ctypedef double Element -- EchelonForm_Modular_double(Modular_double) -- int rowReducedEchelon(DenseMatrix_Modular_double&, const DenseMatrix_Modular_double&) -- -- cdef cppclass EchelonForm_Modular_float "LinBox::EchelonFormDomain<Givaro::Modular<float>>": -- ctypedef float Element -- EchelonForm_Modular_float(Modular_float) -- int rowReducedEchelon(DenseMatrix_Modular_float, const DenseMatrix_Modular_float) -+cdef extern from "linbox/solutions/echelon.h" namespace "LinBox": -+ size_t rowEchelon (DenseMatrix_Modular_float&, const DenseMatrix_Modular_float&) -+ size_t rowEchelonize (DenseMatrix_Modular_float&) -+ size_t reducedRowEchelon (DenseMatrix_Modular_float&, const DenseMatrix_Modular_float&) -+ size_t reducedRowEchelonize (DenseMatrix_Modular_float&) -+ size_t colEchelon (DenseMatrix_Modular_float&, const DenseMatrix_Modular_float&) -+ size_t colEchelonize (DenseMatrix_Modular_float&) -+ size_t reducedColEchelon (DenseMatrix_Modular_float&, const DenseMatrix_Modular_float&) -+ size_t reducedColEchelonize (DenseMatrix_Modular_float&) -+ -+ size_t rowEchelon (DenseMatrix_Modular_double&, const DenseMatrix_Modular_double&) -+ size_t rowEchelonize (DenseMatrix_Modular_double&) -+ size_t reducedRowEchelon (DenseMatrix_Modular_double&, const DenseMatrix_Modular_double&) -+ size_t reducedRowEchelonize (DenseMatrix_Modular_double&) -+ size_t colEchelon (DenseMatrix_Modular_double&, const DenseMatrix_Modular_double&) -+ size_t colEchelonize (DenseMatrix_Modular_double&) -+ size_t reducedColEchelon (DenseMatrix_Modular_double&, const DenseMatrix_Modular_double&) -+ size_t reducedColEchelonize (DenseMatrix_Modular_double&) - - cdef extern from "linbox/solutions/rank.h" namespace "LinBox": - unsigned long & rank (unsigned long&, DenseMatrix_integer) -@@ -185,7 +193,7 @@ cdef extern from "linbox/solutions/solve.h" namespace "LinBox": - Integer &, - SparseMatrix_integer &, - DenseVector_integer &, -- Method.BlasElimination) except + -+ Method.DenseElimination) except + - - DenseVector_integer& solve (DenseVector_integer &, - Integer &, -diff --git a/src/sage/matrix/matrix_integer_sparse.pyx b/src/sage/matrix/matrix_integer_sparse.pyx -index 7fa386e..132140f 100644 ---- a/src/sage/matrix/matrix_integer_sparse.pyx -+++ b/src/sage/matrix/matrix_integer_sparse.pyx -@@ -42,7 +42,7 @@ from sage.libs.linbox.conversion cimport ( - new_linbox_vector_integer_dense, - new_sage_vector_integer_dense, - new_linbox_matrix_integer_sparse, -- METHOD_DEFAULT, METHOD_BLAS_ELIMINATION, -+ METHOD_DEFAULT, METHOD_DENSE_ELIMINATION, - METHOD_SPARSE_ELIMINATION, METHOD_BLACKBOX, - METHOD_WIEDEMANN, get_method) - -@@ -926,7 +926,7 @@ cdef class Matrix_integer_sparse(Matrix_sparse): - - ``'linbox'`` or ``'linbox_default'`` - (default) use LinBox - and let it chooses the appropriate algorithm - -- - ``linbox_blas_elimination'`` - use LinBox dense elimination -+ - ``linbox_dense_elimination'`` - use LinBox dense elimination - - - ``'linbox_sparse_elimination'`` - use LinBox sparse elimination - -@@ -993,7 +993,7 @@ cdef class Matrix_integer_sparse(Matrix_sparse): - - - ``b`` -- a dense integer vector - -- - ``algorithm`` -- (optional) either ``None``, ``'blas_elimination'``, -+ - ``algorithm`` -- (optional) either ``None``, ``'dense_elimination'``, - ``'sparse_elimination'``, ``'wiedemann'`` or ``'blackbox'``. - - OUTPUT: a pair ``(a, d)`` consisting of -@@ -1012,7 +1012,7 @@ cdef class Matrix_integer_sparse(Matrix_sparse): - sage: b0 = vector((1,1,1,1)) - sage: m._solve_vector_linbox(b0) - ((-1, -7, -3, -1), 1) -- sage: m._solve_vector_linbox(b0, 'blas_elimination') -+ sage: m._solve_vector_linbox(b0, 'dense_elimination') - ((-1, -7, -3, -1), 1) - sage: m._solve_vector_linbox(b0, 'sparse_elimination') - ((-1, -7, -3, -1), 1) -@@ -1024,7 +1024,7 @@ cdef class Matrix_integer_sparse(Matrix_sparse): - sage: b1 = vector((1,2,3,4)) - sage: m._solve_vector_linbox(b1) - ((-18, -92, -41, -17), 5) -- sage: m._solve_vector_linbox(b1, 'blas_elimination') -+ sage: m._solve_vector_linbox(b1, 'dense_elimination') - ((-18, -92, -41, -17), 5) - sage: m._solve_vector_linbox(b1, 'sparse_elimination') - ((-18, -92, -41, -17), 5) -@@ -1039,7 +1039,7 @@ cdef class Matrix_integer_sparse(Matrix_sparse): - - TESTS:: - -- sage: algos = ["default", "blas_elimination", "sparse_elimination", -+ sage: algos = ["default", "dense_elimination", "sparse_elimination", - ....: "blackbox", "wiedemann"] - sage: for i in range(20): - ....: dim = randint(1, 30) -@@ -1080,8 +1080,8 @@ cdef class Matrix_integer_sparse(Matrix_sparse): - linbox.solve(res[0], D, A[0], b[0]) - elif method == METHOD_WIEDEMANN: - linbox.solve(res[0], D, A[0], b[0], linbox.Method.Wiedemann()) -- elif method == METHOD_BLAS_ELIMINATION: -- linbox.solve(res[0], D, A[0], b[0], linbox.Method.BlasElimination()) -+ elif method == METHOD_DENSE_ELIMINATION: -+ linbox.solve(res[0], D, A[0], b[0], linbox.Method.DenseElimination()) - elif method == METHOD_SPARSE_ELIMINATION: - linbox.solve(res[0], D, A[0], b[0], linbox.Method.SparseElimination()) - elif method == METHOD_BLACKBOX: -@@ -1136,7 +1136,7 @@ cdef class Matrix_integer_sparse(Matrix_sparse): - - TESTS:: - -- sage: algos = ["default", "blas_elimination", "sparse_elimination", -+ sage: algos = ["default", "dense_elimination", "sparse_elimination", - ....: "blackbox", "wiedemann"] - - sage: for _ in range(10): -@@ -1191,8 +1191,8 @@ cdef class Matrix_integer_sparse(Matrix_sparse): - # solve the current row - if algo == METHOD_DEFAULT: - linbox.solve(res[0], D, A[0], b[0]) -- elif algo == METHOD_BLAS_ELIMINATION: -- linbox.solve(res[0], D, A[0], b[0], linbox.Method.BlasElimination()) -+ elif algo == METHOD_DENSE_ELIMINATION: -+ linbox.solve(res[0], D, A[0], b[0], linbox.Method.DenseElimination()) - elif algo == METHOD_SPARSE_ELIMINATION: - linbox.solve(res[0], D, A[0], b[0], linbox.Method.SparseElimination()) - elif algo == METHOD_BLACKBOX: -diff --git a/src/sage/matrix/matrix_modn_dense_double.pyx b/src/sage/matrix/matrix_modn_dense_double.pyx -index c4b1a46..880caec 100644 ---- a/src/sage/matrix/matrix_modn_dense_double.pyx -+++ b/src/sage/matrix/matrix_modn_dense_double.pyx -@@ -24,8 +24,8 @@ from sage.libs.linbox.givaro cimport \ - Poly1Dom, Dense - - from sage.libs.linbox.linbox cimport \ -- DenseMatrix_Modular_double as BlasMatrix, \ -- EchelonForm_Modular_double as EchelonFormDomain -+ reducedRowEchelonize, \ -+ DenseMatrix_Modular_double as DenseMatrix - - from sage.libs.linbox.fflas cimport \ - fgemm, fgemv, Det, Rank, ReducedRowEchelonForm, applyP, \ -diff --git a/src/sage/matrix/matrix_modn_dense_float.pyx b/src/sage/matrix/matrix_modn_dense_float.pyx -index 89d1a94..8a468c1 100644 ---- a/src/sage/matrix/matrix_modn_dense_float.pyx -+++ b/src/sage/matrix/matrix_modn_dense_float.pyx -@@ -23,8 +23,8 @@ from sage.libs.linbox.givaro cimport \ - Poly1Dom, Dense - - from sage.libs.linbox.linbox cimport \ -- DenseMatrix_Modular_float as BlasMatrix, \ -- EchelonForm_Modular_float as EchelonFormDomain -+ DenseMatrix_Modular_float as DenseMatrix, \ -+ reducedRowEchelonize - - from sage.libs.linbox.fflas cimport \ - fgemm, fgemv, Det, Rank, ReducedRowEchelonForm, applyP, \ -diff --git a/src/sage/matrix/matrix_modn_dense_template.pxi b/src/sage/matrix/matrix_modn_dense_template.pxi -index 6a5e164..230a16e 100644 ---- a/src/sage/matrix/matrix_modn_dense_template.pxi -+++ b/src/sage/matrix/matrix_modn_dense_template.pxi -@@ -207,21 +207,12 @@ cdef inline linbox_echelonize_efd(celement modulus, celement* entries, Py_ssize_ - return 0,[] - - cdef ModField *F = new ModField(<long>modulus) -- cdef EchelonFormDomain *EF = new EchelonFormDomain(F[0]) -- cdef BlasMatrix *A = new BlasMatrix(F[0], <uint64_t>nrows, <uint64_t>ncols) -- cdef BlasMatrix *E = new BlasMatrix(F[0], <uint64_t>nrows, <uint64_t>ncols) -- -+ cdef DenseMatrix *A = new DenseMatrix(F[0], <ModField.Element*>entries,<Py_ssize_t>nrows, <Py_ssize_t>ncols) -+ cdef Py_ssize_t r = reducedRowEchelonize(A[0]) - cdef Py_ssize_t i,j -- -- # TODO: can we avoid this copy? -- for i in range(nrows): -- for j in range(ncols): -- A.setEntry(i, j, <ModField.Element>entries[i*ncols+j]) -- -- cdef int r = EF.rowReducedEchelon(E[0], A[0]) - for i in range(nrows): - for j in range(ncols): -- entries[i*ncols+j] = <celement>E.getEntry(i,j) -+ entries[i*ncols+j] = <celement>A.getEntry(i,j) - - cdef Py_ssize_t ii = 0 - cdef list pivots = [] -@@ -232,7 +223,7 @@ cdef inline linbox_echelonize_efd(celement modulus, celement* entries, Py_ssize_ - ii = j+1 - break - -- del F, A, E, EF -+ del F - return r, pivots - - cdef inline celement *linbox_copy(celement modulus, celement *entries, Py_ssize_t nrows, Py_ssize_t ncols) except? NULL: -@@ -258,15 +249,16 @@ cdef inline int linbox_rank(celement modulus, celement* entries, Py_ssize_t nrow - del F - return r - --cdef inline celement linbox_det(celement modulus, celement* entries, Py_ssize_t nrows, Py_ssize_t ncols): -+cdef inline celement linbox_det(celement modulus, celement* entries, Py_ssize_t n): - """ - Return the determinant of this matrix. - """ - cdef ModField *F = new ModField(<long>modulus) -- cdef celement *cpy = linbox_copy(modulus, entries, nrows, ncols) -- if nrows*ncols > 1000: sig_on() -- d = <celement>Det(F[0], nrows, ncols, <ModField.Element*>cpy, ncols) -- if nrows*ncols > 1000: sig_off() -+ cdef celement *cpy = linbox_copy(modulus, entries, n, n) -+ if n*n > 1000: sig_on() -+ cdef celement d -+ Det(F[0], d, n, <ModField.Element*>cpy, n) -+ if n*n > 1000: sig_off() - sig_free(cpy) - del F - return d -@@ -1672,9 +1664,9 @@ cdef class Matrix_modn_dense_template(Matrix_dense): - - - ``algorithm`` - -- - ``linbox`` - uses the LinBox library (``EchelonFormDomain`` implementation, default) -+ - ``linbox`` - uses the LinBox library (wrapping fflas-ffpack) - -- - ``linbox_noefd`` - uses the LinBox library (FFPACK directly, less memory but slower) -+ - ``linbox_noefd`` - uses the FFPACK directly, less memory and faster - - - ``gauss`` - uses a custom slower `O(n^3)` Gauss - elimination implemented in Sage. -@@ -1929,7 +1921,6 @@ cdef class Matrix_modn_dense_template(Matrix_dense): - else: - r, pivots = linbox_echelonize(self.p, self._entries, self._nrows, self._ncols) - verbose('done with echelonize',t) -- - self.cache('in_echelon_form',True) - self.cache('rank', r) - self.cache('pivots', tuple(pivots)) -@@ -2468,7 +2459,7 @@ cdef class Matrix_modn_dense_template(Matrix_dense): - x = self.fetch('det') - if not x is None: - return x -- d = linbox_det(self.p, self._entries, self._nrows, self._ncols) -+ d = linbox_det(self.p, self._entries, self._nrows) - d2 = self._coerce_element(d) - self.cache('det', d2) - return d2 -diff --git a/src/sage/matrix/matrix_modn_sparse.pyx b/src/sage/matrix/matrix_modn_sparse.pyx -index 241167a..dd3a2f0 100644 ---- a/src/sage/matrix/matrix_modn_sparse.pyx -+++ b/src/sage/matrix/matrix_modn_sparse.pyx -@@ -882,7 +882,7 @@ cdef class Matrix_modn_sparse(matrix_sparse.Matrix_sparse): - - ``'linbox'`` or ``'linbox_default'`` - (default) use LinBox - and let it chooses the appropriate algorithm - -- - ``linbox_blas_elimination'`` - use LinBox dense elimination -+ - ``linbox_dense_elimination'`` - use LinBox dense elimination - - - ``'linbox_sparse_elimination'`` - use LinBox sparse elimination - -@@ -949,7 +949,7 @@ cdef class Matrix_modn_sparse(matrix_sparse.Matrix_sparse): - - - ``b`` -- a dense integer vector - -- - ``algorithm`` -- (optional) either ``None``, ``'blas_elimination'``, -+ - ``algorithm`` -- (optional) either ``None``, ``'dense_elimination'``, - ``'sparse_elimination'``, ``'wiedemann'`` or ``'blackbox'``. - - OUTPUT: a pair ``(a, d)`` consisting of -@@ -968,7 +968,7 @@ cdef class Matrix_modn_sparse(matrix_sparse.Matrix_sparse): - sage: b0 = vector((1,1,1,1)) - sage: m._solve_vector_linbox(b0) - ((-1, -7, -3, -1), 1) -- sage: m._solve_vector_linbox(b0, 'blas_elimination') -+ sage: m._solve_vector_linbox(b0, 'dense_elimination') - ((-1, -7, -3, -1), 1) - sage: m._solve_vector_linbox(b0, 'sparse_elimination') - ((-1, -7, -3, -1), 1) -@@ -984,7 +984,7 @@ cdef class Matrix_modn_sparse(matrix_sparse.Matrix_sparse): - - TESTS:: - -- sage: algos = ["default", "blas_elimination", "sparse_elimination", -+ sage: algos = ["default", "dense_elimination", "sparse_elimination", - ....: "blackbox", "wiedemann"] - sage: for i in range(20): - ....: dim = randint(1, 30) -@@ -1025,8 +1025,8 @@ cdef class Matrix_modn_sparse(matrix_sparse.Matrix_sparse): - linbox.solve(res[0], D, A[0], b[0]) - elif method == METHOD_WIEDEMANN: - linbox.solve(res[0], D, A[0], b[0], linbox.Method.Wiedemann()) -- elif method == METHOD_BLAS_ELIMINATION: -- linbox.solve(res[0], D, A[0], b[0], linbox.Method.BlasElimination()) -+ elif method == METHOD_DENSE_ELIMINATION: -+ linbox.solve(res[0], D, A[0], b[0], linbox.Method.DenseElimination()) - elif method == METHOD_SPARSE_ELIMINATION: - linbox.solve(res[0], D, A[0], b[0], linbox.Method.SparseElimination()) - elif method == METHOD_BLACKBOX: -@@ -1081,7 +1081,7 @@ cdef class Matrix_modn_sparse(matrix_sparse.Matrix_sparse): - - TESTS:: - -- sage: algos = ["default", "blas_elimination", "sparse_elimination", -+ sage: algos = ["default", "dense_elimination", "sparse_elimination", - ....: "blackbox", "wiedemann"] - - sage: for _ in range(10): -@@ -1136,8 +1136,8 @@ cdef class Matrix_modn_sparse(matrix_sparse.Matrix_sparse): - # solve the current row - if algo == METHOD_DEFAULT: - linbox.solve(res[0], D, A[0], b[0]) -- elif algo == METHOD_BLAS_ELIMINATION: -- linbox.solve(res[0], D, A[0], b[0], linbox.Method.BlasElimination()) -+ elif algo == METHOD_DENSE_ELIMINATION: -+ linbox.solve(res[0], D, A[0], b[0], linbox.Method.DenseElimination()) - elif algo == METHOD_SPARSE_ELIMINATION: - linbox.solve(res[0], D, A[0], b[0], linbox.Method.SparseElimination()) - elif algo == METHOD_BLACKBOX: -diff --git a/src/sage/rings/finite_rings/element_givaro.pxd b/src/sage/rings/finite_rings/element_givaro.pxd -index f0fd7e35..8ae25c5 100644 ---- a/src/sage/rings/finite_rings/element_givaro.pxd -+++ b/src/sage/rings/finite_rings/element_givaro.pxd -@@ -20,35 +20,35 @@ cdef extern from "givaro/givrandom.h": - GivRandom GivRandomSeeded "Givaro::GivRandom"(unsigned long seed) - - cdef extern from "givaro/gfq.h": -- ctypedef struct GivaroGfq "Givaro::GFqDom<int>": -+ cdef cppclass GivaroGfq "Givaro::GFqDom<int>": - #attributes - unsigned int one - unsigned int zero - - # methods -- int (* mul)(int r, int a, int b) -- int (* add)(int r, int a, int b) -- int (* sub)(int r, int a, int b) -- int (* div)(int r, int a, int b) -- int (* inv)(int r, int x) -- int (* neg)(int r, int x) -- int (* mulin)(int a, int b) -- unsigned int (* characteristic)() -- unsigned int (* cardinality)() -- int (* exponent)() -- int (* random)(GivRandom gen, int res) -- int (* initi "init")(int res, int64_t e) -- int (* initd "init")(int res, double e) -- int (* indeterminate)() -- int (* convert)(int64_t r, int p) -- int (* read)(int r, int p) -- int (* axpyin)(int r, int a, int x) -- int (* axpy)(int r, int a, int b, int c) -- int (* axmy)(int r, int a, int b, int c) -- int (* maxpy)(int r, int a, int b, int c) -- bint (* isZero)(int e) -- bint (* isOne)(int e) -- bint (* isunit)(int e) -+ int mul(int r, int a, int b) -+ int add(int r, int a, int b) -+ int sub(int r, int a, int b) -+ int div(int r, int a, int b) -+ int inv(int r, int x) -+ int neg(int r, int x) -+ int mulin(int a, int b) -+ unsigned int characteristic() -+ unsigned int cardinality() -+ int exponent() -+ int random(GivRandom gen, int res) -+ int initi "init"(int& res, int64_t e) -+ int initd "init"(int& res, double e) -+ int indeterminate() -+ int64_t convert(int64_t& r, int p) -+ int read(int& r, int p) -+ int axpyin(int r, int a, int x) -+ int axpy(int r, int a, int b, int c) -+ int axmy(int r, int a, int b, int c) -+ int maxpy(int r, int a, int b, int c) -+ bint isZero(int e) -+ bint isOne(int e) -+ bint isunit(int e) - - GivaroGfq *gfq_factorypk "new Givaro::GFqDom<int>" (unsigned int p, unsigned int k) - GivaroGfq *gfq_factorypkp "new Givaro::GFqDom<int>" (unsigned int p, unsigned int k, intvec poly) -diff --git a/src/sage/rings/finite_rings/element_givaro.pyx b/src/sage/rings/finite_rings/element_givaro.pyx -index 3739020..a7f9c2f 100644 ---- a/src/sage/rings/finite_rings/element_givaro.pyx -+++ b/src/sage/rings/finite_rings/element_givaro.pyx -@@ -310,7 +310,7 @@ cdef class Cache_givaro(SageObject): - cdef int seed = current_randstate().c_random() - cdef int res - cdef GivRandom generator = GivRandomSeeded(seed) -- res = self.objectptr.random(generator,res) -+ self.objectptr.random(generator,res) - return make_FiniteField_givaroElement(self,res) - - cpdef FiniteField_givaroElement element_from_data(self, e): -@@ -386,16 +386,16 @@ cdef class Cache_givaro(SageObject): - isinstance(e, long) or is_IntegerMod(e): - try: - e_int = e % self.characteristic() -- res = self.objectptr.initi(res, e_int) -+ self.objectptr.initi(res, e_int) - except ArithmeticError: - raise TypeError("unable to coerce from a finite field other than the prime subfield") - elif e is None: - e_int = 0 -- res = self.objectptr.initi(res, e_int) -+ self.objectptr.initi(res, e_int) - - elif isinstance(e, float): - e_int = int(e) % self.characteristic() -- res = self.objectptr.initd(res, e_int) -+ self.objectptr.initd(res, e_int) - - elif isinstance(e, str): - return self.parent(eval(e.replace("^","**"),self.parent.gens_dict())) -@@ -406,7 +406,7 @@ cdef class Cache_givaro(SageObject): - ret = self._zero_element - for i in range(len(e)): - e_int = e[i] % self.characteristic() -- res = self.objectptr.initi(res, e_int) -+ self.objectptr.initi(res, e_int) - to_add = make_FiniteField_givaroElement(self, res) - ret = ret + to_add*self.parent.gen()**i - return ret -@@ -446,7 +446,7 @@ cdef class Cache_givaro(SageObject): - ret = self._zero_element - for i in range(len(e)): - e_int = e[i] % self.characteristic() -- res = self.objectptr.initi(res, e_int) -+ self.objectptr.initi(res, e_int) - to_add = make_FiniteField_givaroElement(self, res) - ret = ret + to_add*self.parent.gen()**i - return ret -@@ -475,8 +475,8 @@ cdef class Cache_givaro(SageObject): - - for i from 0 <= i <= degpol(t): - c = gtolong(gel(t, i+2)) -- res = self.objectptr.axpyin(res, self.int_to_log(c), x) -- x = self.objectptr.mul(x,x,g) -+ self.objectptr.axpyin(res, self.int_to_log(c), x) -+ self.objectptr.mulin(x,g) - clear_stack() - else: - clear_stack() -@@ -580,21 +580,10 @@ cdef class Cache_givaro(SageObject): - sage: 2^7 + 2^4 + 2^2 + 2 + 1 - 151 - """ -- cdef GivaroGfq *k = self.objectptr -- cdef int ret = k.zero -- cdef int a = k.indeterminate() -- cdef int at = k.one -- cdef int ch = k.characteristic() -- cdef int t, i -- -- if n<0 or n>k.cardinality(): -+ if n<0 or n>self.order(): - raise TypeError("n must be between 0 and self.order()") - -- for i from 0 <= i < k.exponent(): -- t = k.initi(t, n % ch) -- ret = k.axpy(ret, t, at, ret) -- at = k.mul(at,at,a) -- n //= ch -+ cdef int ret = self.int_to_log(n) - return make_FiniteField_givaroElement(self, ret) - - def _element_repr(self, FiniteField_givaroElement e): -@@ -715,7 +704,7 @@ cdef class Cache_givaro(SageObject): - """ - cdef int r - -- r = self.objectptr.axpy(r, a.element, b.element, c.element) -+ self.objectptr.axpy(r, a.element, b.element, c.element) - return make_FiniteField_givaroElement(self,r) - - def a_times_b_minus_c(self,FiniteField_givaroElement a, FiniteField_givaroElement b, FiniteField_givaroElement c): -@@ -734,7 +723,7 @@ cdef class Cache_givaro(SageObject): - """ - cdef int r - -- r = self.objectptr.axmy(r, a.element, b.element, c.element, ) -+ self.objectptr.axmy(r, a.element, b.element, c.element, ) - return make_FiniteField_givaroElement(self,r) - - def c_minus_a_times_b(self,FiniteField_givaroElement a, -@@ -754,7 +743,7 @@ cdef class Cache_givaro(SageObject): - """ - cdef int r - -- r = self.objectptr.maxpy(r , a.element, b.element, c.element, ) -+ self.objectptr.maxpy(r , a.element, b.element, c.element, ) - return make_FiniteField_givaroElement(self,r) - - def __reduce__(self): -@@ -1108,7 +1097,7 @@ cdef class FiniteField_givaroElement(FinitePolyExtElement): - 2*b^3 + 2*b^2 + 2*b + 1 - """ - cdef int r -- r = self._cache.objectptr.add(r, self.element , -+ self._cache.objectptr.add(r, self.element , - (<FiniteField_givaroElement>right).element ) - return make_FiniteField_givaroElement(self._cache,r) - -@@ -1125,7 +1114,7 @@ cdef class FiniteField_givaroElement(FinitePolyExtElement): - c^2 - """ - cdef int r -- r = self._cache.objectptr.mul(r, self.element, -+ self._cache.objectptr.mul(r, self.element, - (<FiniteField_givaroElement>right).element) - return make_FiniteField_givaroElement(self._cache,r) - -@@ -1147,7 +1136,7 @@ cdef class FiniteField_givaroElement(FinitePolyExtElement): - cdef int r - if (<FiniteField_givaroElement>right).element == 0: - raise ZeroDivisionError('division by zero in finite field') -- r = self._cache.objectptr.div(r, self.element, -+ self._cache.objectptr.div(r, self.element, - (<FiniteField_givaroElement>right).element) - return make_FiniteField_givaroElement(self._cache,r) - -@@ -1164,7 +1153,7 @@ cdef class FiniteField_givaroElement(FinitePolyExtElement): - 2*a^2 + 2*a - """ - cdef int r -- r = self._cache.objectptr.sub(r, self.element, -+ self._cache.objectptr.sub(r, self.element, - (<FiniteField_givaroElement>right).element) - return make_FiniteField_givaroElement(self._cache,r) - -@@ -1181,7 +1170,7 @@ cdef class FiniteField_givaroElement(FinitePolyExtElement): - """ - cdef int r - -- r = self._cache.objectptr.neg(r, self.element) -+ self._cache.objectptr.neg(r, self.element) - return make_FiniteField_givaroElement(self._cache,r) - - def __invert__(FiniteField_givaroElement self): Modified: sagemath-python3-notebook.patch =================================================================== --- sagemath-python3-notebook.patch 2019-09-30 06:15:10 UTC (rev 512150) +++ sagemath-python3-notebook.patch 2019-09-30 06:58:23 UTC (rev 512151) @@ -1,8 +1,8 @@ diff --git a/src/bin/sage-notebook b/src/bin/sage-notebook -index 74192da240..0ede281aad 100755 +index 83109e6..b954c22 100755 --- a/src/bin/sage-notebook +++ b/src/bin/sage-notebook -@@ -91,12 +91,7 @@ class NotebookJupyter(object): +@@ -91,12 +91,8 @@ class NotebookJupyter(object): def __init__(self, argv): self.print_banner() @@ -12,7 +12,68 @@ - raise SystemExit(1) - from notebook.notebookapp import main - main(argv) -+ os.execvp('jupyter-notebook', ['jupyter-notebook'] + argv) ++ from sys import prefix ++ os.execv(os.path.join(prefix, 'bin', 'jupyter-notebook'), ['jupyter-notebook'] + argv) class NotebookJupyterlab(object): +@@ -109,15 +105,15 @@ class NotebookJupyterlab(object): + cls(['help']) + + def __init__(self, argv): ++ self.print_banner() ++ from sys import prefix + try: +- from jupyterlab.labapp import main +- except ImportError: ++ os.execv(os.path.join(prefix, 'bin', 'jupyter-lab'), ['jupyter-lab'] + argv) ++ except OSError: + print("Jupyterlab is not installed (at least not in this Sage installation).") + print("You can install it by running") + print(" sage --pip install jupyterlab") + raise SystemExit(1) +- self.print_banner() +- main(argv) + + + class SageNBExport(NotebookJupyter): +diff --git a/src/sage/repl/ipython_kernel/install.py b/src/sage/repl/ipython_kernel/install.py +index 073fae5..81378f4 100644 +--- a/src/sage/repl/ipython_kernel/install.py ++++ b/src/sage/repl/ipython_kernel/install.py +@@ -279,35 +279,3 @@ class SageKernelSpec(object): + instance.use_local_threejs() + instance._install_spec() + instance._symlink_resources() +- +- +-def have_prerequisites(debug=True): +- """ +- Check that we have all prerequisites to run the Jupyter notebook. +- +- In particular, the Jupyter notebook requires OpenSSL whether or +- not you are using https. See :trac:`17318`. +- +- INPUT: +- +- ``debug`` -- boolean (default: ``True``). Whether to print debug +- information in case that prerequisites are missing. +- +- OUTPUT: +- +- Boolean. +- +- EXAMPLES:: +- +- sage: from sage.repl.ipython_kernel.install import have_prerequisites +- sage: have_prerequisites(debug=False) in [True, False] +- True +- """ +- try: +- from notebook.notebookapp import NotebookApp +- return True +- except ImportError: +- if debug: +- import traceback +- traceback.print_exc() +- return False Deleted: sagemath-threejs-dir-structure.patch =================================================================== --- sagemath-threejs-dir-structure.patch 2019-09-30 06:15:10 UTC (rev 512150) +++ sagemath-threejs-dir-structure.patch 2019-09-30 06:58:23 UTC (rev 512151) @@ -1,40 +0,0 @@ -diff --git a/src/sage/repl/rich_output/backend_ipython.py b/src/sage/repl/rich_output/backend_ipython.py -index 7c27d48..8bf4861 100644 ---- a/src/sage/repl/rich_output/backend_ipython.py -+++ b/src/sage/repl/rich_output/backend_ipython.py -@@ -411,10 +411,15 @@ class BackendIPythonCommandline(BackendIPython): - sage: backend.threejs_offline_scripts() - '...<script ...</script>...' - """ -- from sage.env import SAGE_SHARE -+ from sage.env import THREEJS_DIR - -- scripts = [os.path.join(SAGE_SHARE, 'threejs', script) -- for script in ['three.min.js', 'OrbitControls.js']] -+ scripts = [ -+ os.path.join(THREEJS_DIR, script) -+ for script in [ -+ 'build/three.min.js', -+ 'examples/js/controls/OrbitControls.js', -+ ] -+ ] - - if sys.platform == 'cygwin': - import cygwin -@@ -594,13 +599,13 @@ class BackendIPythonNotebook(BackendIPython): - sage: from sage.repl.rich_output.backend_ipython import BackendIPythonNotebook - sage: backend = BackendIPythonNotebook() - sage: backend.threejs_offline_scripts() -- '...<script src="/nbextensions/threejs/three.min...<\\/script>...' -+ '...<script src="/nbextensions/threejs/build/three.min...<\\/script>...' - """ - from sage.repl.rich_output import get_display_manager - CDN_scripts = get_display_manager().threejs_scripts(online=True) - return """ --<script src="/nbextensions/threejs/three.min.js"></script> --<script src="/nbextensions/threejs/OrbitControls.js"></script> -+<script src="/nbextensions/threejs/build/three.min.js"></script> -+<script src="/nbextensions/threejs/examples/js/controls/OrbitControls.js"></script> - <script> - if ( !window.THREE ) document.write('{}'); - </script> Deleted: sagemath-threejs.patch =================================================================== --- sagemath-threejs.patch 2019-09-30 06:15:10 UTC (rev 512150) +++ sagemath-threejs.patch 2019-09-30 06:58:23 UTC (rev 512151) @@ -1,11 +0,0 @@ ---- a/src/sage/repl/rich_output/display_manager.py -+++ b/src/sage/repl/rich_output/display_manager.py -@@ -746,7 +746,7 @@ class DisplayManager(SageObject): - """ - if online: - from sage.misc.package import installed_packages -- version = installed_packages()['threejs'].split('.')[0] -+ version = 'r100' - return """ - <script src="https://cdn.jsdelivr.net/gh/mrdoob/three.js@{0}/build/three.min.js"></script> - <script src="https://cdn.jsdelivr.net/gh/mrdoob/three.js@{0}/examples/js/controls/OrbitControls.js"></script>
