|
Boost-Build : |
From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-12-01 05:32:54
On Tuesday 30 November 2004 12:28, Toon Knapen wrote:
> Toon Knapen wrote:
> > Vladimir Prus wrote:
> >>That's right, but when you invoke bjam it tries to build all targets with
> >>the default values of properties. For <parallelism> that's "mpi"
> >
> > Hmmm, so I made 'none' the default and now it works just fine.
>
> [snip]
>
> Actually it does not yet really work the way I want ;-)
> What I would like to obtain is that compiling with 'bjam
> <parallelism>=fake' and 'bjam <parallelism>=mpi' use the same object
> file (foo.o) but generate a different library. Because only the
> (dynamic) library depends on one or the other library. But the object
> file is totally identical so I would like to prevent to compile it twice.
>
> So I tried to make the feature 'incidental' wich results in only one
> object file but also the library is created once ;-(
>
>
> Sorry for being a pain in the neck, especially with my <parallelism>
> feature ;-(
Things start to be interesting!
There are two facets:
- at the moment, feature either affects target paths or not, there's nothing
in between
- moreover, you want feature to differently affect parts of a same main
target.
The first problem will be solved by a new feature <in-path> which controls
which properties are added to target path. But that's not going to be
implemented today ;-) The second problem is a bit hairy. But maybe, something
simple like:
lib all-the-sources : .......... : <link>static <parallelism>none ;
lib your_lib : all-the-sources ;
would work. The idea is that you create auxilliary static lib, which will be
linked with <parallelism>none (so no duplication of objects), and then your
top-level link with use it. The top-level link can be built with with real
and fake mpi.
Use of intermediate library is needed because:
obj x : a.cpp b.cpp ;
does not work (it will try to create two x.obj), and
local x ;
for local s in $(sources)
{
obj $(s:B) : $(s) : <parallelism>none ;
x += $(s) ;
}
lib your_lib : $(x) ;
is more lines of code.
- Volodya
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