summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntonio Rojas2018-08-18 21:57:26 +0000
committerAntonio Rojas2018-08-18 21:57:26 +0000
commit2f5d3b05dd76827c3fb675ad6e842fd40e5d0a58 (patch)
treee5482fad6aff8c43c7fcc65a4666c74e6cc05c30
parentf90f86733f761439fef447b6780637a56174bbca (diff)
downloadaur-2f5d3b05dd76827c3fb675ad6e842fd40e5d0a58.tar.gz
Update
-rw-r--r--.SRCINFO38
-rw-r--r--PKGBUILD47
-rw-r--r--latte-count.patch26
-rw-r--r--package.patch2
-rw-r--r--sagemath-cremona.patch2
-rw-r--r--sagemath-eclib-20180710.patch24
-rw-r--r--sagemath-env.patch47
-rw-r--r--sagemath-gap-4.8.patch9
-rw-r--r--sagemath-python3-notebook.patch2
-rw-r--r--sagemath-scipy-1.0.patch16
-rw-r--r--sagemath-singular-4.1.1.patch927
-rw-r--r--sagemath-threejs.patch4
-rw-r--r--test-optional.patch5
13 files changed, 878 insertions, 271 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 198a7ccf5036..5363b3b91e77 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = sagemath-git
pkgdesc = Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab
- pkgver = 8.3.rc2.r0.gf608d821e8
+ pkgver = 8.4.beta1.r0.g23a2b10da6
pkgrel = 1
url = http://www.sagemath.org
arch = x86_64
@@ -11,8 +11,6 @@ pkgbase = sagemath-git
makedepends = symmetrica
makedepends = python2-jinja
makedepends = coin-or-cbc
- makedepends = libhomfly
- makedepends = libbraiding
makedepends = sirocco
makedepends = mcqd
makedepends = coxeter
@@ -65,6 +63,8 @@ pkgbase = sagemath-git
depends = sage-data-graphs
depends = sage-data-polytopes_db
depends = sage-data-conway_polynomials
+ depends = libhomfly
+ depends = libbraiding
optdepends = cython2: to compile cython code
optdepends = python2-pkgconfig: to compile cython code
optdepends = jmol: 3D plots
@@ -82,8 +82,6 @@ pkgbase = sagemath-git
optdepends = cryptominisat5: SAT solver
optdepends = gap-4.8-data: for computing Galois groups
optdepends = lrs: Algorithms for linear reverse search used in game theory and for computing volume of polytopes
- optdepends = libhomfly: for computing the homfly polynomial of links
- optdepends = libbraiding: for computing in braid groups
optdepends = libfes: exhaustive search of solutions for boolean equations
optdepends = python2-pynormaliz: Normaliz backend for polyhedral computations
optdepends = latte-integrale: integral point count in polyhedra
@@ -94,6 +92,7 @@ pkgbase = sagemath-git
optdepends = primecount: faster prime_pi implementation
optdepends = three.js: alternative 3D plots engine
optdepends = dot2tex: for displaying some diagrams
+ optdepends = python2-pip: to install optional packages with sage -pip
source = git://git.sagemath.org/sage.git#branch=develop
source = sagemath-env.patch
source = package.patch
@@ -104,30 +103,22 @@ pkgbase = sagemath-git
source = fes02.patch
source = sagemath-threejs.patch
source = sagemath-cremona.patch
- source = sagemath-scipy-1.0.patch
source = sagemath-singular-4.1.1.patch
source = sagemath-lcalc-c++11.patch
source = sagemath-gap-4.8.patch
- source = sagemath-cypari2.patch::https://git.sagemath.org/sage.git/patch?id=da380b32
- source = sagemath-cddlib-0.94j.patch::https://git.sagemath.org/sage.git/patch?id=af0e6066
- source = sagemath-eclib-20180710.patch
sha256sums = SKIP
- sha256sums = 51da03781554b20e5ccdc64923911b610b834ff0ce71c5321d7ef85edb8ee01a
- sha256sums = 9e3c998e0ca8dcbf7ad9f5a8d591f2bc4cb792be14708e064594046081e9b60d
- sha256sums = 0b680e674c11c47afa86162d8b49645620b8912722e08133d23357c29ca9310a
- sha256sums = 962ce805c87147212b21fc2ab0ac9af9bd0033942c7a6905b9906645b48e8a4f
- sha256sums = 18edeafb01cc1ed7270c2dfb41a58717918680c98e8eada1858736acd65d92ba
+ sha256sums = f483a448c045aeff186bec4b402da8109fa12547ff36219a9aa427c2561ec8e5
+ sha256sums = 960afe4fcbffe2762b66119b8f14355386ced0d8ee52b535d0dac1dba90d365b
+ sha256sums = ef265f88ceb6caf4aac2d86ea74850861d99a63d11c94fc52b2ce88053c26d1e
+ sha256sums = fc393ee5fbf507dfb76d6ad0e9193d74a954acb13f35a371bf91e11bbcb08244
+ sha256sums = e57c9bb3abc37684c8630076c0c7c838eca918dc0e8acd7006797ca438839e0b
sha256sums = afd0952b9bb8f52fd428eae36cf719a58ff85a894baae88cbb2124e043768cc7
sha256sums = 7fcb52e96935dccb0f958d37c2f4e3918392480b9af53e08562f6cba6c68cb94
- sha256sums = 93b4cbdf7f36287ad643853b99e77011fcf5bdcd17514f3bf6d2bd74a1c82fd2
- sha256sums = f801be68d043f317cc2a85a5ca059010b68eaeafa3bbf5c9148f2c154e2a707d
- sha256sums = 17397b8e1843b013ef5d2e083369109f0719651edd8ef0c8493cb49e2bc4324a
- sha256sums = 250a6ca3b58f98b335699d650a4a0f2587036a3feb059471f8cf26e27664bdb1
+ sha256sums = 4722f9257f7b58a5dc8be2e9163ebba6d7b3ee011ff1ab9c0dbfb1330d367261
+ sha256sums = 7efb38ba511037feb3abbd88576323320555ba50235ddc7e3d423ca294dd42ed
+ sha256sums = 600701ee849d296cef63fad2dbf57db4d6d6259e2e5e1415a7ceaa385d98d5b9
sha256sums = 5114c912f821900e5bfae1e2cfeb7984de946d0b23e1182b0bf15be1d803dfd0
- sha256sums = 6917cb74e50ae965ea8d7c39577e5f0a5068e4b6a67b53fc6f219149a7d06584
- sha256sums = 94847fc033fd36bc59217c8484d4cf48d0640ff35bb5ca5ffba88a8158c6dd44
- sha256sums = 9a690bda83c280c0801f6d04353e8a909da80ccfee92e06d200ae6eb9be9a5a8
- sha256sums = 182b0765d58494978bf27628bada8b42c95ef7eb2671b91ddf9c67608560c662
+ sha256sums = 3d02f6e349213ff4cea6a3acf5e7f8ec11a37b6ead61b338931f07073ebcb36e
pkgname = sagemath-git
optdepends = cython2: to compile cython code
@@ -147,8 +138,6 @@ pkgname = sagemath-git
optdepends = cryptominisat5: SAT solver
optdepends = gap-4.8-data: for computing Galois groups
optdepends = lrs: Algorithms for linear reverse search used in game theory and for computing volume of polytopes
- optdepends = libhomfly: for computing the homfly polynomial of links
- optdepends = libbraiding: for computing in braid groups
optdepends = libfes: exhaustive search of solutions for boolean equations
optdepends = python2-pynormaliz: Normaliz backend for polyhedral computations
optdepends = latte-integrale: integral point count in polyhedra
@@ -159,6 +148,7 @@ pkgname = sagemath-git
optdepends = primecount: faster prime_pi implementation
optdepends = three.js: alternative 3D plots engine
optdepends = dot2tex: for displaying some diagrams
+ optdepends = python2-pip: to install optional packages with sage -pip
optdepends = sagemath-jupyter: Jupyter kernel
provides = sagemath
conflicts = sagemath
diff --git a/PKGBUILD b/PKGBUILD
index 628077694693..f99eabcf53bb 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -8,7 +8,7 @@
pkgbase=sagemath-git
pkgname=(sagemath-git sagemath-jupyter-git)
-pkgver=8.3.rc2.r0.gf608d821e8
+pkgver=8.4.beta1.r0.g23a2b10da6
pkgrel=1
pkgdesc="Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab"
arch=(x86_64)
@@ -17,7 +17,8 @@ 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)
+ sage-data-combinatorial_designs sage-data-elliptic_curves sage-data-graphs sage-data-polytopes_db sage-data-conway_polynomials
+ libhomfly libbraiding)
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'
@@ -26,13 +27,13 @@ optdepends=('cython2: to compile cython code' 'python2-pkgconfig: to compile cyt
'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')
-makedepends=(cython2 boost ratpoints symmetrica python2-jinja coin-or-cbc libhomfly libbraiding sirocco
+ '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 sirocco
mcqd coxeter bliss-graphs tdlib python2-pkgconfig shared_meataxe libfes primecount git)
source=(git://git.sagemath.org/sage.git#branch=develop
sagemath-env.patch
@@ -44,30 +45,22 @@ source=(git://git.sagemath.org/sage.git#branch=develop
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)
+ sagemath-gap-4.8.patch)
sha256sums=('SKIP'
- '51da03781554b20e5ccdc64923911b610b834ff0ce71c5321d7ef85edb8ee01a'
- '9e3c998e0ca8dcbf7ad9f5a8d591f2bc4cb792be14708e064594046081e9b60d'
- '0b680e674c11c47afa86162d8b49645620b8912722e08133d23357c29ca9310a'
- '962ce805c87147212b21fc2ab0ac9af9bd0033942c7a6905b9906645b48e8a4f'
- '18edeafb01cc1ed7270c2dfb41a58717918680c98e8eada1858736acd65d92ba'
+ 'f483a448c045aeff186bec4b402da8109fa12547ff36219a9aa427c2561ec8e5'
+ '960afe4fcbffe2762b66119b8f14355386ced0d8ee52b535d0dac1dba90d365b'
+ 'ef265f88ceb6caf4aac2d86ea74850861d99a63d11c94fc52b2ce88053c26d1e'
+ 'fc393ee5fbf507dfb76d6ad0e9193d74a954acb13f35a371bf91e11bbcb08244'
+ 'e57c9bb3abc37684c8630076c0c7c838eca918dc0e8acd7006797ca438839e0b'
'afd0952b9bb8f52fd428eae36cf719a58ff85a894baae88cbb2124e043768cc7'
'7fcb52e96935dccb0f958d37c2f4e3918392480b9af53e08562f6cba6c68cb94'
- '93b4cbdf7f36287ad643853b99e77011fcf5bdcd17514f3bf6d2bd74a1c82fd2'
- 'f801be68d043f317cc2a85a5ca059010b68eaeafa3bbf5c9148f2c154e2a707d'
- '17397b8e1843b013ef5d2e083369109f0719651edd8ef0c8493cb49e2bc4324a'
- '250a6ca3b58f98b335699d650a4a0f2587036a3feb059471f8cf26e27664bdb1'
+ '4722f9257f7b58a5dc8be2e9163ebba6d7b3ee011ff1ab9c0dbfb1330d367261'
+ '7efb38ba511037feb3abbd88576323320555ba50235ddc7e3d423ca294dd42ed'
+ '600701ee849d296cef63fad2dbf57db4d6d6259e2e5e1415a7ceaa385d98d5b9'
'5114c912f821900e5bfae1e2cfeb7984de946d0b23e1182b0bf15be1d803dfd0'
- '6917cb74e50ae965ea8d7c39577e5f0a5068e4b6a67b53fc6f219149a7d06584'
- '94847fc033fd36bc59217c8484d4cf48d0640ff35bb5ca5ffba88a8158c6dd44'
- '9a690bda83c280c0801f6d04353e8a909da80ccfee92e06d200ae6eb9be9a5a8'
- '182b0765d58494978bf27628bada8b42c95ef7eb2671b91ddf9c67608560c662')
+ '3d02f6e349213ff4cea6a3acf5e7f8ec11a37b6ead61b338931f07073ebcb36e')
pkgver() {
cd sage
@@ -92,26 +85,18 @@ prepare(){
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/*
diff --git a/latte-count.patch b/latte-count.patch
index b125b17ce269..91a66956345a 100644
--- a/latte-count.patch
+++ b/latte-count.patch
@@ -51,7 +51,7 @@ 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
-@@ -88,7 +88,7 @@ def count(arg, ehrhart_polynomial=False, multivariate_generating_function=False,
+@@ -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 ...
...
@@ -60,12 +60,30 @@ index 066cedd401..302b39910d 100644
...
Total Unimodular Cones: ...
Maximum number of simplicial cones in memory at once: ...
-@@ -108,7 +108,7 @@ def count(arg, ehrhart_polynomial=False, multivariate_generating_function=False,
- from sage.misc.misc import SAGE_TMP
- from sage.rings.integer import Integer
+@@ -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"""
+
diff --git a/package.patch b/package.patch
index 152786f0c523..49c469563d59 100644
--- a/package.patch
+++ b/package.patch
@@ -1,6 +1,6 @@
--- 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
-@@ -329,7 +329,7 @@
+@@ -328,7 +328,7 @@
Use the framework provided by :mod:`sage.features` to check
whether a library is installed and functional.
"""
diff --git a/sagemath-cremona.patch b/sagemath-cremona.patch
index 51e2a39867e4..4daa387c16bf 100644
--- a/sagemath-cremona.patch
+++ b/sagemath-cremona.patch
@@ -8,7 +8,7 @@ index 3f8dd62..ed5726a 100644
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.env import CREMONA_MINI_DATA_DIR, CREMONA_LARGE_DATA_DIR
from sage.misc.all import walltime
@@ -825,7 +825,7 @@ class MiniCremonaDatabase(SQLDatabase):
diff --git a/sagemath-eclib-20180710.patch b/sagemath-eclib-20180710.patch
deleted file mode 100644
index 6e3f3763c5af..000000000000
--- a/sagemath-eclib-20180710.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-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;
diff --git a/sagemath-env.patch b/sagemath-env.patch
index f30e0eea67ae..5823c4a007ab 100644
--- a/sagemath-env.patch
+++ b/sagemath-env.patch
@@ -80,8 +80,8 @@
# The compilers are set in order of priority by
# 1) environment variables
@@ -296,8 +296,9 @@
- export SAGE_EXTCODE="$SAGE_SHARE/sage/ext"
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"
@@ -91,17 +91,48 @@
export SAGE_DOC="$SAGE_SHARE/doc/sage"
if [ -z "${SAGE_ORIG_PATH_SET}" ]; then
-@@ -403,6 +403,9 @@
+@@ -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
-@@ -608,9 +608,6 @@
+-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
@@ -130,7 +161,7 @@
try:
sitepackages_dirs = site.getsitepackages()
-@@ -163,7 +163,7 @@
+@@ -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'))
diff --git a/sagemath-gap-4.8.patch b/sagemath-gap-4.8.patch
index e360cbd98492..5e94e3c113ce 100644
--- a/sagemath-gap-4.8.patch
+++ b/sagemath-gap-4.8.patch
@@ -2,12 +2,7 @@ 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')
+@@ -201,7 +201,7 @@ import string
first_try = True
@@ -20,7 +15,7 @@ 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
-@@ -166,7 +166,7 @@ def gap_root():
+@@ -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!')
diff --git a/sagemath-python3-notebook.patch b/sagemath-python3-notebook.patch
index f23851ed8f79..4d93c6921f98 100644
--- a/sagemath-python3-notebook.patch
+++ b/sagemath-python3-notebook.patch
@@ -16,7 +16,7 @@ diff --git a/src/sage/repl/ipython_kernel/install.py b/src/sage/repl/ipython_ker
index 3912b8cdf5..bd40cdadda 100644
--- a/src/sage/repl/ipython_kernel/install.py
+++ b/src/sage/repl/ipython_kernel/install.py
-@@ -280,7 +280,6 @@ def have_prerequisites(debug=True):
+@@ -289,7 +289,6 @@ def have_prerequisites(debug=True):
True
"""
try:
diff --git a/sagemath-scipy-1.0.patch b/sagemath-scipy-1.0.patch
deleted file mode 100644
index 2f8217c08fe3..000000000000
--- a/sagemath-scipy-1.0.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-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)
-
-
diff --git a/sagemath-singular-4.1.1.patch b/sagemath-singular-4.1.1.patch
index 2a00624a47c9..4fae5fd7861e 100644
--- a/sagemath-singular-4.1.1.patch
+++ b/sagemath-singular-4.1.1.patch
@@ -1,5 +1,308 @@
+From 426644f6d085e053fa0fcf3457702eac685b7cba Mon Sep 17 00:00:00 2001
+From: Antonio Rojas <arojas@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 <arojas@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 <arojas@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 <timokau@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 <timokau@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 <arojas@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..a028bbe 100644
+index 9d65c9f..031172e 100644
--- a/src/sage/interfaces/singular.py
+++ b/src/sage/interfaces/singular.py
@@ -654,7 +654,7 @@ class Singular(ExtraTabCompletion, Expect):
@@ -11,6 +314,35 @@ index 9d65c9f..a028bbe 100644
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 <arojas@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()
@@ -34,10 +366,55 @@ index 9d65c9f..a028bbe 100644
sage: singular.version()
- "Singular ... version 4.1.0 ...
-+ "Singular ... version 4...
++ "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 <arojas@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
@@ -47,6 +424,23 @@ index 9d65c9f..a028bbe 100644
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 <arojas@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
@@ -56,47 +450,62 @@ index 9d65c9f..a028bbe 100644
for i in range(coeff_start, 2 * coeff_start):
singular_poly_list[i] = singular_poly_list[i].replace('(','').replace(')','')
-@@ -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']
+--
+cgit v1.0-1-gd88e
+
+
+From aea054407a41a517070eb06e8efcd02d6356269f Mon Sep 17 00:00:00 2001
+From: Antonio Rojas <arojas@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 self.parent()._tab_completion()
+ return singular_version()
@@ -2358,7 +2358,7 @@ def singular_version():
EXAMPLES::
sage: singular.version()
-- "Singular ... version 4.1.0 ...
+- "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 <arojas@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 4b658c4..d863740 100644
+index 84476a9..d863740 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]
-@@ -630,9 +630,13 @@ cdef extern from "singular/Singular/libsingular.h":
+@@ -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)
@@ -106,170 +515,388 @@ index 4b658c4..d863740 100644
+
# 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
-
+ 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 2a8d9ae..aeff53a 100644
+index 619e7f0..aeff53a 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 (
+@@ -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, 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,
+ omFree, pMDivide, p_Divide, p_SetCoeff0, n_Init, p_DivisibleBy, pLcm, p_LmDivisibleBy,
-+ pMDivide, p_IsConstant, p_ExpVectorEqual, p_String, p_LmInit, n_Copy,
+ 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):
+@@ -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 <arojas@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 <arojas@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 <jdemeyer@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) # pDivide
-- res = pDivide(f._poly, g._poly)
-+ if r!=currRing: rChangeCurrRing(r) # pMDivide
-+ res = pMDivide(f._poly, g._poly)
+- 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):
- 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
-@@ -4023,16 +4023,6 @@ cdef class MPolynomial_libsingular(MPolynomial):
+@@ -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
++
++ 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,13 +4042,18 @@ cdef class MPolynomial_libsingular(MPolynomial):
+- 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]))
+ 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
++ p = self._poly
quo = p_ISet(0,r)
-- if r != currRing: rChangeCurrRing(r) # pDivide
-+ if r != currRing: rChangeCurrRing(r) # pMDivide
+- 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)
-@@ -4794,6 +4789,8 @@ cdef class MPolynomial_libsingular(MPolynomial):
+ 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*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
- cdef poly *ret
-@@ -4821,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)
-@@ -4866,7 +4861,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)
+@@ -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")
- TESTS::
+- 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")
-@@ -4888,7 +4883,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
- if right.is_zero():
- raise ZeroDivisionError
+ 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 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
+ 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 d5439f7f..ad20ebc 100644
+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 = pDivide(f._poly,g._poly)
-+ res = pMDivide(f._poly,g._poly)
+- 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)
-@@ -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
-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
+@@ -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 <jdemeyer@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
diff --git a/sagemath-threejs.patch b/sagemath-threejs.patch
index 9dd4bfdc5ba2..09cb92790e0a 100644
--- a/sagemath-threejs.patch
+++ b/sagemath-threejs.patch
@@ -1,11 +1,11 @@
--- a/src/sage/repl/rich_output/display_manager.py
+++ b/src/sage/repl/rich_output/display_manager.py
-@@ -744,7 +744,7 @@ class DisplayManager(SageObject):
+@@ -746,7 +746,7 @@ class DisplayManager(SageObject):
"""
if online:
from sage.misc.package import installed_packages
- version = installed_packages()['threejs'].split('.')[0]
-+ version = 'r94'
++ 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>
diff --git a/test-optional.patch b/test-optional.patch
index 891f8181dc02..2bf95e204ecb 100644
--- a/test-optional.patch
+++ b/test-optional.patch
@@ -1,6 +1,6 @@
--- 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 @@
+@@ -326,25 +326,6 @@
if "all" in options.optional:
# Special case to run all optional tests
options.optional = True
@@ -21,7 +21,8 @@
- if not optionaltag_regex.search(o):
- raise ValueError('invalid optional tag {!r}'.format(o))
-
-- options.optional |= auto_optional_tags
+- if "sage" in options.optional:
+- options.optional |= auto_optional_tags
self.options = options
self.files = args