1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
|
diff --git a/build/pkgs/bliss/checksums.ini b/build/pkgs/bliss/checksums.ini
index e97d89587b..0c1ebf647b 100644
--- a/build/pkgs/bliss/checksums.ini
+++ b/build/pkgs/bliss/checksums.ini
@@ -1,4 +1,5 @@
-tarball=bliss-VERSION.tar.gz
-sha1=1da8f098046824fbfff4c64c337e28b2a082f74f
-md5=452aea8737d3c4ad0d8ff39180be8004
-cksum=2193930007
+tarball=bliss-VERSION.zip
+sha1=c91c9dcbc11d66ffbcf6415e09ebe793df37be2a
+md5=5707cbfd9fd00980571c64ab3584c505
+cksum=1626493724
+upstream_url=https://users.aalto.fi/~tjunttil/bliss/downloads/bliss-VERSION.zip
diff --git a/build/pkgs/bliss/dependencies b/build/pkgs/bliss/dependencies
index 4f00de2037..c225c495cc 100644
--- a/build/pkgs/bliss/dependencies
+++ b/build/pkgs/bliss/dependencies
@@ -1,4 +1,4 @@
-# no dependencies
+| cmake
----------
All lines of this file are ignored except the first.
diff --git a/build/pkgs/bliss/package-version.txt b/build/pkgs/bliss/package-version.txt
index e93ee1376f..9e1e206c41 100644
--- a/build/pkgs/bliss/package-version.txt
+++ b/build/pkgs/bliss/package-version.txt
@@ -1 +1 @@
-0.73+debian-1+sage-2016-08-02.p0
+0.77
diff --git a/build/pkgs/bliss/spkg-install.in b/build/pkgs/bliss/spkg-install.in
index aaf4c3037b..4124a2338e 100644
--- a/build/pkgs/bliss/spkg-install.in
+++ b/build/pkgs/bliss/spkg-install.in
@@ -1,4 +1,4 @@
cd src
-sdh_configure --disable-gmp
+sdh_cmake -DUSE_GMP=OFF -DCMAKE_VERBOSE_MAKEFILE=ON
sdh_make
sdh_make_install
diff --git a/build/pkgs/bliss/spkg-src b/build/pkgs/bliss/spkg-src
deleted file mode 100755
index 90073233b7..0000000000
--- a/build/pkgs/bliss/spkg-src
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-#
-# creates the tarball in the current dir, to be moved to ../../../upstream
-#
-# adapted from cliquer/spkg-src
-
-die () {
- echo >&2 "$@"
- exit 1
-}
-
-rm -rf bliss/
-git clone -b sage_package https://github.com/mkoeppe/bliss.git || die "Failed to git clone"
-cd bliss/
-
-VERSION=`autoconf --trace='AC_INIT:$2'`
-libtoolize || die "Failed to autoreconf"
-autoreconf -fi || die "Failed to autoreconf"
-automake --add-missing --copy || die "automake failed"
-./configure || die "configure failed"
-
-rm -f bliss-$VERSION.tar.gz
-make dist || die "make dist failed"
-mv bliss-$VERSION.tar.gz ../
-cd ..
-rm -rf bliss/
-
-
diff --git a/src/sage/graphs/bliss.pyx b/src/sage/graphs/bliss.pyx
index 921bc6a765..1f1f502558 100644
--- a/src/sage/graphs/bliss.pyx
+++ b/src/sage/graphs/bliss.pyx
@@ -47,22 +47,23 @@ cdef extern from "bliss/graph.hh" namespace "bliss":
cdef cppclass Graph(AbstractGraph):
Graph(const unsigned int)
void add_edge(const unsigned int, const unsigned int)
- void find_automorphisms(Stats&, void (*)(void*, unsigned int,
- const unsigned int*), void*)
void change_color(const unsigned int, const unsigned int)
- const unsigned int* canonical_form(Stats&, void (*)(void*, unsigned int,
- const unsigned int*), void*)
+ const unsigned int* canonical_form(Stats&)
+
+cdef extern from "bliss/digraph.hh" namespace "bliss":
cdef cppclass Digraph(AbstractGraph):
Digraph(const unsigned int)
void add_edge(const unsigned int, const unsigned int)
- void find_automorphisms(Stats&, void (*)(void*, unsigned int,
- const unsigned int*), void*)
void change_color(const unsigned int, const unsigned int)
- const unsigned int* canonical_form(Stats&, void (*)(void*, unsigned int,
- const unsigned int*), void*)
+ const unsigned int* canonical_form(Stats&)
unsigned int get_hash()
+cdef extern from "bliss_find_automorphisms.h":
+
+ void bliss_find_automorphisms(Graph*, void (*)(void*, unsigned int, const unsigned int*), void*, Stats&)
+ void bliss_find_automorphisms(Digraph*, void (*)(void*, unsigned int, const unsigned int*), void*, Stats&)
+
cdef int encoding_numbits(int n):
r"""
@@ -124,9 +125,6 @@ cdef void add_gen(void *user_param, unsigned int n, const unsigned int *aut):
sig_free(done)
-cdef void empty_hook(void *user_param, unsigned int n, const unsigned int *aut):
- return
-
#####################################################
# constructing bliss graphs from edge lists
#####################################################
@@ -345,10 +343,10 @@ cdef canonical_form_from_edge_list(int Vnr, list Vout, list Vin, int Lnr=1, list
if directed:
d = bliss_digraph_from_labelled_edges(Vnr, Lnr, Vout, Vin, labels, partition)
- aut = d.canonical_form(s, empty_hook, NULL)
+ aut = d.canonical_form(s)
else:
g = bliss_graph_from_labelled_edges(Vnr, Lnr, Vout, Vin, labels, partition)
- aut = g.canonical_form(s, empty_hook, NULL)
+ aut = g.canonical_form(s)
for i in range(len(Vout)):
x = Vout[i]
@@ -640,11 +638,11 @@ cdef automorphism_group_gens_from_edge_list(int Vnr, Vout, Vin, int Lnr=1, label
if directed:
d = bliss_digraph_from_labelled_edges(Vnr, Lnr, Vout, Vin, labels, partition)
- d.find_automorphisms(s, add_gen, <void*>data)
+ bliss_find_automorphisms(d, add_gen, <void*>data, s)
del d
else:
g = bliss_graph_from_labelled_edges(Vnr, Lnr, Vout, Vin, labels, partition)
- g.find_automorphisms(s, add_gen, <void*>data)
+ bliss_find_automorphisms(g, add_gen, <void*>data, s)
del g
return [[cyc for cyc in gen if cyc[0] is not None] for gen in gens]
diff --git a/src/sage/graphs/bliss_find_automorphisms.h b/src/sage/graphs/bliss_find_automorphisms.h
new file mode 100644
index 0000000000..a2c084a163
--- /dev/null
+++ b/src/sage/graphs/bliss_find_automorphisms.h
@@ -0,0 +1,22 @@
+#include <bliss/graph.hh>
+#include <bliss/digraph.hh>
+
+inline void bliss_find_automorphisms(bliss::Graph *graph, void (*hook)(void *user_param, unsigned int n, const unsigned int *aut), void *hook_user_param, bliss::Stats s)
+{
+ auto report_aut = [&](unsigned int n, const unsigned int *aut) -> void {
+ if(hook)
+ (*hook)(hook_user_param, n, aut);
+ };
+
+ graph->find_automorphisms(s, report_aut);
+}
+
+inline void bliss_find_automorphisms(bliss::Digraph *graph, void (*hook)(void *user_param, unsigned int n, const unsigned int *aut), void *hook_user_param, bliss::Stats s)
+{
+ auto report_aut = [&](unsigned int n, const unsigned int *aut) -> void {
+ if(hook)
+ (*hook)(hook_user_param, n, aut);
+ };
+
+ graph->find_automorphisms(s, report_aut);
+}
|