[IPOL discuss] various questions about python demos

Nicolas Limare nicolas.limare at cmla.ens-cachan.fr
Mon Nov 28 15:09:29 CET 2011


> 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?

Yes, os.chdir. But don'tu use it in the demo, because this working
directory is shared by all the threads of the demo system running
simultaneously, including your demo and all the others demo, whou
should not start a fight to decide which is the global current
directory.

Use the source, Luke! :)

build.run() is the run() function of ./lib/build.py, defined as

    def run(command, stdout, cwd=None, env=None):

cwd is the parameter you want.

-> build.run("./configure", cwd=os.path.join(..., "src"))

> 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.

This is just a shameless teaser, but I worked a little on a
specification to automagically build any IPOL software with
  pkg_install_bin("http://www.foo.bar/blah/blah/algo_42.zip")
instead of the current confusing build system. But it is probably
better not to expect this to be available before january.

> 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.

Yes, it was really made for images from the begining. It will probably
have to evolve. Any proposition or patch on the current demo code is
welcome.

-- 
Nicolas LIMARE - CMLA - ENS Cachan    http://www.cmla.ens-cachan.fr/~limare/
IPOL - image processing on line                          http://www.ipol.im/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://tools.ipol.im/mailman/archive/discuss/attachments/20111128/5a9f4426/attachment.pgp>


More information about the discuss mailing list