[Boost-users] [build] cannot specify different version of gcc

1,991 views
Skip to first unread message

Brodie Thiesfield

unread,
Oct 31, 2010, 7:21:33 PM10/31/10
to boost...@lists.boost.org
Hi,

I'm trying to build boost on CentOS 5.5 using the /usr/bin/gcc44
compiler and I'm running into difficulties with documentation not
fitting reality. How do I make this work?

What I've tried...

Note: I've removed /usr/bin/gcc and /usr/bin/g++ to force errors when
gcc44 and g++44 are not used.

Using ./bootstrap.sh
Building Boost.Jam with toolset ... tools/jam/src/###
### No toolset specified. Please use --toolset option.

Setting CC=/usr/bin/gcc44 and CXX=/usr/bin/g++44 (note that this won't
work if gcc and g++ exist because then it will default to the gcc
toolkit and not the gcc-4.4 toolkit that I want). This builds a number
of things (looking at the bootstrap.log) but still gives the following
error. Ignoring the error and calling ./bjam then fails.
Building Boost.Jam with toolset ... tools/jam/src/###
### No toolset specified. Please use --toolset option.

Using ./bootstrap.sh --toolset=gcc gives an error:
unrecognized option: --toolset=gcc

Using ./bootstrap.sh --with-toolset=gcc gives an error:
Building Boost.Jam with toolset gcc...
Failed to build Boost.Jam
-> bootstrap.log shows that it is trying to build with gcc, which
doesn't exist, therefore error.

Using ./bootstrap.sh --with-toolset=gcc-4.4 gives an error:
Building Boost.Jam with toolset gcc...
Failed to build Boost.Jam
-> bootstrap.log shows ### Unknown toolset: gcc-4.4

Creating ~/user-config.jam as:
import toolset.using ;
using gcc : 4.4 : g++44 ;

export BOOST_USER_CONFIG=~/user-config.jam

Then calling the same ./bootstrap.sh command lines above show no difference.

How in the world do I get this thing to use /usr/bin/gcc44 and
/usr/bin/g++44 to compile?

I think that I'm going to have to create local links ./gcc ->
/usr/bin/gcc44 and add the current directory to the path just to get
this to build the way that I want it to. This seems crazy.

Regards,
Brodie
_______________________________________________
Boost-users mailing list
Boost...@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users

Brodie Thiesfield

unread,
Nov 7, 2010, 9:21:10 PM11/7/10
to boost...@lists.boost.org
I'll simplify the question in order to try again for help.

I have found that the only way I can force boost 1.44.0 to build on
linux using a version of gcc installed as /usr/bin/gcc44 is to create
a symlink of gcc -> /usr/bin/gcc44 on the path. This can't be right.

Can anyone tell me how to specify an alternate compiler? See below for
the methods (from the documentation) that I have tried and found to
not work.

Regards,
Brodie

Kim Barrett

unread,
Nov 8, 2010, 1:18:41 AM11/8/10
to boost...@lists.boost.org

On Nov 7, 2010, at 9:21 PM, Brodie Thiesfield wrote:

> I'll simplify the question in order to try again for help.
>
> I have found that the only way I can force boost 1.44.0 to build on
> linux using a version of gcc installed as /usr/bin/gcc44 is to create
> a symlink of gcc -> /usr/bin/gcc44 on the path. This can't be right.
>
> Can anyone tell me how to specify an alternate compiler? See below for
> the methods (from the documentation) that I have tried and found to
> not work.

Part of the problem seems to be misleading / incorrect error messages:

>> ### No toolset specified. Please use --toolset option.

seems to be an error message from bjam, but I think "--toolset" should instead be "toolset". I don't know anything about ./bootstrap.sh though.

I use something like

bjam toolset=gcc ... lots of other options ...

with a user-config.jam file containing something like

using gcc : : /usr/local/bin/mygcc : <cxxflags>="..." ;

[Remember that whitespace separation matters in user-config.jam]

papafi

unread,
Aug 24, 2011, 10:11:14 PM8/24/11
to boost...@lists.boost.org
The file user-config.jam allow to you set a multiple gcc config.
1. copy tools/build/v2/user-config.jam into your $HOME directory
2. and set gcc 4.4 option
# Configure specific gcc version, giving alternative name to use.
using gcc : 4.4 : g++44 ;

3. run
./bootstrap.sh
from boost root directory

4. run bjam with toolset option and your options like:
./bjam toolset=gcc-4.4

-----
Alexei Valyaev
--
View this message in context: http://boost.2283326.n4.nabble.com/build-cannot-specify-different-version-of-gcc-tp3021591p3767181.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Reply all
Reply to author
Forward
0 new messages