Boost on Ubuntu

Current Ubuntu and Debian distributions lacks up-to-date version of Boost C++ library.

Here is a simple script to install new version with required packages:

#!/bin/sh

# Install packages to Ubuntu (8.04)
sudo apt-get install curl make flex bison libtool automake autoconf
sudo apt-get install g++ python-dev
sudo apt-get install libexpat1-dev libicu-dev libopenmpi-dev libz-dev libbz2-dev
#sudo apt-get install libboost-dev

# Download 1.35+ boost C++ library instead of old (1.34) releases in Ubuntu Linux
BOOST_VERSION=1_38
curl -O http://dfn.dl.sourceforge.net/sourceforge/boost/boost_${BOOST_VERSION}_0.tar.bz2
tar xvjpf boost_${BOOST_VERSION}_0.tar.bz2
cd boost_${BOOST_VERSION}_0
echo "using mpi ;" >>user-config.jam
EXPAT_INCLUDE=/usr/include
EXPAT_LIBPATH=/usr/lib
ICU_PATH=/usr
MPI_PATH=/usr
./configure
make
sudo make install
sudo ln -s /usr/local/include/boost-${BOOST_VERSION}/boost /usr/local/include/boost
cd ${CURRENTDIR}

Leave a Reply

Your email address will not be published. Required fields are marked *