Boost logo

Boost Users :

Subject: Re: [Boost-users] Building boost with a locally built g++
From: Anthony Foiani (tkil_at_[hidden])
Date: 2012-05-13 22:40:21


Mark Summerfield <list_at_[hidden]> 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 )


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