Boost logo

Boost-Build :

From: Robert Langlois (ezralanglois_at_[hidden])
Date: 2008-06-12 12:56:06


Hi Volodya,

I am creating a shared python library that handles MPI functionality. The
library compiles fine and seems to run but I want to add unit testing to my
Jamfile.

So I do the following:

python-extension foo : bar.cpp ;
 # Since the compiling works fine, I left out the mpi specific requirements.

make-test run-pyd : foo foobar.py
                         : <testing.arg>-lib=?? <python.interpreter>mpiexec
                      : test-foo ;

For the above test, I added "<python.interpreter>mpiexec", which prefixes
mpiexec on the command line like so:
mpiexec python foobar.py

This all works properly (at least on linux). The problem is that before
"mpiexec python foobar.py" is executed, PYTHONPATH is exported to the system
but for some reason, this exporting does not work when I add
<python.interpreter>mpiexec. If I remove <python.interpreter>mpiexec, it
works fine but I need mpiexec in the test.

So to work around this, I added <testing.arg>-lib=?? where ?? will be the
path of the shared library created by "python-extension foo", but I cant
seem to get the path in a straightforward manner.

Best Regards,
Rob

On Thu, Jun 12, 2008 at 11:41 AM, Vladimir Prus <ghost_at_[hidden]> wrote:

> On Thursday 12 June 2008 19:51:41 Robert Langlois wrote:
> > Hi Everyone,
> >
> > How can I get the build path of a target? For example, say I create a
> > target:
> >
> > python-extension test-lib ;
> >
> > This file ends up in the following path:
> > bin/programs/learn/python/gcc-4.0.2/debug/threading-multi
> >
> > I wanted to know if there is a rule that already exists to get this path
> in
> > a platform independent way.
> >
> > The reason I need this path is that I am trying to prefix the python
> > interpretor with another command (mpiexec) and the PYTHONPATH environment
> > variable is nullified in some way when I do this. So, I propose to pass
> the
> > path of the shared file to a python script to get around this problem.
>
> Your email is a little bit obscure as to what you're trying to do. To
> answer
> your question -- during Jamfile parsing, it's not possible to get the path
> of the target, because you cna build your project with 10 different
> property
> sets. Inside a generator, you have a specific property set, and can get a
> path for a target (see virtual-target.path method). Inside an rule/action
> pair you also can get a path to the target.
>
> I suggest you describe your use-case more concretely.
>
> - Volodya
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost-build
>

-- 
Robert Langlois


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk