Boost logo

Boost-Build :

From: Andrey Melnikov (melnikov_at_[hidden])
Date: 2005-06-28 12:20:53


Hi all,

Due to poor support for Amd x64 in VS2003, due to lack of VS2005
Standard on my desktop and due to lack of Perforce SCC plugin for VS2005
I decided to try bb with VS2003.

Here's a long story about what I did to get it running. I hope it will
help bb to become better documented and easier to use

Also I have a question:

How can I set the location for bin directory? I'd like to have single
bin/ for for all my subprojects:

bin
src
coreapp
lib1
tests

Now I have:

src
coreapp
bin
lib1
bin
tests
bin

Can I achieve this? Also I don't want project-specific jamfiles outside
of src.

Kind regards,
Andrey

BIG STORY

I found that bbv2 doesn't have amd64 toolset too, and there's no good
gocumentation on how to create a new toolset. Since the only things I
needed to change were to replace vsvars32 with setenv.cmd (at least I
thought so :) I ended with spending 2 nights trying to find how msvc.jam
works. Finally, I patched a copy of msvc.jam to get x64.jam.

Since I'd like to compile both x86 and Amd x64 versions from a single
source, I looked for a way to specify bb toolset using command line, but
didn't find anything and just did that myself in my Jamfile:

using [ modules.peek : TOOLS ] ;
exe hello : hello.cpp ;

There was still a lot of things to do like replacing hard-coded values
with autodetection, error handling, support for different versions of
VisualStudio with different configurations of Platform SDK etc, but at
least I could compile my helloworld project.

Then I created a Visual Studio solution with makefile project. It was
nice that I didn't need dummy makefiles and VS allowed just to specify
bjam -sTOOLS=x64 release right in the project.

But I needed to specify command line for rebuilding. I already knew how
to clean with bjam from my experience with building Boost with bbv1, so
I added 2 lines

bjam --clean
bjam -sTOOLS=x64 release

Later digging in bjam commandline help (which isn't present in main
documentation tree, is it?) I found a better single-command solution:

bjam -sTOOLS=x64 release -a

I still wonder if it really does the thing I expect, but with this
helloworld project it looks fine.

At last I got it working from vs2003:

------ Build started: Project: makefile, Configuration: Amd x64
Optimized Win32 ------

Performing Makefile project actions
...found 11 targets...
...updating 7 targets...
MkDir1 bin
MkDir1 bin\x64
MkDir1 bin\x64\release
x64.compile.c++ bin\x64\release\hello.obj
hello.cpp
x64.link bin\x64\release\hello.exe
...updated 7 targets...

makefile - 0 error(s), 0 warning(s)

---------------------- Done ----------------------

Build: 1 succeeded, 0 failed, 0 skipped

What's this?

...found 11 targets...
...updating 7 targets...

Why it found 11 targets but doesn't update 4 of them? I didn't have
anything already built, and according to the documentation I specified
only a single target in my Jamfile. If this message isn't descriptive
even in case of simplest projects, why does bb has it in default debug
level?

Other messages like

MkDir1 bin
MkDir1 bin\x64
MkDir1 bin\x64\release
x64.compile.c++ bin\x64\release\hello.obj

don't look confusing, but the need for them in default debug level is
doubtful.

Personally, I think that the messages I get with -d0 are enough:

------ Build started: Project: makefile, Configuration: Amd x64
Optimized Win32 ------

Performing Makefile project actions
hello.cpp

makefile - 0 error(s), 1 warning(s)

---------------------- Done ----------------------

Build: 1 succeeded, 0 failed, 0 skipped

So I'd like to have 0 as default verbosity level.

If I get compiler warning/error, visual studio parses it correctly and
adds a clickable item to Task List. If I'm going to track down problems
with bb, Visual Studio doesn't help me:

Performing Makefile project actions
Jamfile:3: in modules.load
rule xexe unknown in module Jamfile</d:/Home/mini/makefile/src>.
d:/Home/libsrc/boost-build/build\project.jam:306: in load-jamfile
d:/Home/libsrc/boost-build/build\project.jam:68: in load
d:/Home/libsrc/boost-build/build\project.jam:164: in project.find
d:/Home/libsrc/boost-build\build-system.jam:125: in load
d:\Home\libsrc\boost-build\kernel\modules.jam:259: in import
d:\Home\libsrc\boost-build\kernel\bootstrap.jam:153: in boost-build
d:\Home\mini\makefile\boost-build.jam:1: in module scope
Project : error PRJ0019: A tool returned an error code from "Performing
Makefile project actions"

Error doesn't appear in Task pane, and despite I can click on filename
in Output window, line number isn't recognized and I'm always going to
the beginning of the file.

I think bjam/boost.build need to support error output in formats of
different compilers just like CppUnit CompilerOutputter class does.

Here's an example of desired error output. I emulated it with ECHO
rules. VS recognizes filenames and line numbers in this format, and I
can navigate through errors in task pane, and if I need error details, I
can use "show tooltip" command or go to Output window and click
filenames from detailed message info.

d:/Home/mini/makefile/src/Jamfile(3) : error : rule zexe unknown in
module Jamfile</d:/Home/mini/makefile/src>.
[
d:/Home/libsrc/boost-build/build/project.jam(306) : in
load-jamfile
d:/Home/libsrc/boost-build/build/project.jam(68) : in load
]

To be continued... Maybe.. :)

 


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