Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make boost.build use a specific compiler installation?

I am trying to build boost 1.45 using a local GCC compiler installation. I can't make it use a different compiler command that the default "g++". Here what happened so far:

In boost_1_45_0 source directory:

./bootstrap.sh --with-toolset=gcc --prefix=$INSTALL/boost-$TYPE

Then added the following line to "projct-config.jam":

using gcc : 4.4.6 : [absolute path]/install/gcc-4.4.6/bin/g++ : ;

./bjam install --prefix=$INSTALL/boost-$TYPE

When bringing up the process list during building, I can see that the system's default compiler command g++ gets used.

like image 470
ritter Avatar asked Oct 01 '11 11:10

ritter


Video Answer


2 Answers

That should be toolset=gcc-4.4.6 rather than --with-toolset=gcc (features are not specified with leading dashes).

like image 146
ildjarn Avatar answered Oct 17 '22 08:10

ildjarn


The problem was a previous definition of using which got in the way. This solves the problem:

project-config.jam:

if ! gcc in [ feature.values <toolset> ]
{
    using gcc : 4.4.6 : [absolute path]/install/gcc-4.4.6/bin/g++ : -L[absolute path]/install/gcc-4.4.6/lib64 -I[absolute path]/install/gcc-4.4.6/include ;
}
like image 36
ritter Avatar answered Oct 17 '22 07:10

ritter