summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Borassi <michele.borassi@imtlucca.it>2015-07-27 19:29:12 +0200
committerMichele Borassi <michele.borassi@imtlucca.it>2015-07-28 12:42:55 +0200
commitd060ccbddf96281324e021e49b6e20758a01cb26 (patch)
tree63fb860f83d3e926659069443141260f5d3550f6
parentIncluded Nathann's work (diff)
Check that libxml2 is installed
-rw-r--r--build/pkgs/igraph/spkg-install6
-rw-r--r--src/sage/graphs/generic_graph.py6
2 files changed, 9 insertions, 3 deletions
diff --git a/build/pkgs/igraph/spkg-install b/build/pkgs/igraph/spkg-install
index d86a164..5d0ae62 100644
--- a/build/pkgs/igraph/spkg-install
+++ b/build/pkgs/igraph/spkg-install
@@ -1,5 +1,11 @@
#!/usr/bin/env bash
+if gcc -lxml2 2>&1 | grep -q 'cannot find -lxml2'; then
+ echo "
+You need libxml2 to run igraph. On Ubuntu and Debian Linux, installing the build-essential and the libxml2-dev packages is sufficient."
+ exit 1
+fi
+
cd src
./configure --prefix="$SAGE_LOCAL" --libdir="$SAGE_LOCAL/lib"
diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py
index 4802cae..b06afb0 100644
--- a/src/sage/graphs/generic_graph.py
+++ b/src/sage/graphs/generic_graph.py
@@ -1333,12 +1333,12 @@ class GenericGraph(GenericGraph_pyx):
import igraph
v_to_int = {v:i for i,v in enumerate(self.vertices())}
edgelist = [(v_to_int[v],v_to_int[w])
- for v,w in self.edges(labels=False)]
+ for v,w in self.edges(labels=False)]
return igraph.Graph(self.num_verts(), edgelist, directed=self.is_directed())
except ImportError:
raise ImportError("The package igraph is not available. To " +
- "install it, run Sage with option -i " +
- "python_igraph.")
+ "install it, run Sage with option -i " +
+ "python_igraph.")
def to_dictionary(self, edge_labels=False, multiple_edges=False):
r"""