Homebrew: how to install boost with a specific version
Created at 2018-02-06 Updated at 2018-02-06 Category Homebrew
Since boost 1.58 and boost-python 1.58 are not available in the newest homebrew, one way to install them using homebrew is to downgrade the formula–editing the formula file so that you can install boost 1.58 and boost-python via homebrew. See this page: https://stackoverflow.com/questions/3939651/how-to-modify-a-homebrew-formula
The newest boost formula file is here: https://github.com/Homebrew/homebrew-core/blob/master/Formula/boost.rb, and you can also find boost-python formula file.
So, how can we edit the formula of boost and boost-python? Just use
edit option in brew command,
Note that all the sha256 values and the corresponding URLs should be right. And if you tried to install boost from source, you should remove boost first, see this page: https://askubuntu.com/questions/325504/ubuntu-12-04-uninstall-boost-installed-from-source
Edit boost formula
change the code
also, edit boost-python formula
And then install boost and boost-python without specifying version
Just wait for about 30 minutes to install these libraries.