3

I'm trying to build the boost libraries as part of an open-source project I want to try to work on.

C:\boost_1_55_0>bootstrap.bat gcc
Building Boost.Build engine

Bootstrapping is done. To build, run:

    .\b2

[snip]

C:\boost_1_55_0>b2.exe --toolset=gcc
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.

Attempted search from C:\boost_1_55_0 up to the root
at C:/share/boost-build
and in these directories from BOOST_BUILD_PATH and BOOST_ROOT: c:/boost_1_55_0.
Please consult the documentation at 'http://www.boost.org'.

C:\boost_1_55_0>dir *.jam
 [snip]

 Directory of C:\boost_1_55_0

09/21/2013  01:17 PM               866 boost-build.jam
09/21/2013  01:17 PM            18,083 boostcpp.jam
12/16/2013  03:36 PM                76 project-config.jam
               3 File(s)         19,025 bytes
               0 Dir(s)  34,868,432,896 bytes free

Toolset is MinGW/gcc, which is properly on my %PATH%.

So basically, somehow, boost isn't seeing the boost-build.jam file that's in the current directory.

Note that I have properly set BOOST_ROOT:

C:\boost_1_55_0>echo %BOOST_ROOT%
c:/boost_1_55_0

I'm kinda at my wit's end here. I've tried different permutations of back and forward slashes. Also, the error message from b2 includes the path C:/share/boost-build, which I have no idea where it's coming from. I've done a full search on the entire codebase, and can't see a config file which may be specifying it anywhere.


So I may need Boost.Build?

Anyways, following the instructions from here to build Boost.Build produces the exact same issue:

C:\boost_1_55_0\tools\build\v2>echo %BOOST_ROOT%
C:/boost_1_55_0

C:\boost_1_55_0\tools\build\v2>bootstrap.bat gcc
Bootstrapping the build engine

Bootstrapping is done. To build, run:

    .\b2 --prefix=DIR install


C:\boost_1_55_0\tools\build\v2>b2 --toolset=gcc --prefix=c:/pathutils install
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.

Attempted search from C:\boost_1_55_0\tools\build\v2 up to the root
at C:/boost_1_55_0/tools/build/share/boost-build
and in these directories from BOOST_BUILD_PATH and BOOST_ROOT: C:\boost_1_55_0\tools\build\v2\test\startup\boost-root\build, C:/boost_1_55_0.
Please consult the documentation at 'http://www.boost.org'.
mloskot
  • 37,086
  • 11
  • 109
  • 136
Fake Name
  • 5,556
  • 5
  • 44
  • 66

4 Answers4

1

It's not looking for your Jamfile. It's looking for the boost.build tools subdirectory, the one which contains supporting jam scripts. On linux this will be a "/usr/share/boost-build/" by default, on windows you probably need to set BOOST_BUILD_PATH to point at where boost.build supporting scripts are installed:

http://www.boost.org/doc/libs/1_55_0/doc/html/bbv2/reference.html

