|
Boost-Build : |
From: Toon Knapen (toon.knapen_at_[hidden])
Date: 2004-12-06 02:02:50
Vladimir Prus wrote:
>>So this works great. One last problem (I hope it's the last;-) is that
>>the fake_mpi or real_mpi is not propagated to exe targets that use the
>>library that is compiled with <parallelism>fake or <parallelism>mpi.
>
>
> Ehmm.. what's "propagated"?
>
As you mention in the bbv2 doc in the 'library dependencies' section,
for static libraries the executable should be linked with the specified
static libraries and the dependencies of these static libraries.
Now this project contains following files
<foo.cpp>
void foo() { MPI_Init() ; }
</foo.cpp>
<main.cpp>
int main() { foo() ; return 0 ; }
</main.cpp>
and the Jamfile reads
<jamfile>
convert objects obj : foo.cpp : <parallelism>header ;
lib libfoo_mp : objects : <parallelism>mpi ;
exe test_mp : main.cpp libfoo_mp ;
Thus here the exe is linked to libfoo which is linked to mpi. Thus the
link-line for the exe should contain foo and the mpi library. However it
only contains foo and thus the calls to MPI are not resolved. Thus the
link-line looks like
g++ -o bin/gcc/debug/link-static/test_mp
bin/gcc/debug/link-static/main.o
bin/gcc/debug/link-static/parllelism-mpi/libfoo_mp.a -g
I would have expected that libfoo_mp had a dependency on the MPI library
(and 'bjam link=shared libfoo_mp clearly shows that libfoo_mp is linked
with the mpi library) and thus that the link-line for the executable
would also contain the mpi library.
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