How do you install Boost on MacOS?


Question or issue on macOS:

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

How to solve this problem?

Solution no. 1:

Download MacPorts, and run the following command:

sudo port install boost 

Solution no. 2:

You can get the latest version of Boost by using Homebrew.

brew install boost.

Solution no. 3:

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

  1. Download the the .tar.gz from
  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):

    ./ --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.

Solution no. 4:

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.

Solution no. 5:

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.

Solution no. 6:

Install both of them using homebrew separately.

brew install boost
brew install bjam

Solution no. 7:

Install Xcode from the mac app store.
Then use the command:

 /usr/bin/ruby -e "$(curl -fsSL" 

the above will install homebrew and allow you to use brew in terminal

then just use command :

brew install boost 

which would then install the boost libraries to <your macusername>/usr/local/Cellar/boost

Solution no. 8:

In order to avoid troubles compiling third party libraries that need boost installed in your system, run this:

sudo port install boost +universal 

Solution no. 9:

Try +universal

One thing to note: in order for that to make a difference you need to have built python with +universal, if you haven’t or you’re not sure you can just rebuild python +universal. This applies to both brew as well as macports.

$ brew reinstall python $ brew install boost 


$ sudo port -f uninstall python $ sudo port install python +universal $ sudo port install boost +universal 

Solution no. 10:

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

Hope this helps!