Boost logo

Boost-Build :

Subject: Re: [Boost-build] problem with installing
From: Shridhar Daithankar (ghodechhap_at_[hidden])
Date: 2010-05-29 20:01:54


On Sunday 30 May 2010 02:12:25 Belcourt, Kenneth wrote:
> On May 28, 2010, at 11:56 PM, Shridhar Daithankar wrote:
> > $ bjam -n --prefix=/home/shridhar /cms/player//install
> > ...patience...
> > ...patience...
> > ...found 4560 targets...
> > ...updating 5 targets...
> > gcc.link.dll /home/shridhar/lib/libcmsutils.so
> > gcc.link.dll /home/shridhar/lib/libcmsdb.so
> > gcc.link.dll /home/shridhar/lib/libcmscore.so
> > common.copy /home/shridhar/lib/libcmsplayer.so
> >
> > ...updated 5 targets...
> > ----------------------------
> >
> > I do not understand why 3 libraries are relinked during installation.
> > Relinking a binary is understandable but why libraries?
>
> There's a general discussion here
>
> http://www.boost.org/doc/tools/build/doc/userman.pdf
>
> on page 67 (dll-path) for why relinking during install is useful for
> binaries (the same argument also applies to shared libraries).

Hmm. looking at gcc command bjam plans to run in two cases,i.e. build a shared
library and install a shared library, I do not see -rpath/-R option. It is
only set for executables. So the relinking libraries is entirely
unnecessary/not-useful as of now.

These are two commands for a dependent library

Build
    "g++" -o "build/db/gcc-4.5.0/release/threading-multi/libcmsdb.so" -Wl,-
h -Wl,libcmsdb.so -shared -Wl,--start-group
"build/db/gcc-4.5.0/release/threading-multi/schema.o"
"build/db/gcc-4.5.0/release/threading-multi/db.o"
"build/db/gcc-4.5.0/release/threading-multi/dbwfl.o"
"build/utils/gcc-4.5.0/release/threading-multi/libcmsutils.so" -Wl,-Bstatic
-Wl,-Bdynamic -lsoci_postgresql -lsoci_core -lrt -Wl,--end-group -pthread -
Wl,--hash-style=gnu

Install
   "g++" -Wl,-R -Wl,"/usr/lib" -o "/home/shridhar/lib/libcmsdb.so" -Wl,-h -
Wl,libcmsdb.so -shared -Wl,--start-group
"build/db/gcc-4.5.0/release/threading-multi/schema.o"
"build/db/gcc-4.5.0/release/threading-multi/db.o"
"build/db/gcc-4.5.0/release/threading-multi/dbwfl.o"
"build/utils/gcc-4.5.0/release/threading-multi/libcmsutils.so" -Wl,-Bstatic
-Wl,-Bdynamic -lsoci_postgresql -lsoci_core -lrt -Wl,--end-group -pthread -
Wl,--hash-style=gnu

During install it hardcodes /usr/lib, which is entirely unnecessary, at least
on linux.

Furthermore, in a chain of dependent libraries, I would expect either all of
them relinked or only the dependent ones. In my case, the chain is player-
>core->utils. When I run install in player, the player library is copied but
the other two are relinked. Why so?

The utils library does not depend on any other library in the project, so it
should not be relinked, right?

>
> > Since multiple modules are doing link on same library during
> > installation and
> > there is a copy too, the original error of duplicate target name is
> > reported.
>
> Yes, the install duplicate target name is a known issue.

I couldn't find a reference to that. Any ideas/plans to fix it?

In my case, there is a workaround of running module-by-module install rule but
that makes boost-build look not smart enough.

-- 
Regards 
 Shridhar

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