1

Right now, I am trying to install boost on my computer, a Mac running Mavericks. I have downloaded and decompressed boost into the directory

$HOME/local/src/

After decompressing, I moved it to a new directory inside the boost source directory:

tools/build/v2

I then executed

./boostrap.sh --with-toolset=gcc

This all went fine. The next step is where the problems start: in the src file, I executed the following command:

tools/build/v2/boost_1_57_0/b2 install --prefix=PREFIX --toolset=gcc --with-program_options --with-filesystem

It then returned the following error:

Unable to load Boost.Build: could not find "boost-build.jam"

---------------------------------------------------------------
BOOST_ROOT must be set, either in the environment, or 
on the command-line with -sBOOST_ROOT=..., to the root
of the boost installation.

It says it can't find boost-build.jam, but I open up the folder in Finder and I see boost-build.jam right there in my boost_1_57_0 folder. What can I do to execute this command? Am I doing something wrong? If it runs correctly, I should have a PREFIX/include directory with header files for boost. What can I do to get this? Here is a link to the site for Boost if that will help:

http://www.boost.org

Also, I have already found this page on how to install Boost:

How do you install Boost on MacOS?

Will the method this user describes give the same result that the code above would if it was functioning properly? Thank you in advance.

Community
  • 1
  • 1
Joshuah Heath
  • 663
  • 1
  • 5
  • 20

2 Answers2

2

Install brew:

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

Then do:

brew install boost-build

After that you will have the bjam executable in /usr/local/bin/bjam.

elyase
  • 39,479
  • 12
  • 112
  • 119
  • in what folder should I install boost-build--src, v2, or boost_1_57_0? – Joshuah Heath Jan 03 '15 at 03:42
  • brew will place it under `/usr/local/Cellar/boost-build/` – elyase Jan 03 '15 at 03:44
  • Okay--I did that with brew, but I am still a little confused . Was the boost-build with brew supposed to replace my non-functioning code I wrote above, or was it supposed to make the code I wrote above work? I ran tools/build/v2/boost_1_57_0/b2 install --prefix=PREFIX --toolset=gcc --with-program_options --with-filesystem again, and it gives me the same error (sorry--I'm new to Mac. My last two computers were Dells). – Joshuah Heath Jan 03 '15 at 03:48
  • The brew installation is supposed to replace your code, you don't need to manually download or compile from source, brew does it for you. – elyase Jan 03 '15 at 03:58
0

Thank you to elyase for his response. I have also found a way to solve the problem posted above that doesn't use brew. I was making the mistake of making a new tools/build/v2 folder in my src folder--however, I was supposed to cd into the tools/build folder already in the downloaded boost folder. Also, in the newer versions of boost, there is no v2 folder--so just use

tools/build/b2 install --prefix=PREFIX --toolset=gcc --with-program_options --with-filesystem

Hopefully this will help people who are new to Mac (like me) who are having similar problems.

Joshuah Heath
  • 663
  • 1
  • 5
  • 20