[arch-commits] Commit in sagemath/trunk (4 files)

Antonio Rojas arojas at archlinux.org
Sun Jan 29 11:18:41 UTC 2017


    Date: Sunday, January 29, 2017 @ 11:18:40
  Author: arojas
Revision: 209347

Reenable fes module, fix build with planarity 3

Added:
  sagemath/trunk/fes02.patch
  sagemath/trunk/sagemath-planarity3.patch
Modified:
  sagemath/trunk/PKGBUILD
Deleted:
  sagemath/trunk/disable-fes.patch

---------------------------+
 PKGBUILD                  |   18 +++----
 disable-fes.patch         |   19 -------
 fes02.patch               |   57 ++++++++++++++++++++++
 sagemath-planarity3.patch |  113 ++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 180 insertions(+), 27 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2017-01-29 11:13:17 UTC (rev 209346)
+++ PKGBUILD	2017-01-29 11:18:40 UTC (rev 209347)
@@ -10,7 +10,7 @@
 pkgbase=sagemath
 pkgname=(sagemath sagemath-jupyter)
 pkgver=7.5.1
-pkgrel=3
+pkgrel=4
 pkgdesc="Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab"
 arch=(i686 x86_64)
 url="http://www.sagemath.org"
@@ -28,13 +28,13 @@
   'coxeter3: Coxeter groups implementation' 'cryptominisat2: SAT solver' 'gap-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'
-  'python2-pynormaliz: Normaliz backend for polyhedral computations')
+  'libfes: exhaustive search of solutions for boolean equations' 'python2-pynormaliz: Normaliz backend for polyhedral computations')
 makedepends=(cython2 boost ratpoints symmetrica python2-jinja coin-or-cbc libhomfly libbraiding
-  mcqd coxeter3 cryptominisat2 modular_decomposition bliss-graphs tdlib python2-pkgconfig meataxe) # libfes
+  mcqd coxeter3 cryptominisat2 modular_decomposition bliss-graphs tdlib python2-pkgconfig meataxe libfes)
 source=("$pkgname-$pkgver.tar.gz::https://github.com/sagemath/sage/archive/$pkgver.tar.gz"
         env.patch skip-check.patch cython-sys-path.patch is-package-installed.patch package.patch disable-fes.patch
         jupyter-path.patch test-optional.patch ecm-7.patch increase-rtol.patch sagemath-gslcblas.patch r-no-readline.patch
-        sagemath-no-anal.h.patch)
+        sagemath-no-anal.h.patch sagemath-planarity3.patch fes02.patch)
 sha256sums=('3cd9af3e3bfd7f5cc966b7c36168d04b9a1213aa9a7af3286b5d53d40e7653e3'
             '9dba04ff13626a7b6c338a8b18a6c27d343f68a547a218533cf773af3dae6635'
             'b02b3d2d5620ca20f96adb62b6fef05e4676c0a60983310a1450fdf3d923cb04'
@@ -48,7 +48,9 @@
             'be925eefeac3f28e639794ddc20d64e6faafd7181804e29417a510224d19ccc7'
             '973224f53e9a6fcfaa9c6cb842b02430a601d1c7ce0abb41b3591470d128930c'
             'ef9f401fa84fe1772af9efee6816643534f2896da4c23b809937b19771bdfbbf'
-            '8126c92a5fc15738c4f7982aadb5a4033230fc2d5da05af9133a96ad1181419e')
+            '8126c92a5fc15738c4f7982aadb5a4033230fc2d5da05af9133a96ad1181419e'
+            'a1c562ebe4538d672404ca3ac2e954a3c955afeb7463f7b4fe6eaa6fa74fe5c7'
+            'a39da083c038ada797ffc5bedc9ba47455a3f77057d42f86484ae877ef9172ea')
 
 prepare(){
   cd sage-$pkgver
@@ -74,12 +76,12 @@
   patch -p1 -i ../sagemath-gslcblas.patch
 # fix freezes in R interface with readline 7 (Debian)
   patch -p1 -i ../r-no-readline.patch
+# fix build with planarity 3 (Debian)
+  patch -p2 -i ../sagemath-planarity3.patch
 
 # Upstream patches  
 # fix build against libfes 0.2 http://trac.sagemath.org/ticket/15209
-#  patch -p0 -i ../fes02.patch
-# disable fes module, fails to compile
-  patch -p0 -i ../disable-fes.patch
+  patch -p1 -i ../fes02.patch
 # replace is_package_installed usage http://trac.sagemath.org/ticket/20377
   patch -p1 -i ../is-package-installed.patch
 # Allow compiling without pari's anal.h https://trac.sagemath.org/ticket/22195

Deleted: disable-fes.patch
===================================================================
--- disable-fes.patch	2017-01-29 11:13:17 UTC (rev 209346)
+++ disable-fes.patch	2017-01-29 11:18:40 UTC (rev 209347)
@@ -1,19 +0,0 @@
---- src/module_list.py.orig	2015-06-07 11:29:30.710612146 +0200
-+++ src/module_list.py	2015-06-07 11:30:21.877506106 +0200
-@@ -564,11 +564,11 @@
-               sources = ["sage/libs/ecl.pyx"],
-               libraries = ["ecl"]),
- 
--    OptionalExtension("sage.libs.fes",
--             ["sage/libs/fes.pyx"],
--             language = "c",
--             libraries = ['fes'],
--             package = 'fes'),
-+#    OptionalExtension("sage.libs.fes",
-+#             ["sage/libs/fes.pyx"],
-+#             language = "c",
-+#             libraries = ['fes'],
-+#             package = 'fes'),
- 
-     Extension('sage.libs.flint.flint',
-               sources = ["sage/libs/flint/flint.pyx"],

Added: fes02.patch
===================================================================
--- fes02.patch	                        (rev 0)
+++ fes02.patch	2017-01-29 11:18:40 UTC (rev 209347)
@@ -0,0 +1,57 @@
+From b1f5e3ecc789db674fe17552812f2d0e2ab84be0 Mon Sep 17 00:00:00 2001
+From: Charles Bouillaguet <charles.bouillaguet at 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)
+ 
+ 
+ include 'sage/ext/interrupt.pxi'  #sig_on(), sig_off()
+@@ -219,7 +221,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
+

