Robert Gould
Robert Gould

Reputation: 69893

How do you install Boost on MacOS?

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

Upvotes: 218

Views: 279867

Answers (11)

Neo li
Neo li

Reputation: 388

If you are too lazy like me: conda install -c conda-forge boost

Upvotes: 2

jrwren
jrwren

Reputation: 17928

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

brew install boost.

Upvotes: 344

UDAY JAIN
UDAY JAIN

Reputation: 51

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

  /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

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

Upvotes: 5

snies
snies

Reputation: 3521

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 https://www.boost.org/users/download/#live
  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:

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

Upvotes: 125

Jacksonkr
Jacksonkr

Reputation: 32247

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

OR

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

Upvotes: 4

dies
dies

Reputation: 1694

Download MacPorts, and run the following command:

sudo port install boost 

Upvotes: 163

Kondal Rao
Kondal Rao

Reputation: 151

Install both of them using homebrew separately.

brew install boost
brew install bjam

Upvotes: 7

user1823890
user1823890

Reputation: 744

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

sudo port install boost +universal

Upvotes: 4

Paul Kohut
Paul Kohut

Reputation:

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.

Upvotes: 6

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.

Upvotes: 5

Ferruccio
Ferruccio

Reputation: 100718

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

Upvotes: 3

Related Questions