Boost logo

Boost-Build :

From: João Luís Pinto (joaoluispinto_at_[hidden])
Date: 2008-09-01 13:02:59


Hello Jurko,

Thank you for the quick reply and the helpful info and tips.

Now I have:

Boost.Build V2 (Milestone 12)
Boost.Jam 03.1.17

Following the your sugestions, the first problem is apparently solved.
I do can compile, and the rules seem to be being followed. But I get
the following error:

error: No best alternative for ./system_monitor_sources
    next alternative: required properties: <host-os>windows <threading>multi
        not matched
    next alternative: required properties: <host-os>linux <threading>multi
        not matched
    next alternative: required properties: <host-os>unix <threading>multi
        not matched
...found 21 targets...
...updating 6 targets...

Compilation goes on as if the rule for linux was in fact matched. The
multithreading is set as a project requiremente in the Jamroot file of
the whole project. Do you have an idea why it says that the linux rule
is not matched?

As for the second problem, again following your directions, I found
that the problem is of other nature: since the lib is only suposed to
be built on a specific OS, the sources list becomes empty in all
others and triggers an error:

error: No best alternative for ./mylib_sources
    next alternative: required properties: <host-os>windows <threading>multi
        not matched
    next alternative: required properties: <threading>multi
        not matched
/usr/share/boost-build/build/generators.jam:851: in try-one-generator-really
*** argument error
* rule object(gcc-linking-generator)@31.run ( project name ? :
property-set : sources + )
* called with: ( object(project-target)@110 mylib :
object(property-set)@128 : )
* missing argument sources
/usr/share/boost-build/tools/gcc.jam:428:see definition of rule 'run'
being called

Is there any way to disable entirely the lib compilation on a specific platform?

Again, many thanks.

Best regards,

João

On Mon, Sep 1, 2008 at 4:40 PM, Jurko Gospodnetić
<jurko.gospodnetic_at_[hidden]> wrote:
> Hi João.
>
>> I'm having two problems with setting alternatives based on toolsets in
>> a multi-platform and toolset project with:
>>
>> Boost.Build V2 (Milestone 12)
>> Boost.Jam 03.1.16
>>
>> The first problem is that, with Jamfile.jam such as:
>>
>> lib system_monitor
>> : src/processlistwindows.cxx
>> : <define>MYDEF
>> : <toolset>msvc
>> ;
>>
>> lib system_monitor
>> : src/processlistlinux.cxx
>> : <define>MYDEF
>> : <toolset>gcc
>> ;
>>
>> I get the following error running 'bjam -q --toolset=gcc':
>>
>> ~/usr/share/boost-build/build/feature.jam:432: in
>> feature.validate-value-string from module feature
>> error: "msvc" is not a known value of feature <toolset>
>> error: legal values: "gcc"
>
> I believe this version had an incorrectly placed property value validation
> check when processing requirements and that this has since been resolved in
> the trunk.
>
> Use the Boost Build version coming with Boost 1.36.0, the latest nightly
> build (http://zigzag.lvk.cs.msu.su/~ghost/boost_build_nightly/ in case the
> official web site still has problems updating its nightly build links) or
> the current trunk version. I would suggest using the current nightly build.
>
> Also, if you do take the nightly build, build yourself a new bjam
> executable as there have been several bugs fixed in it since it was last
> released.
>
> I tried the following jamfile.jam with the current trunk version (on
> Windows) and it works as expected:
>
>> exe aaa : a.cpp : <toolset>woopsie <runtime-link>static ;
>> exe aaa : a.cpp : <toolset>msvc <runtime-link>shared ;
>
> With a.cpp file containing just the 'int main() {}' function.
>
>
>> The second problem is that I want to have certain libraries that are
>> part of the project to be considered dependencies (and therefore
>> built) only on certain platforms. I'm using <toolset> like this:
>>
>> alias source_list : platform_a_sourcelist : <toolset>msvc ;
>>
>> alias source_list ;
>>
>> lib mylib : source_list : <define>MYDEF ;
>>
>> But I am having no sucess.
>
> What do you mean by no success? I tried the following jamfile.jam:
>
>> alias source-list : b.cpp : <toolset>msvc ;
>> alias source-list ;
>> exe aaa : a.cpp source-list ;
>
> With a.cpp file containing just the 'int main() {}' function and b.cpp
> containing just a 'void f() {}' function.
>
> And it worked like a charm:
>
>> C:\Documents and Settings\Jurko\BBTest>bjam gcc
>> ...found 8 targets...
>> ...updating 5 targets...
>> MkDir1-quick-fix-for-windows bin
>> MkDir1-quick-fix-for-windows bin\gcc-3.4.4
>> MkDir1-quick-fix-for-windows bin\gcc-3.4.4\debug
>> gcc.compile.c++ bin\gcc-3.4.4\debug\a.o
>> gcc.link bin\gcc-3.4.4\debug\aaa.exe
>> ...updated 5 targets...
>>
>> C:\Documents and Settings\Jurko\BBTest>bjam msvc
>> ...found 12 targets...
>> ...updating 6 targets...
>> MkDir1-quick-fix-for-windows bin\msvc-9.0express
>> MkDir1-quick-fix-for-windows bin\msvc-9.0express\debug
>> MkDir1-quick-fix-for-windows bin\msvc-9.0express\debug\threading-multi
>> compile-c-c++ bin\msvc-9.0express\debug\threading-multi\b.obj
>> b.cpp
>> compile-c-c++ bin\msvc-9.0express\debug\threading-multi\a.obj
>> a.cpp
>> msvc.link bin\msvc-9.0express\debug\threading-multi\aaa.exe
>> ...updated 6 targets...
>
> As you can see from the output, when compiling with gcc it did not compile
> the b.cpp file while it did so when compiling with msvc.
>
> This could possibly also be a bug due to an old Boost Build version though.
>
>
> Hope this helps.
>
> Best regards,
> Jurko Gospodnetić
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost-build
>


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