Boost logo

Boost-Build :

From: eh-boost.build_at_[hidden]
Date: 2007-11-12 19:02:58


I have been having enormous difficulty with what I had thought to be simple
problem. I'm maintaining build testing for a number of environments on a
single machine, and I need to keep multiple copies of Boost libraries all
separated out into their own sandboxes. Here are my requirements:
         (1) Boost source tree needs to be treated as read-only. No files
altered or added in that tree. This is primarily a version-control criterion.
         (2) Invocation of bjam in an environment-specific directory
without any necessity of command-line parameters or shell-scripts or batch
files or setting environment variables. This is the criterion for
use-right-out-of-the-box.

As a user, I really don't care about Boost Jam. I don't plan on using it
except to compile Boost. I don't plan on using for anything else. I want
to learn as little as possible about it. I have spent many hours on the
documentation, all but the first of which I consider too many. There's no
tutorial for what I want to do, which is slightly more complicated that the
"getting started" pages and far less that the entirety of the system.

I'm on Windows XP. I've had no problem compiling for the default (MSVC),
nor for the standard toolset gcc. I have the following combinations to
worry about:
         -- msvc
         -- cygwin gcc
         -- cygwin gcc cross-compiling for mingw (incidentally, bjam
--toolset=gcc-nocygwin does not work at all; it omits the -mno-cygwin flag)
         -- mingw gcc 3
         -- mingw gcc 4
I'm maintaining software for other people, unknown to me, and these are my
platforms. So I need four different configurations of gcc, which means use
site-config and user-config are out (unless there's some syntax I haven't
been able to puzzle out.

Directory layout:
         -- Boost
                 -- source-1.34.1 (this contains the
unpacked-without-modification source distribution)
                 -- build-1.34.1
                         -- gcc3-cygwin-for-mingw
                         [etc.]

The contents of Boost/build-1.34.1/gcc3-cygwin-for-mingw/project-root.jam
is as follows:
>project /my-boost
> : source-location ../../source-1.34.1
> : build-dir my-boost-bin
> : requirements
> <toolset>gcc
> ;
>
>build-project /my-boost ;

Here are the contents of boost-build.jam (it's in the parent directory):
>boost-build ../source-1.34.1/tools/build/v2 ;

Here's a sample run. I'm using the pre-compiled bjam.
>$ bjam --debug-configuration
>Unable to load Boost.Build: could not find "boost-build.jam"
>---------------------------------------------------------------
>Attempted search from C:\WINDOWS\system32 up to the root
>
>Please consult the documentation at 'http://www.boost.org'.

OK. That's clearly a defect, since if I nuke the project-root.jam file, it
finds boost-build.jam just fine. So I set BOOST_BUILD_PATH
explicitly. Now I get the following output:
>notice: found boost-build.jam at
>c:\Development\Boost\source-1.34.1\boost-build.jam
>notice: loading Boost.Build from
>c:\Development\Boost\source-1.34.1\tools\build\v2
>notice: searching "C:\Documents and Settings\Eric" "c:\Documents and
>Settings\Eric" "C:\Documents and Settings\Eric"
>"c:\Development\Boost\source-1.34.1\"
>"c:\Development\Boost\source-1.34.1\tools/build/v2"
>"c:/Development/Boost/source-1.34.1/tools/build/v2/kernel"
>"c:/Development/Boost/source-1.34.1/tools/build/v2/util"
>"c:/Development/Boost/source-1.34.1/tools/build/v2/build"
>"c:/Development/Boost/source-1.34.1/tools/build/v2/tools"
>"c:/Development/Boost/source-1.34.1/tools/build/v2/new"
>"c:/Development/Boost/source-1.34.1/tools/build/v2/." for "site-config.jam"
>notice: loading site-config.jam from
>c:\Development\Boost\source-1.34.1\tools\build\v2\site-config.jam
>notice: searching "C:\Documents and Settings\Eric" "c:\Documents and
>Settings\Eric" "C:\Documents and Settings\Eric"
>"c:\Development\Boost\source-1.34.1\"
>"c:\Development\Boost\source-1.34.1\tools/build/v2"
>"c:/Development/Boost/source-1.34.1/tools/build/v2/kernel"
>"c:/Development/Boost/source-1.34.1/tools/build/v2/util"
>"c:/Development/Boost/source-1.34.1/tools/build/v2/build"
>"c:/Development/Boost/source-1.34.1/tools/build/v2/tools"
>"c:/Development/Boost/source-1.34.1/tools/build/v2/new"
>"c:/Development/Boost/source-1.34.1/tools/build/v2/." for "user-config.jam"
>notice: loading user-config.jam from
>c:\Development\Boost\source-1.34.1\tools\build\v2\user-config.jam
>warning: No toolsets are configured.
>warning: Configuring default toolset "msvc".
>warning: If the default is wrong, you may not be able to build C++ programs.
>warning: Use the "--toolset=xxxxx" option to override our guess.
>warning: For more configuration options, please consult
>warning:
>http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html
>notice: msvc-8.0express detected, command: 'C:\Program Files\Microsoft
>Visual Studio 8\VC\bin\cl.exe'
>msvc: condition:
>'<toolset>msvc-8.0express/<architecture>/<address-model>', msvc:
>condition:
>'<toolset>msvc-8.0express/<architecture>/<address-model>32', msvc:
>condition:
>'<toolset>msvc-8.0express/<architecture>x86/<address-model>', msvc:
>condition:
>'<toolset>msvc-8.0express/<architecture>x86/<address-model>32', command:
>'call "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86 >nul
>'
>msvc: condition:
>'<toolset>msvc-8.0express/<architecture>/<address-model>64', msvc:
>condition:
>'<toolset>msvc-8.0express/<architecture>x86/<address-model>64', command:
>'call "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat"
>x86_amd64 >nul
>'
>msvc: condition:
>'<toolset>msvc-8.0express/<architecture>ia64/<address-model>', msvc:
>condition:
>'<toolset>msvc-8.0express/<architecture>ia64/<address-model>64', command:
>'call "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat"
>x86_iPF >nul
>'
>error: no Jamfile in current directory found, and no target references
>specified.

Oh, the things wrong with this picture:
1-- It's searching the home directory three times. That can't be a good sign.
2-- It's finding toolset msvc, when I thought I had configured the project
to use gcc.
3-- I have no clue what the "current directory" is where it's looking for a
Jamfile, because it didn't tell me. (Perhaps it's C:\WINDOWS\system32 again.)
4-- Insofar as I can tell, it never gets even to the point of creating the
build directory.

It gets worse. Just prior to writing this message, I was getting two
searches for site-config and user-config, it was finding the first and
choking on the second (with the same message "unable to load
Boost.Build"). I can't even replicate that behavior, even though I've
reverted everything (albeit manually).

So, in essence, my question is this: How do pass parameters to a
pre-existing project, particularly its toolset, and use an entire source
tree without modifying it? Secondly, how do I build just that project and
nothing else, preferably not even some phantom target?

Eric


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk