Reputation: 69893
How do you install Boost on MacOS? Right now I can't find bjam for the Mac.
Upvotes: 218
Views: 279867
Reputation: 17928
You can get the latest version of Boost by using Homebrew.
brew install boost
.
Upvotes: 344
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
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:
Unpack and go into the directory:
tar -xzf boost_1_50_0.tar.gz
cd boost_1_50_0
Configure (and build bjam
):
./bootstrap.sh --prefix=/some/dir/you/would/like/to/prefix
Build:
./b2
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
Reputation: 32247
+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
Reputation: 1694
Download MacPorts, and run the following command:
sudo port install boost
Upvotes: 163
Reputation: 151
Install both of them using homebrew separately.
brew install boost
brew install bjam
Upvotes: 7
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
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
Reputation: 101259
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