Boost logo

Boost-Build :

Subject: Re: [Boost-build] BBv2 Slow Startup
From: Kirit Sælensminde (kirit.saelensminde_at_[hidden])
Date: 2008-11-10 01:06:19


Adder wrote:
> Boost Build v2 is a wonderful system, but unfortunately it takes a
> long time to start building stuff.

I've also noticed this and figured that it was just too long to work on
code using Boost without doing something.

What I did was to create a Jamroot that sits at the level above where we
install Boost to (in a folder 'boost') which allows us to pull out just
the DLLs to use.

I've enclosed the Jamroot that we use (but it is also available in our
repo with the rest of the files we use to build Boost in such a way that
it all works -- svn://svn.felspar.com/external/Boost -- username 'guest'
blank password). Without the overhead of trying to work out which bits
of Boost to build it makes our own builds fast enough. We've also done
it in such a way that we can include multiple versions of Boost and
fairly easily switch between them.

The Jamroot itself is cobbled together from old bytes and sticky tape,
but seems to work pretty well for us on our Windows and Linux (Ubuntu
Hardy & Intrepid) machines -- any suggestions for improving it greatly
welcome. My bjam-fu is nowhere interesting and there's a lot of very
clunky code there with hard-coded compiler versions etc.

Is it worth considering to include something like this that Boost users
can use to lower the overhead of bringing in the libraries?

Kirit/kayess


path-constant TOP : . ;
include $(TOP)/../boost-version.jam ;

rule boost-library-linux ( curlib : dll-lib : stem-name : libver : gcc-version )
{
    local prefix-lin = "boost/lib/libboost_" ;
    local gcc = "-gcc" ;
    local version-short = "1_$(BOOST_VERSION_MAJOR)" ;
    local version-full = "1.$(BOOST_VERSION_MAJOR).0" ;

    local filename-rel-so-full = $(prefix-lin) $(name) $(gcc) $(libver) "mt-" $(version-short) ".so." $(version-full) ;
    lib $(curlib) : : <file>$(filename-rel-so-full:J) <variant>release <target-os>linux <toolset-gcc:version>$(gcc-version) ;
    local filename-rel-so = $(prefix-lin) $(name) $(gcc) $(libver) "mt-" $(version-short) ".so" ;
    lib $(dll-lib) : $(curlib) : <file>$(filename-rel-so:J) <variant>release <target-os>linux <toolset-gcc:version>$(gcc-version) ;

    local filename-dbg-so-full = $(prefix-lin) $(name) $(gcc) $(libver) "mt-" "d-" $(version-short) ".so." $(version-full) ;
    lib $(curlib) : : <file>$(filename-dbg-so-full:J) <variant>debug <target-os>linux <toolset-gcc:version>$(gcc-version) ;
    local filename-dbg-so = $(prefix-lin) $(name) $(gcc) $(libver) "mt-" "d-" $(version-short) ".so" ;
    lib $(dll-lib) : $(curlib) : <file>$(filename-dbg-so:J) <variant>debug <target-os>linux <toolset-gcc:version>$(gcc-version) ;
}

rule boost-libraries ( libs * )
{
    local dll-targets = ;
    for local curlib in $(libs) {
        local name = [ MATCH "^boost-(.*)" : $(curlib) ] ;
        local prefix-win = "boost/lib/boost_" ;
        local msvc = "-vc80-" ;
        local version = "1_$(BOOST_VERSION_MAJOR)" ;
        local dll-target = $(curlib) "-dll" ;
        dll-targets += $(dll-target:J) ;

        lib $(curlib) $(dll-target:J) ;

        local filename-rel-lib = $(prefix-win) $(name) $(msvc) "mt-" $(version) ".lib" ;
        lib $(curlib) : : <file>$(filename-rel-lib:J) <variant>release <target-os>windows ;

        local filename-rel-dll = $(prefix-win) $(name) $(msvc) "mt-" $(version) ".dll" ;
        lib $(dll-target:J) : $(curlib) : <file>$(filename-rel-dll:J) <variant>release <target-os>windows ;

        local filename-dbg-lib = $(prefix-win) $(name) $(msvc) "mt-" "gd-" $(version) ".lib" ;
        lib $(curlib) : : <file>$(filename-dbg-lib:J) <variant>debug <target-os>windows ;

        local filename-dbg-dll = $(prefix-win) $(name) $(msvc) "mt-" "gd-" $(version) ".dll" ;
        lib $(dll-target:J) : $(curlib) : <file>$(filename-dbg-dll:J) <variant>debug <target-os>windows ;

        boost-library-linux $(curlib) : $(dll-target:J) : $(name) : "42-" : "4.2.3" ;
        boost-library-linux $(curlib) : $(dll-target:J) : $(name) : "42-" : "4.2.4" ;
        boost-library-linux $(curlib) : $(dll-target:J) : $(name) : "43-" : "4.3.2" ;
    }

    install ../dist/bin : $(dll-targets) : <install-dependencies>on ;
}

boost-libraries
        boost-date_time
        boost-filesystem
        boost-graph
        boost-iostreams
        boost-math_c99
        boost-math_c99f
        boost-math_c99l
        boost-math_tr1
        boost-math_tr1f
        boost-math_tr1l
        boost-prg_exec_monitor
        boost-program_options
        boost-python
        boost-regex
        boost-serialization
        boost-signals
        boost-system
        boost-thread
        boost-unit_test_framework
        boost-wave
        boost-wserialization
    ;


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