[IPOL discuss] various questions about python demos

Haldo Spontón haldosponton at gmail.com
Mon Nov 28 14:44:16 CET 2011


Dear Juan,

answering your first question, you can use && instead of semicolon.
I use
 build.run("cd %s && cmake . && make" % self.src_dir, stdout=log_file)
hope you find this useful.

Bests,

Haldo.-

2011/11/28 Juan Cardelino <juan.cardelino at gmail.com>

> Dear all,
>        I have a couple of questions about the demo system, because
> one of my demos is somehow different that the average.
>
> 1) I have  code which needs a ./configure to generate its makefile.
> Ideally, I would like to do the following:
> build.run("./configure"); <- the problem here is that this needs to be
> run in the src dir but the demo code runs outside it.
> build.run("make -C src");
> Is there a way to change the working dir in python? Because as far as
> I know, there is no way to change the working directory in a
> ./configure script
> I also tried build.run("cd src ; ./configure "); and it didn't work.
> Also tried to escape the semilcolon, but without any luck.
> At the moment, I use a pre-generated makefile, but it think this it
> not the best idea, because I have to hard-wire the path to the
> libraries, o assume they are in an standard path.
>
> 2) Regarding the same topic, it would be useful to run cmake in the
> same way (this is related to a recent Nicolas question).
> So far I had no luck with this, sorry Nicolas.
>
> 3) I'm working in matching of graphs and trees, which in turn come
> from images. When I try to illustrate this in a demo, I do the
> following:
>
> a) im1->tree1
> b) im2->tree2
> c) (im1,im2,tree1,tree2)->G (a graf)
> d) G->matching
>
> In this case the demo fits exactly in the IPOL's demo model: two input
> images, one list of nodes as output (then passed to a graph renderer
> to show it as an image)
> I'm also matching RAGs, for which I do the following:
>
> a) im1->tree1
> b) im2->tree2
> c) (im1,im2,tree1,tree2)->G (a graf)
> d) G->matching
>
> But in general I think it will be very helpful to have a standalone
> demo which receives directly a couple of graphs and outputs the
> isomorphism. So I need to use a couple of input formats for the
> graphs. If the graph is expressed as an adjacency matrix, the input
> will be a text file with the matrix (in a sort of csv format), and in
> the case of a adjacency list, it will be a list of pairs of connected
> nodes (again in a text file).
> My problem with this is the input. Currently the input system is
> tailored to images, so it will take some coding to adapt it to another
> kind of input, for instance to  upload a text file, rename it, etc.
>
> Have you guys tried to do something similar?
> Thanks in advance.
> Best regards,
>                   Juan
> _______________________________________________
> discuss mailing list
> discuss at list.ipol.im
> http://tools.ipol.im/mailman/listinfo/discuss
>



-- 
Haldo Spontón
(+598) (99) 869 855
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tools.ipol.im/mailman/archive/discuss/attachments/20111128/d686f7fb/attachment.html>


More information about the discuss mailing list