Boost logo

Boost-Build :

Subject: Re: [Boost-build] b2 - what does this message mean? "error: No best alternative for"
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2019-04-02 14:11:37


AMDG

On 4/2/19 3:09 AM, Paul A. Bristow via Boost-build wrote:
> I have been checking some jamfiles, and wanted to test that a program (here a hello-worldly examples using chrono).
>
> I wanted to check that I could build using both a pre-built library in the usual boost/lib location
>
> <library>/boost/chrono//boost_chrono
>
> run hello_boost_chrono_library.cpp ; # Use pre-built library.
>
> and also using a build-now library version
>
> run hello_boost_chrono_library.cpp /boost/chrono//boost_chrono ; # Build using a built-now library.
>
> Both run commands work on their own, but not nicely together, as I naively expected.
>

If you have two targets with the same name,
they are not independent. Instead, they
are considered target alternatives. When
you build it, b2 will choose one based on
the build properties and target requirements.
You can think of it as being like an overloaded
function. The (default) name of a run target is
derived from the source file. To make this
work the way you want, you need to set the name
of one or both of these targets explicitly.

run hello_boost_chrono_library.cpp
  : name hello_boost_chrono_library_prebuilt
  ;

> Command: b2 -a -j16 address-model=64 toolset=msvc-14.1,msvc-14.2,gcc-8.1.0,clang-win-7.0.1,clang-win-8.0.0 release
>
> I got several variants of warnings like this:
>
> "Performing configuration checks
>
> - default address-model : 32-bit
> - default architecture : x86
> - symlinks supported : yes
> error: No best alternative for ./hello_boost_chrono_library
> next alternative: required properties: (empty)
> matched
> next alternative: required properties: (empty)
> matched
> "
>
> which I find inscrutable and puzzling.
>
> The result is 5 passes, one for each compiler. I had hoped for 10 passes, 2 runs for each.
>
> Am I simply doing something that should not work?
>

In Christ,
Steven Watanabe


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