Boost logo

Boost-Build :

From: Steve M. Robbins (steve_at_[hidden])
Date: 2008-04-21 22:12:39


On Mon, Apr 21, 2008 at 04:07:49PM +0400, Vladimir Prus wrote:
> On Sunday 13 April 2008 16:14:23 Steve M. Robbins wrote:
>
> > > In case of Boost, both filename and soname include X.Y.Z. The question
> > > is wether it's OK, of if we should have only two versions in soname.
> >
> > First of all, the SONAME is always the same as the library filename.
> > The reason is this: at link time, the SONAME is embedded into the
> > binary produced; at runtime, the runtime loader searches for a file
> > with the name of SONAME.
> >
> > When -lfoo is given at link time, a file by the name of "foo.so" is
> > sought. As indicated previously, the convention is that foo.so is a
> > symlink to foo.so.1.3.32. In this manner, the SONAME "foo.so.1.3.32"
> > is embedded in the binary and foo.so.1.3.32 is used at runtime
> > regardless of what foo.so points to or whether it even exists.
>
> I don't think the above is true, in general:

No, it's not true in general. I was speaking in the context of Boost
where -- because there is no ABI compatibility -- the SONAME has all
three version components.

> > > > > I guess the questions I have now are:
> > > > >
> > > > > 1. Why the version name is present twice?
> > > > > 2. Do you really need to encode variants in the name, like "mt"?
> > > > > Why are you building all possible variants?
> > > >
> > > > To answer the last question first: Debian packages all possible
> > > > variants because we don't know a priori which variant a user will
> > > > need. If someone is building boost-using code and is handed a jam
> > > > file that requires libboost_program_options-mt-d-1.34.1.so.1.34.1, we
> > > > should have that available.
> > >
> > > I would have hoped that the name of boost library one needs is customizable
> > > in the project needing boost -- otherwise, it won't build with any
> > > other Boost version :-)
> >
> > But this begs the question. Why should one have to customize
> > anything? The project should just build. Most other libraries manage
> > this because they DO NOT embed the version name in the link library
> > name, i.e. the "-lfoo" part.
>
> Err, I'm asking you why you build all variants, and you say that some
> project might link to a specific variant, and I suggest that the project
> might link to some other variant, and you suggest that the project links
> to libboost_foo? Well, isn't this exactly the same as my original suggestion
> to build a single variant, without any decoration?

OK, now I'm totally confused :-)

Can you build a single variant that is suitable for both
single-threaded and multi-threaded applications? If so, why has Boost
been generating foo.a and foo-mt.a all these years? Ditto for the
-d variants.

Chimo,
-Steve




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