Boost logo

Boost Users :

Subject: [Boost-users] Building boost with custom gcc/g++
From: arjun (narjunkumar_at_[hidden])
Date: 2013-01-07 07:37:49


Hi,

I have issues in getting boost to build with a custom gcc installation in a
separate folder, with default gcc in /usr/bin/.
Describing the problem, and issues I am facing below. I would love to have
a foolproof and right way to do this. I hope I can
get some help here.

Building boost with a custom compiler :

Problem :

1. I have gcc/g++ in /usr/bin, and I have gcc 4.7.2 in
/shared/tools/rtf/bin/gcc & /shared/tools/rtf/bin/g++

2. I want to compile boost libraries using gcc 4.7.2 ONLY.

Solutions :

1. If I export PATH as /shared/tools/rtf/bin:$PATH, so that "which gcc"
picks the 4.7.2 one, then I run ./bootstrap.sh and ./b2 install, is that a
correct way to do it?

2. Alternatively, would I have to change some .jam files like
user-config.jam to point out gcc with using gcc : gcc-4.4 :
/shared/tools/... gcc
and then compile using Boost.build? Is this the recommended way?

Issues/Confusions :

1. If I try to build using Boost.build way I first go to the directory
tools/build/v2. Now 1st step to bootstrap, how to bootstrap it with
/shared/tools/...gcc compiler?

The only way I saw for that was to do like
CC=/shared/tools/..gcc ./bootstrap.sh --with-toolset=cc
as this actually picks from CC environment variable. Is this correct?

2. The subsequent step
./b2 install --prefix=INSTALL_PATH to build Boost.build fails saying cc.jam
not present. How to get that jam file to be present? Should that be created
manually?

3. I had also changed user-config.jam to have gcc-4.7 (using gcc : 4.7 :
/shared/tools/..gcc).

CC=/shared/tools/..gcc ./bootstrap.sh --with-toolset=cc toolset=gcc-4.7

Is this used during bootstrap.sh step? Or only when we give the actual
boost build (running b2)

4. Another issue was when I run the bootstrap.sh inside tools/build/v2 (to
get Boost.build built), If I give a --with-toolset option, I get the b2 and
bjam executables
in the current directory. If I do not give a with-toolset option, it
automatically defaults to cc, in which case the b2,bjam are inside
engine/bin.linux86_64 folder.
Not able to understand this.

Thanks,
Arjun



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net