Boost logo

Boost-Build :

From: Toon Knapen (toon.knapen_at_[hidden])
Date: 2004-04-29 08:17:21

Rene Rivera wrote:
> Toon Knapen wrote:
>>Rene Rivera wrote:
>>>Toon Knapen wrote:
>>>>I have a dynamic library 'bar' that calls MPI routines (or whatever
>>>>third party library) that are defined in a static library. Now my
>>>>executable 'foo' calls a function defined in 'bar' and also calls MPI
>>>> foo.exe ----calls----> ----calls-----> MPI (mpich.a, pmpich.a)
>>>> | ^
>>>> |---------------------------------------------

>>However this is not a real clean solution IMO because suppose that I
>>create but somebody else uses my and links foo.exe. Now my
>> contains (part of) the MPI library definitions. If somebody else
>>now links with _and_ links with the MPI libraries installed on
>>_his_ machine, he's possibly linking the application with 2 different
>>versions of the MPI libaries which might result in strange behaviour.
> The only real solution I can see is to put the MPI functions in a shared
> library. It's the only way to guarantee a single runtime binding on
> different platforms.

But I can's just convert any static library (that is installed by the
system vendor) into a dynamic library. Therefore I think that a solution
could be:
not link with MPI
but make sure the order of the linkline looks like:
'ld -o foo.exe -lbar -lmpi'
(instead of the current 'ld -o foo.exe -lmpi -lbar')


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at