Boost logo

Boost-Build :

From: Mat Marcus (mat-lists_at_[hidden])
Date: 2008-04-08 16:07:07


On Tue, Apr 8, 2008 at 10:25 AM, Vladimir Prus <ghost_at_[hidden]> wrote:
>
> On Tuesday 08 April 2008 04:37:33 Mat Marcus wrote:
> > Some of my projects make use of boost build conditionals. In
> > particular. I make use of the Intel Thread Building Blocks Library. I
> > build my libraries under msvc and darwin. The (stable) version of the
> > Intel TBB is supported under msvc, and under darwin address-model=64,
> > but not under darwin address-model=32. To account for this state of
> > affairs I currently define a feature that tracks which tells whether
> > the atomics from the Intel TBB library is available for a particular
> > build. E.g.
> >
> > #none doesn't mean no atomics--it means non-named value for the atomics feaure
> > feature atomics : none tbb : composite ;
> > #if change the next line then need to make parallel changes inside the
> > body of use-atomics
> > feature.compose <atomics>tbb : <include>../intel_tbb_libraries/include
> > <define>ADOBE_ATOMICS ;
> > feature.compose <atomics>none : ;
> >
> > rule use-atomics ( properties * )
> > {
> > local result ;
> > if ( ! ( <toolset>darwin in $(properties) ) ) ||
> > ( ( <address-model>64 in $(properties) ) ) ||
> > ( ( <architecture>x86 in $(properties) ) ) {
> > if ( <toolset>gcc in $(properties) && ( os<NT> || os<cygwin> in
> > properties ) ) {
> > } else {
> > # need to copy the <include> and <define> items here...bjam does not
> > propagate them through
> > # the dependent usage_requirements below otherwise
> > result += <atomics>tbb
> > <include>../intel_tbb_libraries/include <define>ADOBE_ATOMICS ;
> > }
> > }
> > return $(result) ;
> > }
> >
> > My top level project requirements in tree1/Jamfile.v2 include a
> > reference to this conditional:
> > # ...
> > : default-build
> > <link>static
> > <threading>multi
> > <conditional>@use-atomics
> >
> > This seems to work as expected within the tree1. But now I introduce a
> > second tree2 that depends on tree1. I'd like the conditional from
> > tree1 to be usable in tree2. In particular, tree2 depends on libs in
> > tree1 and I'd like to be able to use the conditional in the usage
> > requirements for all libs in tree1. I've not been able to succeed. Can
> > someone please advise me on how to arrange for tree1 libraries'
> > conditional usage requirements to be available in tree2?
>
> Can you clarify if you want code in tree2 to be able to use the 'use-atomics'
> rule, or you want the effect of that rule to be always automatically
> to be propagated, or something else?
>
> - Volodya

Here is a link to the actual top level Jamfile.v2 from proj1
(containing the use-atomics conditional)
http://easyurl.net/use_atomics_example1 . Please forgive my poor
boost-build skills (though any suggestions for improvements to the
file are always welcome). One of the first things that I would like is
for the @use-atomics condition to be used in the usage-requirements
for the libraries lib asl and lib asl dev. That is, I'd like
applications or libraries that exist in *other* project trees to pick
up via the lib asl_dev usage requirements 1) the location of the
directory where the headers for the Intel TBB libraries live, since
for example headers in lib asl_dev conditionally #include
<tbb/atomic.h>. 2) the right <define> according to the state of the
conditional 3) the value of the feature reflected in the path.

Oddly it seems like applications in other project trees (e.g. proj2)
are picking up (3) but not 1) or 2).

Thanks,
Mat

P.S. For more background info, the proj2 tree that I am working with
is here http://easyurl.net/proj2_top_level_JF_1


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