Boost logo

Boost-Build :

From: Doug Gregor (dgregor_at_[hidden])
Date: 2007-01-08 11:45:55


Volodya,

On Dec 29, 2006, at 3:43 AM, Vladimir Prus wrote:
> Doug,
> looking at mpi.jam that was added by yourself, I see this:
>
> # Returs the "extra" requirements needed to build MPI. These
> requirements are
> # part of the /mpi//mpi library target, but they need to be added
> to anything
> # that uses MPI directly to work around bugs in BBv2's propagation of
> # requirements.
> rule extra-requirements ( )
> {
> return $(MPI_EXTRA_REQUIREMENTS) ;
> }

Sorry, I should have reported these sooner. Some comment in the
Python jamfiles made me think that this was a known issue. Anyway...

> What bugs do you mean, and are those filed at
>
> https://zigzag.cs.msu.su:7813/boost.build
>
> ? If not, would you please either report those bugs here
> or file them at the URL above?

I'll try. I've had a lot of trouble reproducing this problem with a
small test case, although I have a small test case that fails in a
somewhat related way.

Here's how I can duplicate the problem: in libs/parallel/build/
Jamfile.v2, there are two places where we use [ mpi.extra-
requirements ] when building the "boost_mpi" library. If we remove
those two uses (and leave only the <library>/mpi//mpi part), and
build in libs/parallel/build on some platform where MPI requires
threading support (e.g., Linux), I get the following error message,
which I'll dissect in a moment:

/nfs/rontok/xraid/users/dgregor/Projects/boost/tools/build/v2/build/
feature.jam:701: in expand-composites from module feature
error: explicitly-specified values of non-free feature <threading>
conflict
error: existing values: multi single
error: value from expanding <threading>single : single
/nfs/rontok/xraid/users/dgregor/Projects/boost/tools/build/v2/build/
feature.jam:781: in feature.expand from module feature
/nfs/rontok/xraid/users/dgregor/Projects/boost/tools/build/v2/build/
property-set.jam:165: in object(property-set)@484.expand from module
object(property-set)@484
/nfs/rontok/xraid/users/dgregor/Projects/boost/tools/build/v2/build/
targets.jam:731: in object(main-target)@254.generate from module
object(main-target)@254
/nfs/rontok/xraid/users/dgregor/Projects/boost/tools/build/v2/build/
targets.jam:895: in targets.generate-from-reference from module targets
/nfs/rontok/xraid/users/dgregor/Projects/boost/tools/build/v2/build/
targets.jam:1169: in generate-dependencies from module object(typed-
target)@231
/nfs/rontok/xraid/users/dgregor/Projects/boost/tools/build/v2/build/
targets.jam:1305: in compute-usage-requirements from module object
(typed-target)@231
/nfs/rontok/xraid/users/dgregor/Projects/boost/tools/build/v2/build/
targets.jam:1256: in object(typed-target)@231.generate from module
object(typed-target)@231
/nfs/rontok/xraid/users/dgregor/Projects/boost/tools/build/v2/build/
targets.jam:765: in generate-really from module object(main-target)@246
/nfs/rontok/xraid/users/dgregor/Projects/boost/tools/build/v2/build/
targets.jam:738: in object(main-target)@246.generate from module
object(main-target)@246
/nfs/rontok/xraid/users/dgregor/Projects/boost/tools/build/v2/build/
targets.jam:255: in object(project-target)@227.generate from module
object(project-target)@227
/nfs/rontok/xraid/users/dgregor/Projects/boost/tools/build/v2/build-
system.jam:424: in load from module build-system
/nfs/rontok/xraid/users/dgregor/Projects/boost/tools/build/v2/kernel/
modules.jam:261: in import from module modules
/nfs/rontok/xraid/users/dgregor/Projects/boost/tools/build/v2/kernel/
bootstrap.jam:132: in boost-build from module
/nfs/rontok/xraid/users/dgregor/Projects/boost/boost-build.jam:9: in
module scope from module

Now, when [ mpi.extra-requirements ] is there, the boost_mpi library
has <threading>multi listed directly in its requirements. When
[ mpi.extra-requirements ] is not there, boost_mpi only gets
<threading>multi through its use of <library>/mpi//mpi, so this issue
is related to the propagation of requirements from alias targets.
When seems to be happening is that the default-build contains both
<threading>multi and <threading>single. In the case were we have
[ mpi.extra-requirements], the code that tries to create the
<threading>single variant notes that we have a conflict between the
boost_mpi's <threading>multi requirement and the default-build
<threading>single, so it just doesn't try to build that target
(good). When there is no [ mpi.extra-requirements], that same code
fails to see the propagated <threading>multi, so it goes ahead and
tries to build the <threading>single variant... at some point later,
BBv2 sees both <threading>single and <threading> multi on the same
boost_mpi target, and aborts with the message above.

The closest I've gotten to reproducing this with a *small* test case
is with this Jamfile:

project alias-bug
   :
   :
   : build-dir bin.v2
   : default-build <threading>single <threading>multi ;

alias mpi : : : : <threading>multi ;

exe honk
   : honk.cpp
   : <library>mpi
   ;

(honk.cpp just contains "int main() {}")

This ends up failing with the error message below. It's complaining
about a duplicate name for an actual target, but it looks like it has
the same underlying cause: see how there's a <threading>single
version of the "honk" executable target? It seems like we shouldn't
create that target at all, since the "mpi" alias requires
<threading>multi.

/nfs/rontok/xraid/users/dgregor/Projects/boost/tools/build/v2/build/
virtual-target.jam:985: in virtual-target.register-actual-name from
module virtual-target
error: Duplicate name of actual target: <pbin.v2/gcc/debug/link-
static/threading-multi>honk
error: previous virtual target { gcc%gcc.link-honk.EXE { gcc%
gcc.compile.c++-honk.o.OBJ { honk.cpp.CPP } } }
error: created from ./honk
error: another virtual target { gcc%gcc.link-honk.EXE { gcc%
gcc.compile.c++-honk.o.OBJ { honk.cpp.CPP } } }
error: created from ./honk
error: added properties: <threading>single
error: removed properties: none
/nfs/rontok/xraid/users/dgregor/Projects/boost/tools/build/v2/build/
virtual-target.jam:459: in actualize-no-scanner from module object
(file-target)@304
/nfs/rontok/xraid/users/dgregor/Projects/boost/tools/build/v2/build/
virtual-target.jam:111: in object(file-target)@304.actualize from
module object(file-target)@304
/nfs/rontok/xraid/users/dgregor/Projects/boost/tools/build/v2/build-
system.jam:498: in load from module build-system
/nfs/rontok/xraid/users/dgregor/Projects/boost/tools/build/v2/
example/../kernel/modules.jam:261: in import from module modules
/nfs/rontok/xraid/users/dgregor/Projects/boost/tools/build/v2/
example/../kernel/bootstrap.jam:132: in boost-build from module
/nfs/rontok/xraid/users/dgregor/Projects/boost/tools/build/v2/example/
boost-build.jam:6: in module scope from module

        Cheers,
        Doug


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