Date: Friday, August 17, 2018 @ 22:29:46 Author: arojas Revision: 372569
archrelease: copy trunk to community-staging-x86_64 Added: sagemath/repos/community-staging-x86_64/ sagemath/repos/community-staging-x86_64/PKGBUILD (from rev 372568, sagemath/trunk/PKGBUILD) sagemath/repos/community-staging-x86_64/fes02.patch (from rev 372568, sagemath/trunk/fes02.patch) sagemath/repos/community-staging-x86_64/latte-count.patch (from rev 372568, sagemath/trunk/latte-count.patch) sagemath/repos/community-staging-x86_64/package.patch (from rev 372568, sagemath/trunk/package.patch) sagemath/repos/community-staging-x86_64/r-no-readline.patch (from rev 372568, sagemath/trunk/r-no-readline.patch) sagemath/repos/community-staging-x86_64/sagemath-cremona.patch (from rev 372568, sagemath/trunk/sagemath-cremona.patch) sagemath/repos/community-staging-x86_64/sagemath-eclib-20180710.patch (from rev 372568, sagemath/trunk/sagemath-eclib-20180710.patch) sagemath/repos/community-staging-x86_64/sagemath-env.patch (from rev 372568, sagemath/trunk/sagemath-env.patch) sagemath/repos/community-staging-x86_64/sagemath-gap-4.8.patch (from rev 372568, sagemath/trunk/sagemath-gap-4.8.patch) sagemath/repos/community-staging-x86_64/sagemath-lcalc-c++11.patch (from rev 372568, sagemath/trunk/sagemath-lcalc-c++11.patch) sagemath/repos/community-staging-x86_64/sagemath-python3-notebook.patch (from rev 372568, sagemath/trunk/sagemath-python3-notebook.patch) sagemath/repos/community-staging-x86_64/sagemath-scipy-1.0.patch (from rev 372568, sagemath/trunk/sagemath-scipy-1.0.patch) sagemath/repos/community-staging-x86_64/sagemath-singular-4.1.1.patch (from rev 372568, sagemath/trunk/sagemath-singular-4.1.1.patch) sagemath/repos/community-staging-x86_64/sagemath-threejs.patch (from rev 372568, sagemath/trunk/sagemath-threejs.patch) sagemath/repos/community-staging-x86_64/test-optional.patch (from rev 372568, sagemath/trunk/test-optional.patch) ---------------------------------+ PKGBUILD | 174 +++++++ fes02.patch | 57 ++ latte-count.patch | 89 +++ package.patch | 39 + r-no-readline.patch | 11 sagemath-cremona.patch | 31 + sagemath-eclib-20180710.patch | 24 + sagemath-env.patch | 172 +++++++ sagemath-gap-4.8.patch | 31 + sagemath-lcalc-c++11.patch | 10 sagemath-python3-notebook.patch | 27 + sagemath-scipy-1.0.patch | 16 sagemath-singular-4.1.1.patch | 902 ++++++++++++++++++++++++++++++++++++++ sagemath-threejs.patch | 11 test-optional.patch | 27 + 15 files changed, 1621 insertions(+) Copied: sagemath/repos/community-staging-x86_64/PKGBUILD (from rev 372568, sagemath/trunk/PKGBUILD) =================================================================== --- community-staging-x86_64/PKGBUILD (rev 0) +++ community-staging-x86_64/PKGBUILD 2018-08-17 22:29:46 UTC (rev 372569) @@ -0,0 +1,174 @@ +# Maintainer: Antonio Rojas <aro...@archlinux.org> +# Contributor: Evgeniy Alekseev <arcanis.arch at gmail dot com> +# Contributor: Daniel Wallace <danielwallace at gtmanfred dot com> +# Contributor: Thomas Dziedzic <gostrc at gmail dot com> +# Contributor: Osman Ugus <ugus11 at yahoo dot com> +# Contributor: Stefan Husmann <stefan-husmann at t-online dot de> + +pkgbase=sagemath +pkgname=(sagemath sagemath-jupyter) +pkgver=8.3 +pkgrel=1 +pkgdesc="Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab" +arch=(x86_64) +url="http://www.sagemath.org" +license=(GPL) +depends=(ipython2 ppl palp brial cliquer maxima-ecl gfan sympow nauty python2-rpy2 python2-fpylll python2-psutil python2-cypari2 + python2-matplotlib python2-scipy python2-sympy python2-networkx python2-pillow python2-future libgap flintqs lcalc lrcalc arb + eclib gmp-ecm zn_poly gd python2-cvxopt pynac linbox rubiks pari-galdata pari-seadata-small planarity rankwidth tachyon + sage-data-combinatorial_designs sage-data-elliptic_curves sage-data-graphs sage-data-polytopes_db sage-data-conway_polynomials) +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' + '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' + 'coxeter: Coxeter groups implementation' 'cryptominisat5: SAT solver' 'gap-4.8-data: for computing Galois groups' + 'lrs: Algorithms for linear reverse search used in game theory and for computing volume of polytopes' + 'libhomfly: for computing the homfly polynomial of links' 'libbraiding: for computing in braid groups' + 'libfes: exhaustive search of solutions for boolean equations' 'python2-pynormaliz: Normaliz backend for polyhedral computations' + 'latte-integrale: integral point count in polyhedra' 'polymake: polymake backend for polyhedral computations' + 'shared_meataxe: faster matrix arithmetic over finite fields' 'openblas: faster linear algebra' + 'sirocco: for computing the fundamental group of the complement of a plane curve' 'primecount: faster prime_pi implementation' + 'three.js: alternative 3D plots engine' 'dot2tex: for displaying some diagrams' + 'python2-pip: to install optional packages with sage -pip') +makedepends=(cython2 boost ratpoints symmetrica python2-jinja coin-or-cbc libhomfly libbraiding sirocco + mcqd coxeter bliss-graphs 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 + r-no-readline.patch + fes02.patch + sagemath-threejs.patch + sagemath-cremona.patch + sagemath-scipy-1.0.patch + sagemath-singular-4.1.1.patch + sagemath-lcalc-c++11.patch + sagemath-gap-4.8.patch + sagemath-cypari2.patch::"https://git.sagemath.org/sage.git/patch?id=da380b32" + sagemath-cddlib-0.94j.patch::"https://git.sagemath.org/sage.git/patch?id=af0e6066" + sagemath-eclib-20180710.patch) +sha256sums=('41fd0b4eb820f7a1274e12294b6fbdbbf60d0027bff98c22fdc84da140964929' + 'f483a448c045aeff186bec4b402da8109fa12547ff36219a9aa427c2561ec8e5' + '960afe4fcbffe2762b66119b8f14355386ced0d8ee52b535d0dac1dba90d365b' + 'ef265f88ceb6caf4aac2d86ea74850861d99a63d11c94fc52b2ce88053c26d1e' + 'fc393ee5fbf507dfb76d6ad0e9193d74a954acb13f35a371bf91e11bbcb08244' + '18edeafb01cc1ed7270c2dfb41a58717918680c98e8eada1858736acd65d92ba' + 'afd0952b9bb8f52fd428eae36cf719a58ff85a894baae88cbb2124e043768cc7' + '7fcb52e96935dccb0f958d37c2f4e3918392480b9af53e08562f6cba6c68cb94' + '4722f9257f7b58a5dc8be2e9163ebba6d7b3ee011ff1ab9c0dbfb1330d367261' + 'f801be68d043f317cc2a85a5ca059010b68eaeafa3bbf5c9148f2c154e2a707d' + '17397b8e1843b013ef5d2e083369109f0719651edd8ef0c8493cb49e2bc4324a' + '600701ee849d296cef63fad2dbf57db4d6d6259e2e5e1415a7ceaa385d98d5b9' + '5114c912f821900e5bfae1e2cfeb7984de946d0b23e1182b0bf15be1d803dfd0' + 'b2c9b9695c358f868c3868790382cf7d112092184ce08f5733524d406ec20cac' + '94847fc033fd36bc59217c8484d4cf48d0640ff35bb5ca5ffba88a8158c6dd44' + '9a690bda83c280c0801f6d04353e8a909da80ccfee92e06d200ae6eb9be9a5a8' + '182b0765d58494978bf27628bada8b42c95ef7eb2671b91ddf9c67608560c662') + +prepare(){ + cd sage-$pkgver + +# 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 +# fix freezes in R interface with readline 7 (Debian) + patch -p1 -i ../r-no-readline.patch +# use correct latte-count binary name + patch -p1 -i ../latte-count.patch +# make 'sage -notebook=jupyter' work with our python3 jupyter-notebook package + patch -p1 -i ../sagemath-python3-notebook.patch +# fix three.js plotting backend + patch -p1 -i ../sagemath-threejs.patch +# remove deprecated scipy parameters + patch -p1 -i ../sagemath-scipy-1.0.patch +# fix build with Singular 4.1.1 + patch -p1 -i ../sagemath-singular-4.1.1.patch +# don't force c++98 for lcalc (fixes build with NTL 11) + patch -p1 -i ../sagemath-lcalc-c++11.patch +# Adjust paths for gap-4.8 + patch -p1 -i ../sagemath-gap-4.8.patch +# Fix build with eclib 20180710 + patch -p1 -i ../sagemath-eclib-20180710.patch + +# Upstream patches +# fix build against libfes 0.2 http://trac.sagemath.org/ticket/15209 + patch -p1 -i ../fes02.patch +# use Features to detect Cremona databases https://trac.sagemath.org/ticket/25825 + patch -p1 -i ../sagemath-cremona.patch +# update to cypari2 https://trac.sagemath.org/ticket/25813 + patch -p1 -i ../sagemath-cypari2.patch +# port to cddlib 0.94j https://trac.sagemath.org/ticket/25344 + patch -p1 -i ../sagemath-cddlib-0.94j.patch + +# use python2 + sed -e 's|#!/usr/bin/env sage-python23|#!/usr/bin/env python2|' -e 's|#!/usr/bin/env python\b|#!/usr/bin/env python2|' -i src/bin/* + sed -e 's|cython {OPT}|cython2 {OPT}|' -e 's|python setup.py|python2 setup.py|' -i src/sage/misc/cython.py + sed -e 's|exec ipython\b|exec ipython2|' -e 's|exec pip\b|exec pip2|' -e 's|cygdb|cygdb2|g' -i src/bin/sage + sed -e "s|'cython'|'cython2'|" -i src/bin/sage-cython +} + + +build() { + cd sage-$pkgver/src + + export CC=gcc + export SAGE_ROOT="$PWD" + export SAGE_SRC="$PWD" + python2 setup.py build +} + +package_sagemath() { + optdepends+=('sagemath-jupyter: Jupyter kernel') + + cd sage-$pkgver/src + + export SAGE_ROOT="$PWD" + export SAGE_LOCAL="/usr" + export SAGE_EXTCODE="$PWD"/ext + python2 setup.py install --root="$pkgdir" --optimize=1 + + mkdir -p "$pkgdir"/usr/bin + cp bin/sage "$pkgdir"/usr/bin + for _i in cachegrind callgrind cleaner coverage coverageall cython env eval 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 + cp bin/sage-$_i "$pkgdir"/usr/bin + done + cp bin/math-readline "$pkgdir"/usr/bin + + mkdir -p "$pkgdir"/usr/share/sage + cp -r ext "$pkgdir"/usr/share/sage + +# Remove sage_setup + rm -r "$pkgdir"/usr/lib/python2.7/site-packages/sage_setup + +# Split jupyter kernel + rm -r "$pkgdir"/usr/share/jupyter +} + +package_sagemath-jupyter() { + pkgdesc='Jupyter kernel for SageMath' + depends=(sagemath python2-jupyter_client python2-ipywidgets mathjax) + optdepends=('sage-notebook-exporter: convert flask notebooks to Jupyter') + + cd sage-$pkgver/src + + export SAGE_ROOT="$PWD" + export SAGE_LOCAL="/usr" + + python2 -c "from sage.repl.ipython_kernel.install import SageKernelSpec; SageKernelSpec.update(prefix='$pkgdir/usr')" +# fix symlinks to assets + for _i in $(ls ext/notebook-ipython); do + rm "$pkgdir"/usr/share/jupyter/kernels/sagemath/$_i + ln -s /usr/share/sage/ext/notebook-ipython/$_i "$pkgdir"/usr/share/jupyter/kernels/sagemath/ + done +} Copied: sagemath/repos/community-staging-x86_64/fes02.patch (from rev 372568, sagemath/trunk/fes02.patch) =================================================================== --- community-staging-x86_64/fes02.patch (rev 0) +++ community-staging-x86_64/fes02.patch 2018-08-17 22:29:46 UTC (rev 372569) @@ -0,0 +1,57 @@ +From b1f5e3ecc789db674fe17552812f2d0e2ab84be0 Mon Sep 17 00:00:00 2001 +From: Charles Bouillaguet <charles.bouillag...@lifl.fr> +Date: Thu, 19 Sep 2013 10:31:11 +0200 +Subject: updating the libFES binding to match a change in the interface + +--- + src/sage/libs/fes.pyx | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/src/sage/libs/fes.pyx b/src/sage/libs/fes.pyx +index 40b9c23..d188cf0 100644 +--- a/src/sage/libs/fes.pyx ++++ b/src/sage/libs/fes.pyx +@@ -1,17 +1,19 @@ + """ +-Binding for the FES library. ++Binding for the libFES library. + + Finding solutions of systems of boolean equations by exhaustive + search, via the fes library. This is usually (much) faster than + computing a Groebner basis, except in special cases where the latter + is particularly easy. + +-The FES library is presently only able to deal with polynomials in 64 ++More information is available at [http://www.lifl.fr/~bouillag/fes]. ++ ++The libFES library is presently only able to deal with polynomials in 64 + variables. Performing a full exhaustive search over 64 variables will + take a **long** time. The number of variables can be artificially + reduced to 64 by specializing some of them. + +-Note that the FES library **requires** at least of the equations to be ++Note that the libFES library **requires** at least of the equations to be + non-linear. + + AUTHORS: +@@ -71,7 +73,7 @@ from libc.stdint cimport uint64_t + cdef extern from "fes_interface.h": + ctypedef int (*solution_callback_t)(void *, uint64_t) + +- void exhaustive_search_wrapper(int n, int n_eqs, int degree, int ***coeffs, solution_callback_t callback, void* callback_state, int verbose) ++ void exhaustive_search_wrapper(int n, int n_eqs, int degree, int ***coeffs, solution_callback_t callback, void* callback_state, int verbose, int T) + + + from sage.rings.integer import Integer +@@ -217,7 +217,7 @@ def exhaustive_search(eqs, max_sols=Infinity, verbose=False): + + # ------- runs the library + sig_on() +- exhaustive_search_wrapper(n, len(eqs), degree, coeffs, report_solution, <void *> internal_state, verbose) ++ exhaustive_search_wrapper(n, len(eqs), degree, coeffs, report_solution, <void *> internal_state, verbose, 0) + sig_off() + + # ------- frees memory occupied by the dense representation of the equations +-- +cgit v1.0-1-gd88e + Copied: sagemath/repos/community-staging-x86_64/latte-count.patch (from rev 372568, sagemath/trunk/latte-count.patch) =================================================================== --- community-staging-x86_64/latte-count.patch (rev 0) +++ community-staging-x86_64/latte-count.patch 2018-08-17 22:29:46 UTC (rev 372569) @@ -0,0 +1,89 @@ +diff --git a/src/sage/geometry/polyhedron/base_ZZ.py b/src/sage/geometry/polyhedron/base_ZZ.py +index 268af9db0d..70d41dfa30 100644 +--- a/src/sage/geometry/polyhedron/base_ZZ.py ++++ b/src/sage/geometry/polyhedron/base_ZZ.py +@@ -171,7 +171,7 @@ class Polyhedron_ZZ(Polyhedron_base): + sage: p = P.ehrhart_polynomial(maxdet=5, verbose=True) # optional - latte_int + This is LattE integrale ... + ... +- Invocation: count --ehrhart-polynomial '--redundancy-check=none' --cdd '--maxdet=5' /dev/stdin ++ Invocation: latte-count --ehrhart-polynomial '--redundancy-check=none' --cdd '--maxdet=5' /dev/stdin + ... + sage: p # optional - latte_int + 1/2*t^2 + 3/2*t + 1 +@@ -179,7 +179,7 @@ class Polyhedron_ZZ(Polyhedron_base): + sage: p = P.ehrhart_polynomial(dual=True, verbose=True) # optional - latte_int + This is LattE integrale ... + ... +- Invocation: count --ehrhart-polynomial '--redundancy-check=none' --cdd --dual /dev/stdin ++ Invocation: latte-count --ehrhart-polynomial '--redundancy-check=none' --cdd --dual /dev/stdin + ... + sage: p # optional - latte_int + 1/2*t^2 + 3/2*t + 1 +@@ -187,7 +187,7 @@ class Polyhedron_ZZ(Polyhedron_base): + sage: p = P.ehrhart_polynomial(irrational_primal=True, verbose=True) # optional - latte_int + This is LattE integrale ... + ... +- Invocation: count --ehrhart-polynomial '--redundancy-check=none' --cdd --irrational-primal /dev/stdin ++ Invocation: latte-count --ehrhart-polynomial '--redundancy-check=none' --cdd --irrational-primal /dev/stdin + ... + sage: p # optional - latte_int + 1/2*t^2 + 3/2*t + 1 +@@ -195,7 +195,7 @@ class Polyhedron_ZZ(Polyhedron_base): + sage: p = P.ehrhart_polynomial(irrational_all_primal=True, verbose=True) # optional - latte_int + This is LattE integrale ... + ... +- Invocation: count --ehrhart-polynomial '--redundancy-check=none' --cdd --irrational-all-primal /dev/stdin ++ Invocation: latte-count --ehrhart-polynomial '--redundancy-check=none' --cdd --irrational-all-primal /dev/stdin + ... + sage: p # optional - latte_int + 1/2*t^2 + 3/2*t + 1 +@@ -207,7 +207,7 @@ class Polyhedron_ZZ(Polyhedron_base): + ... + RuntimeError: LattE integrale program failed (exit code 1): + ... +- Invocation: count --ehrhart-polynomial '--redundancy-check=none' --cdd '--bim-bam-boum=19' /dev/stdin ++ Invocation: latte-count --ehrhart-polynomial '--redundancy-check=none' --cdd '--bim-bam-boum=19' /dev/stdin + Unknown command/option --bim-bam-boum=19 + """ + if self.is_empty(): +diff --git a/src/sage/interfaces/latte.py b/src/sage/interfaces/latte.py +index 066cedd401..302b39910d 100644 +--- a/src/sage/interfaces/latte.py ++++ b/src/sage/interfaces/latte.py +@@ -93,7 +93,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 ... + ... +- Invocation: count '--redundancy-check=none' --cdd /dev/stdin ++ Invocation: latte-count '--redundancy-check=none' --cdd /dev/stdin + ... + Total Unimodular Cones: ... + Maximum number of simplicial cones in memory at once: ... +@@ -112,7 +112,7 @@ def count(arg, ehrhart_polynomial=False, multivariate_generating_function=False, + # Check that LattE is present + Latte().require() + +- args = ['count'] ++ args = ['latte-count'] + if ehrhart_polynomial and multivariate_generating_function: + raise ValueError + if ehrhart_polynomial: +diff --git a/src/sage/features/latte.py b/src/sage/features/latte.py +index 63d227fd35..040a5cf1f9 100644 +--- a/src/sage/features/latte.py ++++ b/src/sage/features/latte.py +@@ -10,10 +10,10 @@ from . import Executable, Feature, FeatureTestResult + + class Latte_count(Executable): + r""" +- Feature for the executable ``count`` from the LattE suite. ++ Feature for the executable ``latte-count`` from the LattE suite. + """ + def __init__(self): +- Executable.__init__(self, "count", executable="count", spkg="latte_int", url="https://www.math.ucdavis.edu/~latte/software.php") ++ Executable.__init__(self, "latte-count", executable="latte-count", spkg="latte_int", url="https://www.math.ucdavis.edu/~latte/software.php") + + class Latte_integrate(Executable): + r""" + Copied: sagemath/repos/community-staging-x86_64/package.patch (from rev 372568, sagemath/trunk/package.patch) =================================================================== --- community-staging-x86_64/package.patch (rev 0) +++ community-staging-x86_64/package.patch 2018-08-17 22:29:46 UTC (rev 372569) @@ -0,0 +1,39 @@ +--- src/sage/misc/package.py.orig 2014-11-23 15:58:13.000000000 +0100 ++++ src/sage/misc/package.py 2015-01-22 20:32:25.651383902 +0100 +@@ -328,7 +328,7 @@ + Use the framework provided by :mod:`sage.features` to check + whether a library is installed and functional. + """ +- return any(p.split('-')[0] == package for p in installed_packages(exclude_pip)) ++ return True + + def package_versions(package_type, local=False): + r""" +--- src/sage_setup/optional_extension.py.orig 2016-10-19 18:35:10.092577510 +0000 ++++ src/sage_setup/optional_extension.py 2016-10-19 18:38:13.514765366 +0000 +@@ -21,8 +21,6 @@ + from distutils.extension import Extension + from sage.misc.package import list_packages + +-all_packages = list_packages(local=True) +- + + class CythonizeExtension(Extension): + """ +@@ -76,15 +74,7 @@ + condition = kwds.pop("condition") + except KeyError: + pkg = kwds.pop("package") +- from sage.misc.package import is_package_installed +- try: +- pkginfo = all_packages[pkg] +- except KeyError: +- # Might be an installed old-style package +- condition = is_package_installed(pkg) +- else: +- condition = (pkginfo["installed_version"] == pkginfo["remote_version"]) +- ++ condition = True + if condition: + return Extension(*args, **kwds) + else: Copied: sagemath/repos/community-staging-x86_64/r-no-readline.patch (from rev 372568, sagemath/trunk/r-no-readline.patch) =================================================================== --- community-staging-x86_64/r-no-readline.patch (rev 0) +++ community-staging-x86_64/r-no-readline.patch 2018-08-17 22:29:46 UTC (rev 372569) @@ -0,0 +1,11 @@ +--- a/src/sage/interfaces/r.py ++++ b/src/sage/interfaces/r.py +@@ -332,7 +332,7 @@ + prompt = '> ', #default, later comes the change + + # This is the command that starts up your program +- command = "R --vanilla --quiet", ++ command = "R --no-readline --vanilla --quiet", + + server=server, + server_tmpdir=server_tmpdir, Copied: sagemath/repos/community-staging-x86_64/sagemath-cremona.patch (from rev 372568, sagemath/trunk/sagemath-cremona.patch) =================================================================== --- community-staging-x86_64/sagemath-cremona.patch (rev 0) +++ community-staging-x86_64/sagemath-cremona.patch 2018-08-17 22:29:46 UTC (rev 372569) @@ -0,0 +1,31 @@ +diff --git a/src/sage/databases/cremona.py b/src/sage/databases/cremona.py +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 + + 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 SAGE_SHARE + from sage.misc.all import walltime + +@@ -825,7 +825,7 @@ class MiniCremonaDatabase(SQLDatabase): + if N < self.largest_conductor(): + message = "There is no elliptic curve with label " + label \ + + " in the database" +- elif is_package_installed('database_cremona_ellcurve'): ++ elif DatabaseCremona().is_present(): + message = "There is no elliptic curve with label " + label \ + + " in the currently available databases" + else: +@@ -1673,7 +1673,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: +- if is_package_installed('database_cremona_ellcurve'): ++ if DatabaseCremona().is_present(): + name = 'cremona' + else: + name = 'cremona mini' Copied: sagemath/repos/community-staging-x86_64/sagemath-eclib-20180710.patch (from rev 372568, sagemath/trunk/sagemath-eclib-20180710.patch) =================================================================== --- community-staging-x86_64/sagemath-eclib-20180710.patch (rev 0) +++ community-staging-x86_64/sagemath-eclib-20180710.patch 2018-08-17 22:29:46 UTC (rev 372569) @@ -0,0 +1,24 @@ +diff --git a/src/sage/libs/eclib/wrap.cpp b/src/sage/libs/eclib/wrap.cpp +index 5fd5693b53..d12468faa8 100644 +--- a/src/sage/libs/eclib/wrap.cpp ++++ b/src/sage/libs/eclib/wrap.cpp +@@ -133,8 +133,8 @@ char* Curvedata_isogeny_class(struct Curvedata* E, int verbose) + + + int mw_process(struct Curvedata* curve, struct mw* m, +- const struct bigint* x, const struct bigint* y, +- const struct bigint* z, int sat) ++ const bigint* x, const bigint* y, ++ const bigint* z, int sat) + { + Point P(*curve, *x, *y, *z); + if (!P.isvalid()) +@@ -188,7 +188,7 @@ int mw_rank(struct mw* m) + } + + /* Returns index and unsat long array, which user must deallocate */ +-int mw_saturate(struct mw* m, struct bigint* index, char** unsat, ++int mw_saturate(struct mw* m, bigint* index, char** unsat, + long sat_bd, int odd_primes_only) + { + vector<long> v; Copied: sagemath/repos/community-staging-x86_64/sagemath-env.patch (from rev 372568, sagemath/trunk/sagemath-env.patch) =================================================================== --- community-staging-x86_64/sagemath-env.patch (rev 0) +++ community-staging-x86_64/sagemath-env.patch 2018-08-17 22:29:46 UTC (rev 372569) @@ -0,0 +1,172 @@ +--- 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,7 @@ + } + + +-# 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 ++NEW_SAGE_ROOT="/usr" + + + # Don't execute the commands more than once for the same version of +@@ -174,33 +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 [ -n "$SAGE_LOCAL" ] && [ -f "$SAGE_LOCAL/bin/sage-env-config" ]; then +- SAGE_SCRIPTS_DIR="$SAGE_LOCAL/bin" +- elif [ -f "$SAGE_ROOT/src/bin/sage-env-config" ]; then +- SAGE_SCRIPTS_DIR="$SAGE_ROOT/src/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 +@@ -296,8 +296,9 @@ + 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 GAP_ROOT_DIR="/usr/lib/gap-4.8" ++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 +@@ -403,29 +403,8 @@ + export SAGE_STARTUP_FILE + fi + ++export LIBMTX="$DOT_SAGE/meataxe" ++[[ -d $LIBMTX ]] || mkdir -p $LIBMTX # Create meataxe data dir +-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 + +@@ -489,8 +489,6 @@ + fi + fi + +-export MAXIMA_PREFIX="$SAGE_LOCAL" +-export MAXIMA_USERDIR="$DOT_SAGE/maxima" + + PERL5LIB="$SAGE_LOCAL/lib/perl5:$PERL5LIB" && export PERL5LIB + +@@ -601,9 +601,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 +--- src/sage/env.py.orig 2017-12-07 19:51:25.554281539 +0000 ++++ src/sage/env.py 2017-12-07 19:51:42.787654650 +0000 +@@ -117,13 +117,13 @@ + _add_variable_or_fallback('LOCAL_IDENTIFIER','$HOSTNAME.%s'%os.getpid()) + + # bunch of sage directories and files +-_add_variable_or_fallback('SAGE_ROOT', None) +-_add_variable_or_fallback('SAGE_LOCAL', None) ++_add_variable_or_fallback('SAGE_ROOT', '') ++_add_variable_or_fallback('SAGE_LOCAL', '/usr') + _add_variable_or_fallback('SAGE_ETC', opj('$SAGE_LOCAL', 'etc')) + _add_variable_or_fallback('SAGE_INC', opj('$SAGE_LOCAL', 'include')) + _add_variable_or_fallback('SAGE_SHARE', opj('$SAGE_LOCAL', 'share')) + +-_add_variable_or_fallback('SAGE_SRC', opj('$SAGE_ROOT', 'src')) ++_add_variable_or_fallback('SAGE_SRC', opj('$SAGE_LOCAL', 'lib', 'python2.7', 'site-packages')) + + try: + sitepackages_dirs = site.getsitepackages() +@@ -164,7 +164,7 @@ + _add_variable_or_fallback('GRAPHS_DATA_DIR', opj('$SAGE_SHARE','graphs')) + _add_variable_or_fallback('ELLCURVE_DATA_DIR',opj('$SAGE_SHARE','ellcurves')) + _add_variable_or_fallback('POLYTOPE_DATA_DIR',opj('$SAGE_SHARE','reflexive_polytopes')) +-_add_variable_or_fallback('GAP_ROOT_DIR', opj('$SAGE_LOCAL','gap','latest')) ++_add_variable_or_fallback('GAP_ROOT_DIR', opj('$SAGE_LOCAL','lib','gap-4.8')) + _add_variable_or_fallback('THEBE_DIR', opj('$SAGE_SHARE','thebe')) + + # locate singular shared object Copied: sagemath/repos/community-staging-x86_64/sagemath-gap-4.8.patch (from rev 372568, sagemath/trunk/sagemath-gap-4.8.patch) =================================================================== --- community-staging-x86_64/sagemath-gap-4.8.patch (rev 0) +++ community-staging-x86_64/sagemath-gap-4.8.patch 2018-08-17 22:29:46 UTC (rev 372569) @@ -0,0 +1,31 @@ +diff --git a/src/sage/interfaces/gap.py b/src/sage/interfaces/gap.py +index 177fc1b6eb..51c67bdd09 100644 +--- a/src/sage/interfaces/gap.py ++++ b/src/sage/interfaces/gap.py +@@ -197,11 +197,11 @@ import string + + WORKSPACE = gap_workspace_file() + +-GAP_BINARY = os.path.join(SAGE_LOCAL, 'bin', 'gap') ++GAP_BINARY = os.path.join(SAGE_LOCAL, 'bin', 'gap-4.8') + + first_try = True + +-gap_cmd = "gap -r" ++gap_cmd = "gap-4.8 -r" + if platform.processor() == 'ia64' and os.path.exists('/usr/bin/prctl'): + # suppress unaligned access to 0x..., ip=0x... warnings + gap_cmd = 'prctl --unaligned=silent ' + gap_cmd +diff --git a/src/sage/libs/gap/util.pyx b/src/sage/libs/gap/util.pyx +index 7bffcfc00d..51dad178d5 100644 +--- a/src/sage/libs/gap/util.pyx ++++ b/src/sage/libs/gap/util.pyx +@@ -170,7 +170,7 @@ def gap_root(): + if os.path.exists(GAP_ROOT_DIR): + return GAP_ROOT_DIR + print('The gap-4.5.5.spkg (or later) seems to be not installed!') +- gap_sh = open(os.path.join(SAGE_LOCAL, 'bin', 'gap')).read().splitlines() ++ gap_sh = open(os.path.join(SAGE_LOCAL, 'bin', 'gap-4.8')).read().splitlines() + gapdir = filter(lambda dir:dir.strip().startswith('GAP_DIR'), gap_sh)[0] + gapdir = gapdir.split('"')[1] + gapdir = gapdir.replace('$SAGE_LOCAL', SAGE_LOCAL) Copied: sagemath/repos/community-staging-x86_64/sagemath-lcalc-c++11.patch (from rev 372568, sagemath/trunk/sagemath-lcalc-c++11.patch) =================================================================== --- community-staging-x86_64/sagemath-lcalc-c++11.patch (rev 0) +++ community-staging-x86_64/sagemath-lcalc-c++11.patch 2018-08-17 22:29:46 UTC (rev 372569) @@ -0,0 +1,10 @@ +--- a/src/sage/libs/lcalc/lcalc_Lfunction.pxd ++++ b/src/sage/libs/lcalc/lcalc_Lfunction.pxd +@@ -1,6 +1,5 @@ + # Lcalc requires GNU extensions, it does not strictly conform to any + # C++ standard: https://trac.sagemath.org/ticket/23341 +-# distutils: extra_compile_args = -std=gnu++98 + + cdef extern from "lcalc_sage.h": + ctypedef struct doublevec "std::vector<double>": + Copied: sagemath/repos/community-staging-x86_64/sagemath-python3-notebook.patch (from rev 372568, sagemath/trunk/sagemath-python3-notebook.patch) =================================================================== --- community-staging-x86_64/sagemath-python3-notebook.patch (rev 0) +++ community-staging-x86_64/sagemath-python3-notebook.patch 2018-08-17 22:29:46 UTC (rev 372569) @@ -0,0 +1,27 @@ +diff --git a/src/bin/sage-notebook b/src/bin/sage-notebook +index 74192da240..0ede281aad 100755 +--- a/src/bin/sage-notebook ++++ b/src/bin/sage-notebook +@@ -96,8 +96,7 @@ class NotebookJupyter(object): + if not have_prerequisites(): + print(self.PREREQUISITE_ERROR) + raise SystemExit(1) +- from notebook.notebookapp import main +- main(argv) ++ os.execvp('jupyter-notebook', ['jupyter-notebook'] + argv) + + + class NotebookJupyterlab(object): +diff --git a/src/sage/repl/ipython_kernel/install.py b/src/sage/repl/ipython_kernel/install.py +index 3912b8cdf5..bd40cdadda 100644 +--- a/src/sage/repl/ipython_kernel/install.py ++++ b/src/sage/repl/ipython_kernel/install.py +@@ -289,7 +289,6 @@ def have_prerequisites(debug=True): + True + """ + try: +- from notebook.notebookapp import NotebookApp + return True + except ImportError: + if debug: + Copied: sagemath/repos/community-staging-x86_64/sagemath-scipy-1.0.patch (from rev 372568, sagemath/trunk/sagemath-scipy-1.0.patch) =================================================================== --- community-staging-x86_64/sagemath-scipy-1.0.patch (rev 0) +++ community-staging-x86_64/sagemath-scipy-1.0.patch 2018-08-17 22:29:46 UTC (rev 372569) @@ -0,0 +1,16 @@ +diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py +index 17b5ebb84b..7ce9055cba 100644 +--- a/src/sage/numerical/optimize.py ++++ b/src/sage/numerical/optimize.py +@@ -486,9 +486,9 @@ def minimize_constrained(func,cons,x0,gradient=None,algorithm='default', **args) + else: + min = optimize.fmin_tnc(f, x0, approx_grad=True, bounds=cons, messages=0, **args)[0] + elif isinstance(cons[0], function_type) or isinstance(cons[0], Expression): +- min = optimize.fmin_cobyla(f, x0, cons, iprint=0, **args) ++ min = optimize.fmin_cobyla(f, x0, cons, **args) + elif isinstance(cons, function_type) or isinstance(cons, Expression): +- min = optimize.fmin_cobyla(f, x0, cons, iprint=0, **args) ++ min = optimize.fmin_cobyla(f, x0, cons, **args) + return vector(RDF, min) + + Copied: sagemath/repos/community-staging-x86_64/sagemath-singular-4.1.1.patch (from rev 372568, sagemath/trunk/sagemath-singular-4.1.1.patch) =================================================================== --- community-staging-x86_64/sagemath-singular-4.1.1.patch (rev 0) +++ community-staging-x86_64/sagemath-singular-4.1.1.patch 2018-08-17 22:29:46 UTC (rev 372569) @@ -0,0 +1,902 @@ +From 426644f6d085e053fa0fcf3457702eac685b7cba Mon Sep 17 00:00:00 2001 +From: Antonio Rojas <aro...@archlinux.org> +Date: Sat, 7 Jul 2018 00:37:37 +0200 +Subject: Adapt to singular 4.1.1 API changes + +--- + src/sage/libs/singular/decl.pxd | 4 ++-- + .../rings/polynomial/multi_polynomial_libsingular.pyx | 16 ++++++++-------- + src/sage/rings/polynomial/plural.pyx | 4 ++-- + 3 files changed, 12 insertions(+), 12 deletions(-) + +diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd +index 4b658c4..84476a9 100644 +--- a/src/sage/libs/singular/decl.pxd ++++ b/src/sage/libs/singular/decl.pxd +@@ -170,7 +170,7 @@ cdef extern from "singular/Singular/libsingular.h": + + int n_NumberOfParameters(const n_Procs_s* r) + +- ctypedef struct poly "polyrec": ++ ctypedef struct poly "spolyrec": + poly *next + number *coef + unsigned long exp[1] +@@ -632,7 +632,7 @@ cdef extern from "singular/Singular/libsingular.h": + + # divide monomial p by monomial q, p,q const + +- poly *pDivide(poly *p,poly *q) ++ poly *pMDivide(poly *p,poly *q) + + # return the i-th power of p; p destroyed, requires global ring + +diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +index 2a8d9ae..f2a11a8 100644 +--- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx ++++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +@@ -190,8 +190,8 @@ from sage.libs.singular.decl cimport ( + n_IsUnit, n_Invers, + p_ISet, rChangeCurrRing, p_Copy, p_Init, p_SetCoeff, p_Setm, p_SetExp, p_Add_q, + p_NSet, p_GetCoeff, p_Delete, p_GetExp, pNext, rRingVar, omAlloc0, omStrDup, +- omFree, pDivide, p_SetCoeff0, n_Init, p_DivisibleBy, pLcm, p_LmDivisibleBy, +- pDivide, p_IsConstant, p_ExpVectorEqual, p_String, p_LmInit, n_Copy, ++ omFree, pMDivide, p_SetCoeff0, n_Init, p_DivisibleBy, pLcm, p_LmDivisibleBy, ++ pMDivide, p_IsConstant, p_ExpVectorEqual, p_String, p_LmInit, n_Copy, + p_IsUnit, p_Series, p_Head, idInit, fast_map_common_subexp, id_Delete, + p_IsHomogeneous, p_Homogen, p_Totaldegree,pLDeg1_Totaldegree, singclap_pdivide, singclap_factorize, + idLift, IDELEMS, On, Off, SW_USE_CHINREM_GCD, SW_USE_EZGCD, +@@ -1693,8 +1693,8 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_base): + if not g._poly: + raise ZeroDivisionError + +- if r!=currRing: rChangeCurrRing(r) # pDivide +- res = pDivide(f._poly, g._poly) ++ if r!=currRing: rChangeCurrRing(r) # pMDivide ++ res = pMDivide(f._poly, g._poly) + if coeff: + if r.cf.type == n_unknown or r.cf.cfDivBy(p_GetCoeff(f._poly, r), p_GetCoeff(g._poly, r), r.cf): + n = r.cf.cfDiv( p_GetCoeff(f._poly, r) , p_GetCoeff(g._poly, r), r.cf) +@@ -1853,8 +1853,8 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_base): + and (<MPolynomial_libsingular>g) \ + and g.parent() is self \ + and p_LmDivisibleBy((<MPolynomial_libsingular>g)._poly, m, r): +- if r!=currRing: rChangeCurrRing(r) # pDivide +- flt = pDivide(f._poly, (<MPolynomial_libsingular>g)._poly) ++ if r!=currRing: rChangeCurrRing(r) # pMDivide ++ flt = pMDivide(f._poly, (<MPolynomial_libsingular>g)._poly) + #p_SetCoeff(flt, n_Div( p_GetCoeff(f._poly, r) , p_GetCoeff((<MPolynomial_libsingular>g)._poly, r), r), r) + p_SetCoeff(flt, n_Init(1, r), r) + return new_MP(self,flt), g +@@ -4055,10 +4055,10 @@ cdef class MPolynomial_libsingular(MPolynomial): + if _right.is_monomial(): + p = _self._poly + quo = p_ISet(0,r) +- if r != currRing: rChangeCurrRing(r) # pDivide ++ if r != currRing: rChangeCurrRing(r) # pMDivide + while p: + if p_DivisibleBy(_right._poly, p, r): +- temp = pDivide(p, _right._poly) ++ temp = pMDivide(p, _right._poly) + p_SetCoeff0(temp, n_Copy(p_GetCoeff(p, r), r), r) + quo = p_Add_q(quo, temp, r) + p = pNext(p) +diff --git a/src/sage/rings/polynomial/plural.pyx b/src/sage/rings/polynomial/plural.pyx +index d5439f7f..ad20ebc 100644 +--- a/src/sage/rings/polynomial/plural.pyx ++++ b/src/sage/rings/polynomial/plural.pyx +@@ -998,7 +998,7 @@ cdef class NCPolynomialRing_plural(Ring): + if not g._poly: + raise ZeroDivisionError + +- res = pDivide(f._poly,g._poly) ++ res = pMDivide(f._poly,g._poly) + if coeff: + if (r.cf.type == n_unknown) or r.cf.cfDivBy(p_GetCoeff(f._poly, r), p_GetCoeff(g._poly, r), r.cf): + n = r.cf.cfDiv( p_GetCoeff(f._poly, r) , p_GetCoeff(g._poly, r), r.cf) +@@ -1193,7 +1193,7 @@ cdef class NCPolynomialRing_plural(Ring): + if isinstance(g, NCPolynomial_plural) \ + and (<NCPolynomial_plural>g) \ + and p_LmDivisibleBy((<NCPolynomial_plural>g)._poly, m, r): +- flt = pDivide(f._poly, (<NCPolynomial_plural>g)._poly) ++ flt = pMDivide(f._poly, (<NCPolynomial_plural>g)._poly) + #p_SetCoeff(flt, n_Div( p_GetCoeff(f._poly, r) , p_GetCoeff((<NCPolynomial_plural>g)._poly, r), r), r) + p_SetCoeff(flt, n_Init(1, r), r) + return new_NCP(self,flt), g +-- +cgit v1.0-1-gd88e + + +From d5fc2a4bc640856507d743c2f67ad454874700e7 Mon Sep 17 00:00:00 2001 +From: Antonio Rojas <aro...@archlinux.org> +Date: Sat, 7 Jul 2018 00:38:56 +0200 +Subject: Don't call singclap_pdivide for integer coefficients, it's no longer + supported + +--- + src/sage/rings/polynomial/multi_polynomial_libsingular.pyx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +index f2a11a8..774fecd 100644 +--- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx ++++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +@@ -4888,7 +4888,7 @@ cdef class MPolynomial_libsingular(MPolynomial): + if right.is_zero(): + raise ZeroDivisionError + +- if not self._parent._base.is_field() and not is_IntegerRing(self._parent._base): ++ if not self._parent._base.is_field(): + py_quo = self//right + py_rem = self - right*py_quo + return py_quo, py_rem +-- +cgit v1.0-1-gd88e + + +From 4763da19a9ea0be849ee3640fc39747d725cb5a1 Mon Sep 17 00:00:00 2001 +From: Antonio Rojas <aro...@archlinux.org> +Date: Sat, 21 Jul 2018 11:31:02 +0200 +Subject: Fix lcm of polynomials with integer coefficients and add test + +--- + src/sage/rings/polynomial/multi_polynomial_libsingular.pyx | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +index 774fecd..bb5aca6 100644 +--- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx ++++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +@@ -4794,6 +4794,8 @@ cdef class MPolynomial_libsingular(MPolynomial): + sage: p = -x*y + x*z + 54*x - 2 + sage: (5*p^2).lcm(3*p) == 15*p^2 + True ++ sage: lcm(2*x,2*x*y) ++ 2*x*y + """ + cdef ring *_ring = self._parent_ring + cdef poly *ret +@@ -4805,6 +4807,12 @@ cdef class MPolynomial_libsingular(MPolynomial): + if _ring.cf.type != n_unknown: + if _ring.cf.type == n_Znm or _ring.cf.type == n_Zn or _ring.cf.type == n_Z2m : + raise TypeError("LCM over non-integral domains not available.") ++ if _ring.cf.type == n_Z: ++ f_content = self.content() ++ g_content = g.content() ++ f_primitivepart = self / f_content ++ g_primitivepart = g / g_content ++ return f_primitivepart.change_ring(RationalField()).lcm(g_primitivepart.change_ring(RationalField())) * f_content.lcm(g_content) + + if self._parent is not g._parent: + _g = self._parent._coerce_c(g) +-- +cgit v1.0-1-gd88e + + +From 544f67d45ce00142d99cbca7ca1ef39df95d3551 Mon Sep 17 00:00:00 2001 +From: Timo Kaufmann <timo...@zoho.com> +Date: Fri, 20 Jul 2018 16:58:48 +0200 +Subject: =?UTF-8?q?Revert=20"Trac=20#25313:=20Speed=20up=20exact=20divisio?= + =?UTF-8?q?n=20in=20=E2=84=A4[x,y,...]"?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This reverts commit 5ef19ad3901910976878348ef2ec76637420010b, reversing +changes made to 1c41c1d6cadf5bb863d5c0d125300a153f232fa5. +--- + .../rings/polynomial/multi_polynomial_libsingular.pyx | 15 +++++---------- + 1 file changed, 5 insertions(+), 10 deletions(-) + +diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +index bb5aca6..92d6ed5 100644 +--- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx ++++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +@@ -4023,16 +4023,6 @@ cdef class MPolynomial_libsingular(MPolynomial): + Traceback (most recent call last): + ... + NotImplementedError: Division of multivariate polynomials over non fields by non-monomials not implemented. +- +- TESTS:: +- +- sage: P.<x,y> = ZZ[] +- sage: p = 3*(-x^8*y^2 - x*y^9 + 6*x^8*y + 17*x^2*y^6 - x^3*y^2) +- sage: q = 7*(x^2 + x*y + y^2 + 1) +- sage: p*q//q == p +- True +- sage: p*q//p == q +- True + """ + cdef MPolynomialRing_libsingular parent = self._parent + cdef ring *r = self._parent_ring +@@ -4052,6 +4042,11 @@ cdef class MPolynomial_libsingular(MPolynomial): + _right = <MPolynomial_libsingular>right + + if r.cf.type != n_unknown: ++ if r.cf.type == n_Z: ++ P = parent.change_ring(RationalField()) ++ f = P(self)//P(right) ++ CM = list(f) ++ return parent(sum([c.floor()*m for c,m in CM])) + if _right.is_monomial(): + p = _self._poly + quo = p_ISet(0,r) +-- +cgit v1.0-1-gd88e + + +From 2cd8487ff5a7f74c6c75659b44be5f48d27639e6 Mon Sep 17 00:00:00 2001 +From: Timo Kaufmann <timo...@zoho.com> +Date: Fri, 20 Jul 2018 18:32:20 +0200 +Subject: singular: update doctests + +--- + src/sage/rings/polynomial/multi_polynomial_ideal.py | 1 + + src/sage/rings/polynomial/multi_polynomial_libsingular.pyx | 2 +- + src/sage/rings/polynomial/polynomial_singular_interface.py | 8 ++++---- + 3 files changed, 6 insertions(+), 5 deletions(-) + +diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py +index 37dc45c..8bd5306 100644 +--- a/src/sage/rings/polynomial/multi_polynomial_ideal.py ++++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py +@@ -2199,6 +2199,7 @@ class MPolynomialIdeal_singular_repr( + sage: I.variety() + verbose 0 (...: multi_polynomial_ideal.py, variety) Warning: computations in the complex field are inexact; variety may be computed partially or incorrectly. + verbose 0 (...: multi_polynomial_ideal.py, variety) Warning: falling back to very slow toy implementation. ++ ... + [{y: -0.86602540378443... - 0.500000000000000*I}, + {y: -0.86602540378443... + 0.500000000000000*I}, + {y: 0.86602540378443... - 0.500000000000000*I}, +diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +index 92d6ed5..619e7f0 100644 +--- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx ++++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +@@ -4869,7 +4869,7 @@ cdef class MPolynomial_libsingular(MPolynomial): + sage: f.quo_rem(y) + (2*x^2, x + 1) + sage: f.quo_rem(3*x) +- (2*x*y + 1, -4*x^2*y - 2*x + 1) ++ (0, 2*x^2*y + x + 1) + + TESTS:: + +diff --git a/src/sage/rings/polynomial/polynomial_singular_interface.py b/src/sage/rings/polynomial/polynomial_singular_interface.py +index 9331169..f753610 100644 +--- a/src/sage/rings/polynomial/polynomial_singular_interface.py ++++ b/src/sage/rings/polynomial/polynomial_singular_interface.py +@@ -81,8 +81,8 @@ class PolynomialRing_singular_repr: + sage: R.<x,y> = PolynomialRing(CC) + sage: singular(R) + polynomial ring, over a field, global ordering +- // coefficients: float[I](complex:15 digits, additional 0 digits)/(I^2+1) +- // number of vars : 2 ++ // coefficients: real[I](complex:15 digits, additional 0 digits)/(I^2+1) ++ // number of vars : 2 + // block 1 : ordering dp + // : names x y + // block 2 : ordering C +@@ -90,8 +90,8 @@ class PolynomialRing_singular_repr: + sage: R.<x,y> = PolynomialRing(RealField(100)) + sage: singular(R) + polynomial ring, over a field, global ordering +- // coefficients: float +- // number of vars : 2 ++ // coefficients: Float() ++ // number of vars : 2 + // block 1 : ordering dp + // : names x y + // block 2 : ordering C +-- +cgit v1.0-1-gd88e + + +From d9dc104b4ff3d3cc34fa8ec9483f83fce033f627 Mon Sep 17 00:00:00 2001 +From: Antonio Rojas <aro...@archlinux.org> +Date: Sun, 22 Jul 2018 00:54:38 +0200 +Subject: Make Singular error parser more granular + +--- + src/sage/interfaces/singular.py | 2 +- + src/sage/rings/polynomial/multi_polynomial_ideal.py | 1 - + 2 files changed, 1 insertion(+), 2 deletions(-) + +diff --git a/src/sage/interfaces/singular.py b/src/sage/interfaces/singular.py +index 9d65c9f..031172e 100644 +--- a/src/sage/interfaces/singular.py ++++ b/src/sage/interfaces/singular.py +@@ -654,7 +654,7 @@ class Singular(ExtraTabCompletion, Expect): + + s = Expect.eval(self, x, **kwds) + +- if s.find("error") != -1 or s.find("Segment fault") != -1: ++ if s.find("error occurred") != -1 or s.find("Segment fault") != -1: + raise SingularError('Singular error:\n%s'%s) + + if get_verbose() > 0: +diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py +index 8bd5306..37dc45c 100644 +--- a/src/sage/rings/polynomial/multi_polynomial_ideal.py ++++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py +@@ -2199,7 +2199,6 @@ class MPolynomialIdeal_singular_repr( + sage: I.variety() + verbose 0 (...: multi_polynomial_ideal.py, variety) Warning: computations in the complex field are inexact; variety may be computed partially or incorrectly. + verbose 0 (...: multi_polynomial_ideal.py, variety) Warning: falling back to very slow toy implementation. +- ... + [{y: -0.86602540378443... - 0.500000000000000*I}, + {y: -0.86602540378443... + 0.500000000000000*I}, + {y: 0.86602540378443... - 0.500000000000000*I}, +-- +cgit v1.0-1-gd88e + + +From ab851b1a2485c98b9f281e5bb5ea294e84f39040 Mon Sep 17 00:00:00 2001 +From: Antonio Rojas <aro...@archlinux.org> +Date: Sun, 22 Jul 2018 01:02:23 +0200 +Subject: Update some tests output + +--- + src/sage/interfaces/singular.py | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/src/sage/interfaces/singular.py b/src/sage/interfaces/singular.py +index 031172e..f7972f5 100644 +--- a/src/sage/interfaces/singular.py ++++ b/src/sage/interfaces/singular.py +@@ -1079,7 +1079,7 @@ class Singular(ExtraTabCompletion, Expect): + sage: S = singular.ring('real', '(a,b)', 'lp') + sage: singular.current_ring() + polynomial ring, over a field, global ordering +- // coefficients: float ++ // coefficients: Float() + // number of vars : 2 + // block 1 : ordering lp + // : names a b +@@ -1157,7 +1157,7 @@ class Singular(ExtraTabCompletion, Expect): + sage: singular._tab_completion() + ['exteriorPower', + ... +- 'flintZ'] ++ 'crossprod'] + """ + p = re.compile("// *([a-z0-9A-Z_]*).*") #compiles regular expression + proclist = self.eval("listvar(proc)").splitlines() +@@ -1183,7 +1183,7 @@ class Singular(ExtraTabCompletion, Expect): + EXAMPLES:: + + sage: singular.version() +- "Singular ... version 4.1.0 ... ++ "Singular ... version 4.1.1 ... + """ + return singular_version() + +@@ -1992,7 +1992,7 @@ class SingularElement(ExtraTabCompletion, ExpectElement): + sage: S = singular.ring('real', '(a,b)', 'lp') + sage: singular.current_ring() + polynomial ring, over a field, global ordering +- // coefficients: float ++ // coefficients: Float() + // number of vars : 2 + // block 1 : ordering lp + // : names a b +@@ -2072,7 +2072,7 @@ class SingularElement(ExtraTabCompletion, ExpectElement): + sage: R._tab_completion() + ['exteriorPower', + ... +- 'flintZ'] ++ 'crossprod'] + """ + return self.parent()._tab_completion() + +@@ -2358,7 +2358,7 @@ def singular_version(): + EXAMPLES:: + + sage: singular.version() +- "Singular ... version 4.1.0 ... ++ "Singular ... version 4.1.1 ... + """ + return singular.eval('system("--version");') + +-- +cgit v1.0-1-gd88e + + +From 921cc310908e1880884af556dc9452c2b4ba8bc8 Mon Sep 17 00:00:00 2001 +From: Antonio Rojas <aro...@archlinux.org> +Date: Tue, 24 Jul 2018 18:45:26 +0200 +Subject: Fix real base ring detection + +Singular prints it as 'Float()' instead of 'real' now +--- + src/sage/interfaces/singular.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/sage/interfaces/singular.py b/src/sage/interfaces/singular.py +index f7972f5..3815951 100644 +--- a/src/sage/interfaces/singular.py ++++ b/src/sage/interfaces/singular.py +@@ -1562,7 +1562,7 @@ class SingularElement(ExtraTabCompletion, ExpectElement): + elif charstr[0] in ['0', 'QQ']: + from sage.all import QQ + br = QQ +- elif charstr[0]=='real': ++ elif charstr[0].startswith('Float'): + from sage.all import RealField, ceil, log + prec = singular.eval('ringlist(basering)[1][2][1]') + br = RealField(ceil((ZZ(prec)+1)/log(2,10))) +-- +cgit v1.0-1-gd88e + + +From 0f55b763c775bb0d652b53d50dc26f11e9f472a0 Mon Sep 17 00:00:00 2001 +From: Antonio Rojas <aro...@archlinux.org> +Date: Tue, 24 Jul 2018 19:16:20 +0200 +Subject: More real -> Float porting + +--- + src/sage/interfaces/singular.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/sage/interfaces/singular.py b/src/sage/interfaces/singular.py +index 3815951..0447920 100644 +--- a/src/sage/interfaces/singular.py ++++ b/src/sage/interfaces/singular.py +@@ -1750,7 +1750,7 @@ class SingularElement(ExtraTabCompletion, ExpectElement): + + # Singular 4 puts parentheses around floats and sign outside them + charstr = self.parent().eval('charstr(basering)').split(',',1) +- if charstr[0] in ['real', 'complex']: ++ if charstr[0]=='complex' or charstr[0].startswith('Float'): + for i in range(coeff_start, 2 * coeff_start): + singular_poly_list[i] = singular_poly_list[i].replace('(','').replace(')','') + +-- +cgit v1.0-1-gd88e + + +From aea054407a41a517070eb06e8efcd02d6356269f Mon Sep 17 00:00:00 2001 +From: Antonio Rojas <aro...@archlinux.org> +Date: Tue, 24 Jul 2018 19:38:55 +0200 +Subject: Don't check for exact Singular version + +Should improve testing future Singular upgrades on distributions +--- + src/sage/interfaces/singular.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/sage/interfaces/singular.py b/src/sage/interfaces/singular.py +index 0447920..a028bbe 100644 +--- a/src/sage/interfaces/singular.py ++++ b/src/sage/interfaces/singular.py +@@ -1183,7 +1183,7 @@ class Singular(ExtraTabCompletion, Expect): + EXAMPLES:: + + sage: singular.version() +- "Singular ... version 4.1.1 ... ++ "Singular ... version 4... + """ + return singular_version() + +@@ -2358,7 +2358,7 @@ def singular_version(): + EXAMPLES:: + + sage: singular.version() +- "Singular ... version 4.1.1 ... ++ "Singular ... version 4... + """ + return singular.eval('system("--version");') + +-- +cgit v1.0-1-gd88e + + +From 4e52b5e3ca6bbb34666c25decbf9bab3e2b46e82 Mon Sep 17 00:00:00 2001 +From: Antonio Rojas <aro...@archlinux.org> +Date: Wed, 25 Jul 2018 16:17:38 +0200 +Subject: Use p_Divide for lcm as suggested by upstream + +See https://www.singular.uni-kl.de/forum/viewtopic.php?f=10&t=2768 +--- + src/sage/libs/singular/decl.pxd | 4 ++++ + src/sage/rings/polynomial/multi_polynomial_libsingular.pyx | 12 ++---------- + 2 files changed, 6 insertions(+), 10 deletions(-) + +diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd +index 84476a9..d863740 100644 +--- a/src/sage/libs/singular/decl.pxd ++++ b/src/sage/libs/singular/decl.pxd +@@ -630,6 +630,10 @@ cdef extern from "singular/Singular/libsingular.h": + # return p*q, destroys p and q + poly *p_Mult_q(poly *p, poly *q, ring *r) + ++ # polynomial division, ignoring the rest ++ # via singclap_pdivide resp. idLift, destroys p,q ++ poly *p_Divide(poly *p, poly *q, ring *r) ++ + # divide monomial p by monomial q, p,q const + + poly *pMDivide(poly *p,poly *q) +diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +index 619e7f0..aeff53a 100644 +--- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx ++++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +@@ -190,7 +190,7 @@ from sage.libs.singular.decl cimport ( + n_IsUnit, n_Invers, + p_ISet, rChangeCurrRing, p_Copy, p_Init, p_SetCoeff, p_Setm, p_SetExp, p_Add_q, + p_NSet, p_GetCoeff, p_Delete, p_GetExp, pNext, rRingVar, omAlloc0, omStrDup, +- omFree, pMDivide, p_SetCoeff0, n_Init, p_DivisibleBy, pLcm, p_LmDivisibleBy, ++ omFree, pMDivide, p_Divide, p_SetCoeff0, n_Init, p_DivisibleBy, pLcm, p_LmDivisibleBy, + pMDivide, p_IsConstant, p_ExpVectorEqual, p_String, p_LmInit, n_Copy, + p_IsUnit, p_Series, p_Head, idInit, fast_map_common_subexp, id_Delete, + p_IsHomogeneous, p_Homogen, p_Totaldegree,pLDeg1_Totaldegree, singclap_pdivide, singclap_factorize, +@@ -4802,12 +4802,6 @@ cdef class MPolynomial_libsingular(MPolynomial): + if _ring.cf.type != n_unknown: + if _ring.cf.type == n_Znm or _ring.cf.type == n_Zn or _ring.cf.type == n_Z2m : + raise TypeError("LCM over non-integral domains not available.") +- if _ring.cf.type == n_Z: +- f_content = self.content() +- g_content = g.content() +- f_primitivepart = self / f_content +- g_primitivepart = g / g_content +- return f_primitivepart.change_ring(RationalField()).lcm(g_primitivepart.change_ring(RationalField())) * f_content.lcm(g_content) + + if self._parent is not g._parent: + _g = self._parent._coerce_c(g) +@@ -4824,9 +4818,7 @@ cdef class MPolynomial_libsingular(MPolynomial): + if _ring!=currRing: rChangeCurrRing(_ring) # singclap_gcd + gcd = singclap_gcd(p_Copy(self._poly, _ring), p_Copy(_g._poly, _ring), _ring ) + prod = pp_Mult_qq(self._poly, _g._poly, _ring) +- ret = singclap_pdivide(prod , gcd , _ring) +- p_Delete(&prod, _ring) +- p_Delete(&gcd, _ring) ++ ret = p_Divide(prod, gcd, _ring) + if count >= 20: + sig_off() + return new_MP(self._parent, ret) +-- +cgit v1.0-1-gd88e + +From 930ba2eb1cacaf4e1e43733feb560dd105d531be Mon Sep 17 00:00:00 2001 +From: Antonio Rojas <aro...@archlinux.org> +Date: Wed, 25 Jul 2018 22:45:15 +0200 +Subject: Remove duplicate cimport + +--- + src/sage/rings/polynomial/multi_polynomial_libsingular.pyx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +index aeff53a..f0a174f 100644 +--- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx ++++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +@@ -190,7 +190,7 @@ from sage.libs.singular.decl cimport ( + n_IsUnit, n_Invers, + p_ISet, rChangeCurrRing, p_Copy, p_Init, p_SetCoeff, p_Setm, p_SetExp, p_Add_q, + p_NSet, p_GetCoeff, p_Delete, p_GetExp, pNext, rRingVar, omAlloc0, omStrDup, +- omFree, pMDivide, p_Divide, p_SetCoeff0, n_Init, p_DivisibleBy, pLcm, p_LmDivisibleBy, ++ omFree, p_Divide, p_SetCoeff0, n_Init, p_DivisibleBy, pLcm, p_LmDivisibleBy, + pMDivide, p_IsConstant, p_ExpVectorEqual, p_String, p_LmInit, n_Copy, + p_IsUnit, p_Series, p_Head, idInit, fast_map_common_subexp, id_Delete, + p_IsHomogeneous, p_Homogen, p_Totaldegree,pLDeg1_Totaldegree, singclap_pdivide, singclap_factorize, +-- +cgit v1.0-1-gd88e + +From 07ef11b3209f498dc771bf5cb02f1b3ce1264cbb Mon Sep 17 00:00:00 2001 +From: Antonio Rojas <aro...@archlinux.org> +Date: Thu, 26 Jul 2018 15:25:57 +0200 +Subject: rest -> reminder + +--- + src/sage/libs/singular/decl.pxd | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd +index d863740..7f09aaf 100644 +--- a/src/sage/libs/singular/decl.pxd ++++ b/src/sage/libs/singular/decl.pxd +@@ -630,7 +630,7 @@ cdef extern from "singular/Singular/libsingular.h": + # return p*q, destroys p and q + poly *p_Mult_q(poly *p, poly *q, ring *r) + +- # polynomial division, ignoring the rest ++ # polynomial division, ignoring the remainder + # via singclap_pdivide resp. idLift, destroys p,q + poly *p_Divide(poly *p, poly *q, ring *r) + +-- +cgit v1.0-1-gd88e + + +From a9e5aed9215175f8cf49327c790ae153648a2513 Mon Sep 17 00:00:00 2001 +From: Jeroen Demeyer <jdeme...@cage.ugent.be> +Date: Sat, 28 Jul 2018 15:09:54 +0200 +Subject: Minor fixes to Singular interface + +--- + src/sage/interfaces/singular.py | 4 +- + .../polynomial/multi_polynomial_libsingular.pyx | 79 ++++++++++++---------- + src/sage/rings/polynomial/plural.pyx | 19 +++--- + 3 files changed, 55 insertions(+), 47 deletions(-) + +diff --git a/src/sage/interfaces/singular.py b/src/sage/interfaces/singular.py +index a028bbe..3d563ff 100644 +--- a/src/sage/interfaces/singular.py ++++ b/src/sage/interfaces/singular.py +@@ -654,6 +654,8 @@ class Singular(ExtraTabCompletion, Expect): + + s = Expect.eval(self, x, **kwds) + ++ # "Segment fault" is not a typo: ++ # Singular actually does use that string + if s.find("error occurred") != -1 or s.find("Segment fault") != -1: + raise SingularError('Singular error:\n%s'%s) + +@@ -1750,7 +1752,7 @@ class SingularElement(ExtraTabCompletion, ExpectElement): + + # Singular 4 puts parentheses around floats and sign outside them + charstr = self.parent().eval('charstr(basering)').split(',',1) +- if charstr[0]=='complex' or charstr[0].startswith('Float'): ++ if charstr[0].startswith('Float') or charstr[0] == 'complex': + for i in range(coeff_start, 2 * coeff_start): + singular_poly_list[i] = singular_poly_list[i].replace('(','').replace(')','') + +diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +index f0a174f..043696e 100644 +--- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx ++++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +@@ -181,8 +181,8 @@ from cysignals.signals cimport sig_on, sig_off + from sage.cpython.string cimport char_to_str, str_to_bytes + + # singular types +-from sage.libs.singular.decl cimport ring, poly, ideal, intvec, number, currRing +-from sage.libs.singular.decl cimport n_unknown, n_Zp, n_Q, n_R, n_GF, n_long_R, n_algExt,n_transExt,n_long_C, n_Z, n_Zn, n_Znm, n_Z2m, n_CF ++from sage.libs.singular.decl cimport (ring, poly, ideal, intvec, number, ++ currRing, n_unknown, n_Z, n_Zn, n_Znm, n_Z2m) + + # singular functions + from sage.libs.singular.decl cimport ( +@@ -198,7 +198,7 @@ from sage.libs.singular.decl cimport ( + p_LmIsConstant, pTakeOutComp1, singclap_gcd, pp_Mult_qq, p_GetMaxExp, + pLength, kNF, p_Neg, p_Minus_mm_Mult_qq, p_Plus_mm_Mult_qq, + pDiff, singclap_resultant, p_Normalize, +- prCopyR, prCopyR_NoSort ) ++ prCopyR, prCopyR_NoSort) + + # singular conversion routines + from sage.libs.singular.singular cimport si2sa, sa2si, overflow_check +@@ -225,7 +225,7 @@ from sage.rings.polynomial.polynomial_ring import is_PolynomialRing + # base ring imports + from sage.rings.finite_rings.finite_field_prime_modn import FiniteField_prime_modn + from sage.rings.rational cimport Rational +-from sage.rings.rational_field import RationalField ++from sage.rings.rational_field import QQ + from sage.rings.complex_field import is_ComplexField + from sage.rings.real_mpfr import is_RealField + from sage.rings.integer_ring import is_IntegerRing, ZZ +@@ -1693,7 +1693,8 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_base): + if not g._poly: + raise ZeroDivisionError + +- if r!=currRing: rChangeCurrRing(r) # pMDivide ++ if r is not currRing: ++ rChangeCurrRing(r) + res = pMDivide(f._poly, g._poly) + if coeff: + if r.cf.type == n_unknown or r.cf.cfDivBy(p_GetCoeff(f._poly, r), p_GetCoeff(g._poly, r), r.cf): +@@ -1846,19 +1847,18 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_base): + cdef poly *flt + + if not m: +- return f,f ++ return (f, f) + + for g in G: +- if isinstance(g, MPolynomial_libsingular) \ +- and (<MPolynomial_libsingular>g) \ +- and g.parent() is self \ +- and p_LmDivisibleBy((<MPolynomial_libsingular>g)._poly, m, r): +- if r!=currRing: rChangeCurrRing(r) # pMDivide +- flt = pMDivide(f._poly, (<MPolynomial_libsingular>g)._poly) +- #p_SetCoeff(flt, n_Div( p_GetCoeff(f._poly, r) , p_GetCoeff((<MPolynomial_libsingular>g)._poly, r), r), r) +- p_SetCoeff(flt, n_Init(1, r), r) +- return new_MP(self,flt), g +- return self._zero_element,self._zero_element ++ if isinstance(g, MPolynomial_libsingular) and g: ++ h = <MPolynomial_libsingular>g ++ if h._parent is self and p_LmDivisibleBy(h._poly, m, r): ++ if r is not currRing: ++ rChangeCurrRing(r) ++ flt = pMDivide(f._poly, h._poly) ++ p_SetCoeff(flt, n_Init(1, r), r) ++ return (new_MP(self, flt), h) ++ return (self._zero_element, self._zero_element) + + def monomial_pairwise_prime(self, MPolynomial_libsingular g, MPolynomial_libsingular h): + """ +@@ -4023,11 +4023,19 @@ cdef class MPolynomial_libsingular(MPolynomial): + Traceback (most recent call last): + ... + NotImplementedError: Division of multivariate polynomials over non fields by non-monomials not implemented. ++ ++ TESTS:: ++ ++ sage: P.<x,y> = ZZ[] ++ sage: p = 3*(-x^8*y^2 - x*y^9 + 6*x^8*y + 17*x^2*y^6 - x^3*y^2) ++ sage: q = 7*(x^2 + x*y + y^2 + 1) ++ sage: p*q//q == p ++ True ++ sage: p*q//p == q ++ True + """ + cdef MPolynomialRing_libsingular parent = self._parent + cdef ring *r = self._parent_ring +- if(r != currRing): rChangeCurrRing(r) +- cdef MPolynomial_libsingular _self, _right + cdef poly *quo + cdef poly *temp + cdef poly *p +@@ -4038,19 +4046,19 @@ cdef class MPolynomial_libsingular(MPolynomial): + if self._parent._base.is_finite() and self._parent._base.characteristic() > 1<<29: + raise NotImplementedError("Division of multivariate polynomials over prime fields with characteristic > 2^29 is not implemented.") + +- _self = <MPolynomial_libsingular>self + _right = <MPolynomial_libsingular>right + ++ if r is not currRing: ++ rChangeCurrRing(r) ++ + if r.cf.type != n_unknown: + if r.cf.type == n_Z: +- P = parent.change_ring(RationalField()) +- f = P(self)//P(right) +- CM = list(f) +- return parent(sum([c.floor()*m for c,m in CM])) ++ P = parent.change_ring(QQ) ++ f = (<MPolynomial_libsingular>P(self))._floordiv_(P(right)) ++ return parent(sum([c.floor() * m for c, m in f])) + if _right.is_monomial(): +- p = _self._poly ++ p = self._poly + quo = p_ISet(0,r) +- if r != currRing: rChangeCurrRing(r) # pMDivide + while p: + if p_DivisibleBy(_right._poly, p, r): + temp = pMDivide(p, _right._poly) +@@ -4061,16 +4069,13 @@ cdef class MPolynomial_libsingular(MPolynomial): + if r.cf.type == n_Znm or r.cf.type == n_Zn or r.cf.type == n_Z2m : + raise NotImplementedError("Division of multivariate polynomials over non fields by non-monomials not implemented.") + +- cdef int count = singular_polynomial_length_bounded(_self._poly,15) ++ count = singular_polynomial_length_bounded(self._poly, 15) + if count >= 15: # note that _right._poly must be of shorter length than self._poly for us to care about this call + sig_on() +- if r!=currRing: rChangeCurrRing(r) # singclap_pdivide +- quo = singclap_pdivide( _self._poly, _right._poly, r ) ++ quo = singclap_pdivide(self._poly, _right._poly, r) + if count >= 15: + sig_off() +- f = new_MP(parent, quo) +- +- return f ++ return new_MP(parent, quo) + + def factor(self, proof=True): + """ +@@ -4789,7 +4794,9 @@ cdef class MPolynomial_libsingular(MPolynomial): + sage: p = -x*y + x*z + 54*x - 2 + sage: (5*p^2).lcm(3*p) == 15*p^2 + True +- sage: lcm(2*x,2*x*y) ++ sage: lcm(2*x, 2*y) ++ 2*x*y ++ sage: lcm(2*x, 2*x*y) + 2*x*y + """ + cdef ring *_ring = self._parent_ring +@@ -5222,7 +5229,7 @@ cdef class MPolynomial_libsingular(MPolynomial): + if ambient_ring is not self._parent: + raise TypeError("the variable is not in the same ring as self") + +- if not ambient_ring.has_coerce_map_from(RationalField()): ++ if not ambient_ring.has_coerce_map_from(QQ): + raise TypeError("the ring must contain the rational numbers") + + gens = ambient_ring.gens() +@@ -5325,8 +5332,8 @@ cdef class MPolynomial_libsingular(MPolynomial): + raise NotImplementedError("Resultants of multivariate polynomials over prime fields with characteristic > 2^29 is not implemented.") + + if is_IntegerRing(self._parent._base): +- ret = self.change_ring(RationalField()).resultant(other.change_ring(RationalField()), +- variable.change_ring(RationalField())) ++ ret = self.change_ring(QQ).resultant(other.change_ring(QQ), ++ variable.change_ring(QQ)) + return ret.change_ring(ZZ) + elif not self._parent._base.is_field(): + raise ValueError("Resultants require base fields or integer base ring.") +@@ -5457,7 +5464,7 @@ cdef class MPolynomial_libsingular(MPolynomial): + sage: f.numerator().parent() is P + True + """ +- if self.base_ring() == RationalField(): ++ if self.base_ring() is QQ: + #This part is for compatibility with the univariate case, + #where the numerator of a polynomial over RationalField + #is a polynomial over IntegerRing +diff --git a/src/sage/rings/polynomial/plural.pyx b/src/sage/rings/polynomial/plural.pyx +index ad20ebc..6dfcb47 100644 +--- a/src/sage/rings/polynomial/plural.pyx ++++ b/src/sage/rings/polynomial/plural.pyx +@@ -998,7 +998,7 @@ cdef class NCPolynomialRing_plural(Ring): + if not g._poly: + raise ZeroDivisionError + +- res = pMDivide(f._poly,g._poly) ++ res = pMDivide(f._poly, g._poly) + if coeff: + if (r.cf.type == n_unknown) or r.cf.cfDivBy(p_GetCoeff(f._poly, r), p_GetCoeff(g._poly, r), r.cf): + n = r.cf.cfDiv( p_GetCoeff(f._poly, r) , p_GetCoeff(g._poly, r), r.cf) +@@ -1187,17 +1187,16 @@ cdef class NCPolynomialRing_plural(Ring): + cdef poly *flt + + if not m: +- return f,f ++ return (f, f) + + for g in G: +- if isinstance(g, NCPolynomial_plural) \ +- and (<NCPolynomial_plural>g) \ +- and p_LmDivisibleBy((<NCPolynomial_plural>g)._poly, m, r): +- flt = pMDivide(f._poly, (<NCPolynomial_plural>g)._poly) +- #p_SetCoeff(flt, n_Div( p_GetCoeff(f._poly, r) , p_GetCoeff((<NCPolynomial_plural>g)._poly, r), r), r) +- p_SetCoeff(flt, n_Init(1, r), r) +- return new_NCP(self,flt), g +- return self._zero_element,self._zero_element ++ if isinstance(g, NCPolynomial_plural) and g: ++ h = <NCPolynomial_plural>g ++ if p_LmDivisibleBy(h._poly, m, r): ++ flt = pMDivide(f._poly, h._poly) ++ p_SetCoeff(flt, n_Init(1, r), r) ++ return (new_NCP(self,flt), h) ++ return (self._zero_element, self._zero_element) + + def monomial_pairwise_prime(self, NCPolynomial_plural g, NCPolynomial_plural h): + """ +-- +cgit v1.0-1-gd88e + + +From 45ff3719d4f9059a0e85d142cd1e31cb87efa11c Mon Sep 17 00:00:00 2001 +From: Jeroen Demeyer <jdeme...@cage.ugent.be> +Date: Wed, 8 Aug 2018 10:31:27 +0200 +Subject: Fix debug build of Singular + +--- + build/pkgs/singular/spkg-install | 10 ++-------- + 1 file changed, 2 insertions(+), 8 deletions(-) + +diff --git a/build/pkgs/singular/spkg-install b/build/pkgs/singular/spkg-install +index 41dcad1..5a4d8de 100644 +--- a/build/pkgs/singular/spkg-install ++++ b/build/pkgs/singular/spkg-install +@@ -6,16 +6,10 @@ SRC=`pwd`/src + cd "$SRC" + + if [ "x$SAGE_DEBUG" = "xyes" ]; then ++ # This used to disable omalloc but that is not really supported ++ # by upstream + SINGULAR_CONFIGURE="$SINGULAR_CONFIGURE --enable-debug --disable-optimizationflags" + +- # --disable-omalloc is broken: linking fails because of missing flags +- #SINGULAR_CONFIGURE="$SINGULAR_CONFIGURE --disable-omalloc" +- +- # Replace omalloc by xalloc in places unaffected by --disable-omalloc +- # See xalloc/README, altough here we just replace the folder for simplicity +- rm -rf "$SRC/omalloc" +- mv "$SRC/xalloc" "$SRC/omalloc" +- + CFLAGS="$CFLAGS -O0 -g" + CXXFLAGS="$CXXFLAGS -O0 -g" + else +-- +cgit v1.0-1-gd88e + Copied: sagemath/repos/community-staging-x86_64/sagemath-threejs.patch (from rev 372568, sagemath/trunk/sagemath-threejs.patch) =================================================================== --- community-staging-x86_64/sagemath-threejs.patch (rev 0) +++ community-staging-x86_64/sagemath-threejs.patch 2018-08-17 22:29:46 UTC (rev 372569) @@ -0,0 +1,11 @@ +--- 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 = 'r95' + return """ + <script src="https://cdn.rawgit.com/mrdoob/three.js/{0}/build/three.min.js"></script> + <script src="https://cdn.rawgit.com/mrdoob/three.js/{0}/examples/js/controls/OrbitControls.js"></script> Copied: sagemath/repos/community-staging-x86_64/test-optional.patch (from rev 372568, sagemath/trunk/test-optional.patch) =================================================================== --- community-staging-x86_64/test-optional.patch (rev 0) +++ community-staging-x86_64/test-optional.patch 2018-08-17 22:29:46 UTC (rev 372569) @@ -0,0 +1,27 @@ +--- src/sage/doctest/control.py.orig 2016-10-20 19:39:53.714618246 +0200 ++++ src/sage/doctest/control.py 2016-10-20 19:40:15.158049920 +0200 +@@ -326,24 +326,6 @@ + if "all" in options.optional: + # Special case to run all optional tests + options.optional = True +- else: +- # We replace the 'optional' tag by all optional +- # packages for which the installed version matches the +- # latest available version (this implies in particular +- # that the package is actually installed). +- if 'optional' in options.optional: +- options.optional.discard('optional') +- from sage.misc.package import list_packages +- for pkg in list_packages('optional', local=True).values(): +- if pkg['installed_version'] == pkg['remote_version']: +- options.optional.add(pkg['name']) +- +- # Check that all tags are valid +- for o in options.optional: +- if not optionaltag_regex.search(o): +- raise ValueError('invalid optional tag {!r}'.format(o)) +- +- options.optional |= auto_optional_tags + + self.options = options + self.files = args