Boost logo

Boost-Build :

Subject: Re: [Boost-build] b2 configuration checks take long time
From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2018-08-30 08:25:02


On Wed, 29 Aug 2018 at 21:24, Steven Watanabe via Boost-build
<boost-build_at_[hidden]> wrote:
> On 08/29/2018 01:13 PM, Mateusz Loskot via Boost-build wrote:
> > ```
> > Performing configuration checks
> > - default address-model : 64-bit (cached)
> > - default architecture : x86 (cached)
> > - symlinks supported : yes (cached)
> > ```
> >
> > How can I speed up the b2 startup?
>
>
> Try inserting a Jamroot to block the extra work that Boost's
> Jamroot is doing automatically. This is a bad idea in
> general, as the aforementioned work is important, but it
> should be okay as long as you set up `b2 headers` beforehand

Hi,

I've tried to apply the Jamroot trick, but without much success.
I did run `b2 headers`, as usual, as per our
https://github.com/boostorg/gil/blob/develop/CONTRIBUTING.md

Here is my Jamfile-s setup

1. libs/gil/Jamfile

```
project boost-gil
    :
    requirements
        <toolset>gcc:<cxxflags>"-std=c++11"
        <toolset>clang:<cxxflags>"-std=c++11"
    ;

build-project test ;
```

2. libs/gil/test/Jamfile

```
import testing ;

project
    : requirements
    <include>$(BOOST_ROOT)
    <include>.
    ;

test-suite "boost-gil-test-image-view"
    :
    [ compile image_view_concepts.cpp ]
    ;
```

##### Run b2 in lib/gil without local Jamroot trick

~/boost.wsl/libs/gil$ time b2
Performing configuration checks

    - default address-model : 64-bit
    - default architecture : x86
    - symlinks supported : yes
...patience...
...found 1331 targets...
...updating 9 targets...
gcc.compile.c++
../../bin.v2/libs/gil/test/image_view/image_view_concepts.test/gcc-7.3.0/debug/image_view_concepts.o
**passed** ../../bin.v2/libs/gil/test/image_view/image_view_concepts.test/gcc-7.3.0/debug/image_view_concepts.test
...updated 9 targets...

real 0m35.011s
user 0m3.641s
sys 0m30.734s

~/boost.wsl/libs/gil$ time b2
Performing configuration checks

    - default address-model : 64-bit (cached)
    - default architecture : x86 (cached)
    - symlinks supported : yes (cached)
...patience...
...found 1334 targets...

real 0m36.655s
user 0m2.641s
sys 0m33.781s

##### Run b2 in lib/gil with local lib/gil/Jamroot

~/boost.wsl/libs/gil$ cp $PWD/Jamfile $PWD/Jamroot

~/boost.wsl/libs/gil$ time b2
...found 14 targets...
...updating 2 targets...
gcc.compile.c++
test/image_view/bin/image_view_concepts.test/gcc-7.3.0/debug/image_view_concepts.o
In file included from test/image_view/image_view_concepts.cpp:9:0:
/usr/include/boost/gil/image_view.hpp: In instantiation of...

So, b2 is finding Boost headers installed system-wide.
To fix it and prefer super-project headers, in my case from ~/boost.wsl/boost
I have to update the local Jamroot adding to the project requirements
the root location:

<include>../../

Is that the right thing to do to apply the local Jamroot trick?

> and do not use any separately compiled boost libraries.

Yes, in this particular case I do not use compiled libraries.

Best regards,

-- 
Mateusz Loskot, http://mateusz.loskot.net

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