Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install Boost on Ubuntu

Tags:

ubuntu

boost

I'm on Ubuntu, and I want to install Boost. I tried with

sudo apt-get install boost 

But there was no such package. What is the best way to install Boost on Ubuntu?

like image 731
k53sc Avatar asked Sep 25 '12 07:09

k53sc


People also ask

How do I know if boost is installed Ubuntu?

You can check version. hpp inside Boost include dir (normally /usr/include/boost , you can use locate /boost/version. hpp or similar to get that) for BOOST_VERSION or BOOST_LIB_VERSION .


2 Answers

You can use apt-get command (requires sudo)

sudo apt-get install libboost-all-dev 

Or you can call

aptitude search boost 

find packages you need and install them using the apt-get command.

like image 84
Anton Guryanov Avatar answered Sep 17 '22 15:09

Anton Guryanov


Get the version of Boost that you require. This is for 1.55 but feel free to change or manually download yourself:

wget -O boost_1_55_0.tar.gz https://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.gz/download tar xzvf boost_1_55_0.tar.gz cd boost_1_55_0/ 

Get the required libraries, main ones are icu for boost::regex support:

sudo apt-get update sudo apt-get install build-essential g++ python-dev autotools-dev libicu-dev libbz2-dev libboost-all-dev 

Boost's bootstrap setup:

./bootstrap.sh --prefix=/usr/ 

Then build it with:

./b2 

and eventually install it:

sudo ./b2 install 
like image 29
user3715812 Avatar answered Sep 20 '22 15:09

user3715812