|
Boost-Build : |
Subject: Re: [Boost-build] bjam for Mac OS X -gcc4.x
From: Gevorg Voskanyan (v_gevorg_at_[hidden])
Date: 2011-02-22 12:59:53
er wrote:
> Thanks for following up.
>
> - The path /sw/lib/gcc4.4/bin is indeed that which shortcut /sw/bin/g++-4
>points to.
OK
> - The configuration is in
>/usr/local/boost-trunk/tools/build/v2/user-config.jam.
> - find / tells me the only other user-config.jam's are in ~/sandbox/somewhere
>and I doubt that bjam looks there.
OK. You can also use --debug-configuration option to bjam to diagnose which
config files are getting loaded.
> - In particular, I have not had to ammend ~/user-config.jam as it does not
>exist.
> - If you see to it differently (about its existence), let me know.
You just create a user-config.jam in $HOME with your own content. That helps to
avoid re-doing this configuration when you update/switch to another version of
Boost and/or Boost.Build.
> >> PS: It works from IDE CodeBlocks with the following settings:
> >> search path = /sw/bin, C compiler = gcc-4, C++ compiler = g++-4, Linker
> >> for dyn libs = g++-4. These are in fact shortcuts to gcc and g++ in
> >> /sw/lib/gcc4.4/bin
> >
> > What happens when you try:
> > using darwin : 4.4 : /sw/bin/g++-4 ;
> > ?
> >
>
> In user-config.jam I tried both
>
> using darwin : 4.4 : /sw/bin/g++-4 : <linkflags>\"-L/sw/bin\" ;
>
> and
>
> using darwin : 4.4 : g++-4 : <linkflags>\"-L/sw/bin\" ;
>
> with similar results:
>
> $sudo bjam toolset=darwin-4.4
> ...patience...
> ...patience...
> ...found 1503 targets...
> ...updating 16 targets...
> darwin.compile.c++
>../../../../../bin.v2/libs/assign/v2/test/unit_testing/detail.test/darwin-4.4/debug/detail.o
>
> g++-4: unrecognized option '-no-cpp-precomp'
Now I see that g++-4 is indeed the one getting invoked. And it produces a
familiar warning too ;)
> darwin.link
>../../../../../bin.v2/libs/assign/v2/test/unit_testing/detail.test/darwin-4.4/debug/detail
>
> ld: warning: in
>../../../../../bin.v2/libs/test/build/darwin-4.4/debug/link-static/libboost_unit_test_framework.a,
> file was built for unsupported file format which is not the architecture being
>linked (i386)
That libboost_unit_test_framework.a might have been built with another compiler
that you have previously configured as darwin-4.4. Try a full rebuild ( -a
option to bjam ).
> Undefined symbols:
What undefined symbols?
> "file was built for unsupported file format which is not the architecture
>being linked (i386)" is perhaps revealing that I shouldn't mix a ported
>compiler with toolset=darwin? So I tried
No. For the record, I use MacPorts gcc 4.5 as toolset darwin-4.5 with -std=c++0x
and it works well for me.
> using gcc : 4.4 : g++-4 : <linkflags>\"-L/sw/bin\" ;
>
> $sudo bjam toolset=gcc-4.4
> ...patience...
> ...patience...
> ...found 1503 targets...
> ...updating 16 targets...
> gcc.compile.c++
>../../../../../bin.v2/libs/assign/v2/test/unit_testing/detail.test/gcc-4.4/debug/detail.o
>
> gcc.link
>../../../../../bin.v2/libs/assign/v2/test/unit_testing/detail.test/gcc-4.4/debug/detail
>
> ld: : unknown option: --start-group
> collect2: ld returned 1 exit status
>
> "g++-4" -o
>"../../../../../bin.v2/libs/assign/v2/test/unit_testing/detail.test/gcc-4.4/debug/detail"
> -Wl,--start-group
>"../../../../../bin.v2/libs/assign/v2/test/unit_testing/detail.test/gcc-4.4/debug/detail.o"
>"../../../../../bin.v2/libs/test/build/gcc-4.4/debug/link-static/libboost_unit_test_framework.a"
> ; -Wl,-Bstatic -Wl,-Bdynamic -Wl,--end-group -g "-L/sw/bin"
>
> etc.
I don't think toolset=gcc is meant to work under OS X. toolset=darwin is.
Please try
sudo bjam toolset=darwin-4.4 -a
and let us know what happens.
HTH,
Gevorg
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