Building boost with a locally built g++

Hi, I have two locally built g++'s and want to build boosts to go with them. Unfortunately I've never used jam and despite reading the docs haven't succeeded. I created a user-config.jam file with the single line: using gcc : 4.7 : /home/mark/opt/gcc47/bin/g++ : <compileflags>-std=c++11 -pedantic <linkflags>-lstdc++ -lpthread -L/home/mark/opt/gcc47/lib -L/home/mark/opt/gcc47/lib64 <address-model>64; but this seems to be ignored. All I want to do is build boost for my local g++ 4.6 in ~/opt/gcc46 and my local g++ 4.7 in ~/opt/gcc47. Can anyone give me or point me to some simple instructions for doing this? I did not find http://www.boost.org/doc/libs/1_49_0/more/getting_started/unix-variants.html at all helpful for my situation. In particular, section 5.2 didn't help and b2 just keeps using the system's /usr/bin/g++. (I want boost primarily for its regex library.) Thanks! PS I'm not a subscriber so would appreciate being cc'd in any reply. -- Mark Summerfield, Qtrac Ltd, www.qtrac.eu C++, Python, Qt, PyQt - training and consultancy "Programming in Go" - ISBN 0321774639 http://www.qtrac.eu/gobook.html

AMDG On 05/12/2012 07:24 AM, Mark Summerfield wrote:
I have two locally built g++'s and want to build boosts to go with them.
Unfortunately I've never used jam and despite reading the docs haven't succeeded.
I created a user-config.jam file with the single line:
using gcc : 4.7 : /home/mark/opt/gcc47/bin/g++ : <compileflags>-std=c++11 -pedantic <linkflags>-lstdc++ -lpthread -L/home/mark/opt/gcc47/lib -L/home/mark/opt/gcc47/lib64 <address-model>64;
but this seems to be ignored.
It shouldn't be ignore. See what --debug-configuration prints.
All I want to do is build boost for my local g++ 4.6 in ~/opt/gcc46 and my local g++ 4.7 in ~/opt/gcc47.
Can anyone give me or point me to some simple instructions for doing this? I did not find http://www.boost.org/doc/libs/1_49_0/more/getting_started/unix-variants.html at all helpful for my situation. In particular, section 5.2 didn't help and b2 just keeps using the system's /usr/bin/g++.
In Christ, Steven Watanabe

Mark Summerfield writes:
I have two locally built g++'s and want to build boosts to go with them.
Unfortunately I've never used jam and despite reading the docs haven't succeeded.
Mark -- Here's my incantation; hope you might find it useful. gcc_ver=4.6.2 boost_ver=1_48_0 gcc_pkg="gcc-$gcc_ver" boost_pkg="boost_$boost_ver" gcc_dest=/usr/local/$gcc_pkg boost_dest=/usr/local/$boost_pkg+$gcc_pkg # ======================================== # build gcc cd ~/Source rm -rf $gcc_pkg* tar xf /opt/cross/downloads/$gcc_pkg.tar.bz2 mkdir $gcc_pkg-build cd $gcc_pkg-build ../$gcc_pkg/configure \ --prefix=$gcc_dest \ --with-local-prefix=$gcc_dest/local \ --enable-languages=c,c++ \ --enable-threads \ --disable-multilib make -j 8 sudo mkdir $gcc_dest sudo chown tony.tony $gcc_dest make install ( cd /usr/local ; sudo rm gcc ; sudo ln -s $gcc_pkg gcc ) # ======================================== # build boost cd ~/Source rm -rf $boost_pkg* tar xf /opt/cross/downloads/$boost_pkg.tar.bz2 cd $boost_pkg export PATH=/usr/local/$gcc_pkg/bin:$PATH unset LD_LIBRARY_PATH sudo mkdir $boost_dest sudo chown tony.tony $boost_dest ./bootstrap.sh --prefix=$boost_dest ./bjam \ --prefix=$boost_dest \ --debug-configuration \ --without-graph \ --without-graph_parallel \ --without-math \ --without-mpi \ --without-python \ --without-serialization \ --without-wave \ -j8 \ link=shared \ threading=multi \ runtime-link=shared \ toolset=gcc cxxflags=-std=gnu++0x \ install ( cd /usr/local ; sudo rm boost ; sudo ln -s $boost_pkg+$gcc_pkg boost )

Hi Anthony,
I tried your approach and it worked perfectly*
Thanks:-)
* I did a slight variation in that I built local g++'s and local boosts
to go with them so didn't need to sudo.
On Sun, 13 May 2012 20:40:21 -0600
Anthony Foiani
Mark Summerfield
writes:
I have two locally built g++'s and want to build boosts to go with them.
Unfortunately I've never used jam and despite reading the docs haven't succeeded.
Mark --
Here's my incantation; hope you might find it useful.
gcc_ver=4.6.2 boost_ver=1_48_0
gcc_pkg="gcc-$gcc_ver" boost_pkg="boost_$boost_ver"
gcc_dest=/usr/local/$gcc_pkg boost_dest=/usr/local/$boost_pkg+$gcc_pkg
# ======================================== # build gcc
cd ~/Source rm -rf $gcc_pkg* tar xf /opt/cross/downloads/$gcc_pkg.tar.bz2 mkdir $gcc_pkg-build cd $gcc_pkg-build ../$gcc_pkg/configure \ --prefix=$gcc_dest \ --with-local-prefix=$gcc_dest/local \ --enable-languages=c,c++ \ --enable-threads \ --disable-multilib
make -j 8
sudo mkdir $gcc_dest sudo chown tony.tony $gcc_dest make install
( cd /usr/local ; sudo rm gcc ; sudo ln -s $gcc_pkg gcc )
# ======================================== # build boost
cd ~/Source rm -rf $boost_pkg* tar xf /opt/cross/downloads/$boost_pkg.tar.bz2 cd $boost_pkg export PATH=/usr/local/$gcc_pkg/bin:$PATH unset LD_LIBRARY_PATH
sudo mkdir $boost_dest sudo chown tony.tony $boost_dest
./bootstrap.sh --prefix=$boost_dest
./bjam \ --prefix=$boost_dest \ --debug-configuration \ --without-graph \ --without-graph_parallel \ --without-math \ --without-mpi \ --without-python \ --without-serialization \ --without-wave \ -j8 \ link=shared \ threading=multi \ runtime-link=shared \ toolset=gcc cxxflags=-std=gnu++0x \ install
( cd /usr/local ; sudo rm boost ; sudo ln -s $boost_pkg+$gcc_pkg boost )
-- Mark Summerfield, Qtrac Ltd, www.qtrac.eu C++, Python, Qt, PyQt - training and consultancy "Programming in Go" - ISBN 0321774639 http://www.qtrac.eu/gobook.html
participants (3)
-
Anthony Foiani
-
Mark Summerfield
-
Steven Watanabe