oakad
  • 6,945
  • 1
  • 22
  • 31
  • Nope. I set `BOOST_BUILD_PATH`, and it didn't help. Also, the boost-build.jam file with the relevant jam scripts is in the root folder (the `pwd` of my shell). Lastly, from what I can tell reading the boost docs, `BOOST_BUILD_PATH` is *mostly* optional. – Fake Name Dec 17 '13 at 03:31
  • Most confusing is that, from what I can tell, the same procedure I'm using works without issue for some other people. – Fake Name Dec 17 '13 at 03:32
  • 1
    Basically, AFICT, you unzip the boost libraries, run `bootstrap.bat`, *sometimes* set `BOOST_ROOT`, and everything is **supposed** to work. – Fake Name Dec 17 '13 at 03:35
  • It's optional in the sense that there's a built-in default (in your case the default appears to be "c:/share/boost-build"). You also must not mix the boost-built jam file hierarchy and your (boost) project hierarchy (if my memory serves me correctly, it is desirable to first fully install the boost.build somewhere, than build the rest of the boost). – oakad Dec 17 '13 at 03:36
  • I'm answering the question from the boost.build standpoint (of which I'm the frequent user). I have no idea what boost source package on windows is expected to do (never tried it myself). – oakad Dec 17 '13 at 03:37
  • I don't have a boost project per-se. I'm just trying to make the pure, *boost-only* files do anything (build the libraries). I haven't even got to the point of checking out the project I actually want to work with. – Fake Name Dec 17 '13 at 03:40
  • Basically I downloaded the zip file containing sources from here: http://sourceforge.net/projects/boost/files/boost/1.55.0/ , Unzipped it to `C:\boost_1_55_0`, `cd`ed to said directory, `bootstrap.bat gcc`, `b2.exe --toolset=gcc`, and it fails. If there is something else I'm supposed to do, I'm all ears, but the documentation is enormous, and there is no decent "if you just want to use the libraries, do this" instructions I can find. – Fake Name Dec 17 '13 at 03:44
  • Looking at answers like: http://stackoverflow.com/a/2655683/268006, they don't even *mention* having to set env vars to get boost to build (just afterwards so *other* projects can find the boost libraries), so I have no idea what's going on. – Fake Name Dec 17 '13 at 03:48
  • http://www.boost.org/doc/libs/1_55_0/more/getting_started/windows.html - it sort of follows from this page that boost.build needs to be properly and separately installed, unless you're using bootstrap.bat to build with msvc. – oakad Dec 17 '13 at 03:51
  • Wait, what? I don't see that at all? I'll give it a shot, but huh. – Fake Name Dec 17 '13 at 03:54
  • Section 5.2.1, really. Do you always expect other people to do your homework for you? – oakad Dec 17 '13 at 03:55
  • Aaaaaand trying to bootstrap Boost.Build fails on `b2.exe` with *exactly* the same error. – Fake Name Dec 17 '13 at 04:01
1

Well, I can only assume that something in the %PATH% of my computer is breaking boost somehow.

I did the same setup procedure in a clean VM, and it seems to be compiling fine.

I have no idea what specifically is wrong.

Fake Name
  • 5,556
  • 5
  • 44
  • 66
0

This looks like a pretty old question but, in case it helps anyone, I had the same issue and it was caused because I was in the /boost directory but needed to be in /boost/boost. When I changed directory to the subdirectory and ran ./bootstrap followed by ./b2 headers, it worked fine.

Slightly confusing that ./bootstrap had worked when I was in the /boost directory but there you go.

Anders
  • 115
  • 11
0

Binary builds of boost do not work at all, and attempting to build is futile.

5.1 Simplified Build From Source

If you wish to build from source with Visual C++, you can use a simple build procedure described in this section. Open the command prompt and change your current directory to the Boost root directory. Then, type the following commands:

bootstrap .\b2

This does not work due to the error in the original question.

5.2.1 Install Boost.Build

Boost.Build is a text-based system for developing, testing, and installing software. First, you'll need to build and install it. To do this:

Go to the directory tools\build\v2\.
Run bootstrap.bat
Run b2 install --prefix=PREFIX where PREFIX is the directory where you want Boost.Build to be installed
Add PREFIX\bin to your PATH environment variable.

This too does not work due to the error below:

Unable to load B2: could not find 'boost-build.jam'
---------------------------------------------------
Attempted search from 'C:sources\boost_1_75_0\tools\build' up to the root at 'C:sources\boost_1_75_0\tools\build\b2.EXE'
Please consult the documentation at 'https://boostorg.github.io/build/'.

The address in the error above says nothing whatsoever about how to use B2.

The design must be genius, but until something figures out that using the existing file in the same directory as b2.exe should be considered as a safe default, we, lowly devs, are SOL.

Jehedi Zafoom
  • 61
  • 2
  • 4