Take the 2-minute tour ×

How do you install Boost on MacOS? Right now I can't find bjam for the Mac.

update: Thanks for the MacPorts answer, and special thanks to hasseg's comment for the link


I'm still new to my Mac, but with ports it seems like we'll get going along much better.

share|improve this question
You can always try like "port search <whatever>" - in your case boost - when unsure. –  gustafbstrom Nov 17 '13 at 9:17
add comment

6 Answers

up vote 51 down vote accepted

Run the following command:

sudo port install boost 

Or nowadays (from answer below):

brew install boost
share|improve this answer
This is what dies is referring to: macports.org –  hasseg Sep 19 '08 at 18:51
Thanks you save me a lot of time ! –  malat Nov 23 '09 at 17:32
if you prefer running things through root sudo -s /opt/local/bin/port install boost –  Pungs Feb 12 '13 at 16:21
I don't believe macports is dead inasmuch as it has fallen out of fashion. –  Josef Salyer Nov 23 '13 at 3:39
The problem comes when you want Boost.Python and Boost.MPI. You have to compile from source codes because macports always uses his python and also only openmpi but not anaconda's python and mpich. –  Hui Zhang Nov 29 '13 at 11:43
add comment

This question and answer are over 2 yrs old now. I think the most easy way to do it these days is to install brew and then "brew install boost".

The current url for homebrew is http://brew.sh/

share|improve this answer
How long does it take different people? Took me 48 mins with 2 GB RAM, not sure what CPU. –  Luke Stanley Jun 20 '13 at 13:37
@LukeStanley AFAIK Homebrew uses pre-compiled packages ("bottles") for Boost these days, making the installation a matter of seconds. –  Philipp Jul 29 '13 at 12:35
add comment

Just get the source, and compile Boost yourself it has become very easy. Here is an example for the current version of Boost (1.50.0) on the current OSX (10.7.4) as of this writing:

  1. Download the the .tar.gz from http://sourceforge.net/projects/boost/files/boost/1.50.0/
  2. Unpack and go into the directory:

    tar -xzf boost_1_50_0.tar.gz
    cd boost_1_50_0

  3. Configure (and build bjam):

    ./bootstrap.sh --prefix=/some/dir/you/would/like/to/prefix
  4. Build:

  5. Install:

    ./b2 install

Depending on the prefix you choose in Step 3, you might need to sudo Step 5, if the script tries copy files to a protected location.

share|improve this answer
add comment

Fink appears to have a full set of Boost packages...

With fink installed and running just do

fink install boost1.35.nopython

at the terminal and accept the dependencies it insists on. Or use

fink list boost

to get a list of different packages that are availible.

share|improve this answer
add comment

Unless your compiler is different than the one supplied with the Mac XCode Dev tools, just follow the instructions in section 5.1 of Getting Started Guide for Unix Variants. The configuration and building of the latest source couldn't be easier, and it took all about about 1 minute to configure and 10 minutes to compile.

share|improve this answer
add comment

you can download bjam for OSX (or any other OS) here

share|improve this answer
add comment

Your Answer