Added: sagemath-planarity3.patch
===================================================================
--- sagemath-planarity3.patch	                        (rev 0)
+++ sagemath-planarity3.patch	2017-01-29 11:18:40 UTC (rev 209347)
@@ -0,0 +1,113 @@
+Author: Ximin Luo <infinity0 at debian.org>
+Bug: https://trac.sagemath.org/ticket/21774
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/sage/src/sage/graphs/planarity.pyx
++++ b/sage/src/sage/graphs/planarity.pyx
+@@ -3,13 +3,19 @@
+ """
+ 
+ cdef extern from "planarity/graph.h":
+-    ctypedef struct graphNode:
+-        int v
++    ctypedef struct vertexRec:
+         int link[2]
+-    ctypedef graphNode * graphNodeP
++        int index
++    ctypedef vertexRec * vertexRecP
++
++    ctypedef struct edgeRec:
++        int link[2]
++        int neighbor
++    ctypedef edgeRec * edgeRecP
+ 
+     ctypedef struct BM_graph:
+-        graphNodeP G
++        vertexRecP V
++        edgeRecP E
+         int N
+     ctypedef BM_graph * graphP
+ 
+@@ -93,15 +99,16 @@
+             g._pos = { u: [0,0], v: [0,1] }
+         return (True, None) if kuratowski else True
+ 
+-    # create to and from mappings to relabel vertices to the set {0,...,n-1}
++    # create to and from mappings to relabel vertices to the set {1,...,n}
++    # (planarity 3 uses 1-based array indexing, with 0 representing NIL)
+     cdef int i
+     listto = g.vertices()
+     ffrom = {}
+     for vvv in listto:
+-        ffrom[vvv] = listto.index(vvv)
++        ffrom[vvv] = listto.index(vvv) + 1
+     to = {}
+     for i from 0 <= i < len(listto):
+-        to[i] = listto[i]
++        to[i + 1] = listto[i]
+     g.relabel(ffrom)
+ 
+     cdef graphP theGraph
+@@ -125,7 +132,7 @@
+     status = gp_Embed(theGraph, EMBEDFLAGS_PLANAR)
+     gp_SortVertices(theGraph)
+ 
+-    # use to and from mappings to relabel vertices back from the set {0,...,n-1}
++    # use to and from mappings to relabel vertices back from the set {1,...,n}
+     g.relabel(to)
+ 
+     if status == NOTOK:
+@@ -134,12 +141,12 @@
+         # Kuratowski subgraph isolator
+         g_dict = {}
+         from sage.graphs.graph import Graph
+-        for i from 0 <= i < theGraph.N:
++        for i from 0 < i <= theGraph.N:
+             linked_list = []
+-            j = theGraph.G[i].link[1]
+-            while j >= theGraph.N:
+-                linked_list.append(to[theGraph.G[j].v])
+-                j = theGraph.G[j].link[1]
++            j = theGraph.V[i].link[1]
++            while j:
++                linked_list.append(to[theGraph.E[j].neighbor])
++                j = theGraph.E[j].link[1]
+             if len(linked_list) > 0:
+                 g_dict[to[i]] = linked_list
+         G = Graph(g_dict)
+@@ -153,12 +160,12 @@
+             if set_embedding:
+                 emb_dict = {}
+                 #for i in range(theGraph.N):
+-                for i from 0 <= i < theGraph.N:
++                for i from 0 < i <= theGraph.N:
+                     linked_list = []
+-                    j = theGraph.G[i].link[1]
+-                    while j >= theGraph.N:
+-                        linked_list.append(to[theGraph.G[j].v])
+-                        j = theGraph.G[j].link[1]
++                    j = theGraph.V[i].link[1]
++                    while j:
++                        linked_list.append(to[theGraph.E[j].neighbor])
++                        j = theGraph.E[j].link[1]
+                     emb_dict[to[i]] = linked_list
+                 g._embedding = emb_dict
+             if set_pos:
+@@ -174,12 +181,12 @@
+ 
+                 emb_dict = {}
+                 #for i in range(theGraph.N):
+-                for i from 0 <= i < theGraph.N:
++                for i from 0 < i <= theGraph.N:
+                     linked_list = []
+-                    j = theGraph.G[i].link[0]
+-                    while j >= theGraph.N:
+-                        linked_list.append(to[theGraph.G[j].v])
+-                        j = theGraph.G[j].link[0]
++                    j = theGraph.V[i].link[0]
++                    while j:
++                        linked_list.append(to[theGraph.E[j].neighbor])
++                        j = theGraph.E[j].link[0]
+                     emb_dict[to[i]] = linked_list
+                 g._embedding = emb_dict
+         gp_Free(&theGraph)



More information about the arch-commits mailing list