On 09/29/2013 03:18 AM, Tiago de Paula Peixoto wrote:
On 09/29/2013 12:05 AM, Mark Howell wrote:
On 09/28/2013 11:54 AM, Mark Howell wrote:
I am trying to use purge_vertices() with a vertex filter to efficiently remove vertices from a graph. I am seeing different behavior in version 2.2.18 and 2.2.25, both as prebuilt packages for Ubuntu precise (current "graph-tool" and "python-graph-tool" packages, respectively)
[snip]
Update... I built graph-tool from the 2.2.25 source tarball and ran from that instead of the python-graph-tool 2.2.25-1 Precise deb package, and my test code ran fine.
Wonder if there's some kind of dependency problem in the 2.2.25-1 Precise deb package?
FWIW I couldn't get 2.2.25 to build from source with the standard Precise numpy package based on 1.6.1. I replaced that with numpy I built from their 1.7.1 tarball and then was able to build graph-tool successfully... after 2 hours of CPU time ;-)
Looking at the present python-graph-tool 2.2.25-1 precise package, it depends on python-scipy (but no particular version or range specified) and from there presumably depends indirectly on numpy. Maybe it is willing to install with an older (1.6) numpy but is partially broken with it?
This is strange... I definitely was able to build it with numpy 1.6, otherwise how could I have made the packages?
I do see the same problem on precise, but nowhere else. This all does sound like a nasty numpy compatibility thing, but it is not at all clear what is going on. I'll have to take a closer look.
Cheers, Tiago
Thx Tiago. A little more detail might help: when I tried to compile graph-tool 2.2.25 on Precise with the standard numpy 1.6.1 package, it died while building graph_closeness, complaining of undefined NPY_ARRAY_ALIGNED and brethren: $ make make all-recursive make[1]: Entering directory `/home/markh/Code/graph-tool-2.2.25' Making all in src make[2]: Entering directory `/home/markh/Code/graph-tool-2.2.25/src' Making all in graph make[3]: Entering directory `/home/markh/Code/graph-tool-2.2.25/src/graph' Making all in centrality make[4]: Entering directory `/home/markh/Code/graph-tool-2.2.25/src/graph/centrality' CXX graph_betweenness.lo CXX graph_centrality_bind.lo CXX graph_closeness.lo In file included from graph_closeness.hh:29:0, from graph_closeness.cc:23: ./../numpy_bind.hh: In function 'boost::python::api::object wrap_vector_owned(std::vector<ValueType>&)': ./../numpy_bind.hh:78:34: error: 'NPY_ARRAY_ALIGNED' was not declared in this scope ./../numpy_bind.hh:78:54: error: 'NPY_ARRAY_C_CONTIGUOUS' was not declared in this scope ./../numpy_bind.hh:79:25: error: 'NPY_ARRAY_OWNDATA' was not declared in this scope ./../numpy_bind.hh:79:45: error: 'NPY_ARRAY_WRITEABLE' was not declared in this scope ./../numpy_bind.hh:79:64: error: there are no arguments to 'PyArray_ENABLEFLAGS' that depend on a template parameter, so a declaration of 'PyArray_ENABLEFLAGS' must be available [-fpermissive] ./../numpy_bind.hh:79:64: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) ./../numpy_bind.hh: In function 'boost::python::api::object wrap_vector_not_owned(std::vector<ValueType>&)': ./../numpy_bind.hh:96:33: error: 'NPY_ARRAY_ALIGNED' was not declared in this scope ./../numpy_bind.hh:96:53: error: 'NPY_ARRAY_C_CONTIGUOUS' was not declared in this scope ./../numpy_bind.hh:97:25: error: 'NPY_ARRAY_WRITEABLE' was not declared in this scope ./../numpy_bind.hh:97:44: error: there are no arguments to 'PyArray_ENABLEFLAGS' that depend on a template parameter, so a declaration of 'PyArray_ENABLEFLAGS' must be available [-fpermissive] ./../numpy_bind.hh: In function 'boost::python::api::object wrap_multi_array_owned(boost::multi_array<ValueType, Dim>&)': ./../numpy_bind.hh:116:34: error: 'NPY_ARRAY_ALIGNED' was not declared in this scope ./../numpy_bind.hh:116:54: error: 'NPY_ARRAY_C_CONTIGUOUS' was not declared in this scope ./../numpy_bind.hh:117:25: error: 'NPY_ARRAY_OWNDATA' was not declared in this scope ./../numpy_bind.hh:117:45: error: 'NPY_ARRAY_WRITEABLE' was not declared in this scope ./../numpy_bind.hh:117:64: error: there are no arguments to 'PyArray_ENABLEFLAGS' that depend on a template parameter, so a declaration of 'PyArray_ENABLEFLAGS' must be available [-fpermissive] ./../numpy_bind.hh: In function 'boost::python::api::object wrap_multi_array_not_owned(boost::multi_array<ValueType, Dim>&)': ./../numpy_bind.hh:130:34: error: 'NPY_ARRAY_ALIGNED' was not declared in this scope ./../numpy_bind.hh:130:54: error: 'NPY_ARRAY_C_CONTIGUOUS' was not declared in this scope ./../numpy_bind.hh:131:25: error: 'NPY_ARRAY_WRITEABLE' was not declared in this scope ./../numpy_bind.hh:131:44: error: there are no arguments to 'PyArray_ENABLEFLAGS' that depend on a template parameter, so a declaration of 'PyArray_ENABLEFLAGS' must be available [-fpermissive] ./../numpy_bind.hh: In function 'boost::multi_array_ref<ValueType, dim> get_array(boost::python::api::object)': ./../numpy_bind.hh:173:30: error: 'NPY_ARRAY_C_CONTIGUOUS' was not declared in this scope At global scope: cc1plus: warning: unrecognized command line option "-Wno-unused-local-typedefs" [enabled by default] make[4]: *** [graph_closeness.lo] Error 1 make[4]: Leaving directory `/home/markh/Code/graph-tool-2.2.25/src/graph/centrality' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/home/markh/Code/graph-tool-2.2.25/src/graph' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/markh/Code/graph-tool-2.2.25/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/markh/Code/graph-tool-2.2.25' make: *** [all] Error 2 $ Perhaps your build machine has a numpy 1.7 installed in /usr/local/lib/python2.7/dist-packages (or elsewhere) in addition to the standard Precise package in usr/lib/python2.7/dist-packages, and your graph-tool ./configure is finding that one to compile against? Cheers, Mark.