Boost logo

Boost-Build :

From: Jurko Gospodnetiæ (jurko_for_boost_at_[hidden])
Date: 2007-05-21 13:02:39


   Hi.

   I believe there is a problem with how Boost.Build detects the default
msvc toolset.

   If you do not specify the default toolset explicitly then it does its
magic in the msvc.jam toolset file and detects the correct version but
does it too late. By then target definitions using conditional features
based on the current toolset feature value have already been processed
and at that time the current toolset feature has not yet been set.

   One effect this has is that Boost library build fails on our machines
if we do not specify the msvc-7.1 toolset explicitly (those machines
have only msvc-7.1 installed on them). In that case the boost_graph
library target (defined in libs/graph/build/Jamfile.v2) does not get its
additional '-GR-' compiler command-line parameter defined and without
that parameter (disables RTTI) MSVC crashes when compiling this file.

   When we added some debugging ECHO statements in related boost build
scripts and the aforementioned Jamfile we got the following test
results. All tests have been started in the top level Boost library
folder and attempt to build the boost_graph library.

--- Test 1. --- (toolset specified explicitly)

---
command:
---
bjam -q stage --stagedir=. --toolset=msvc-7.1 libs/graph/build//boost_graph
---
output:
---
DEBUGGING --- requested version: --- 7.1 / ---
DEBUGGING --- selected version after alias processing: --- 7.1 / ---
DEBUGGING --- options: --- <command>D:\Program Files\Microsoft Visual 
Studio .NET 2003\Vc7\bin\cl.exe ---
DEBUGGING --- command1: --- D:\Program Files\Microsoft Visual Studio 
.NET 2003\Vc7\bin\cl.exe ---
DEBUGGING --- command2: --- D:\Program Files\Microsoft Visual Studio 
.NET 2003\Vc7\bin\cl.exe ---
DEBUGGING --- defining the boost_graph library target.
WARNING: No python installation configured and autoconfiguration
          failed.  See http://www.boost.org/libs/python/doc/building.html
          for configuration instructions or pass --without-python to
          suppress this message and silently skip all Boost.Python targets
warning: Python location is not configured
warning: the Boost.Python library won't be built
Building Boost.Regex with the optional Unicode/ICU support disabled.
Please refer to the Boost.Regex documentation for more information
(don't panic: this is a strictly optional feature).
--- Test 2. --- (toolset not specified explicitly)
---
command:
---
bjam -q stage --stagedir=. libs/graph/build//boost_graph
---
output:
---
DEBUGGING --- defining the boost_graph library target.
WARNING: No python installation configured and autoconfiguration
          failed.  See http://www.boost.org/libs/python/doc/building.html
          for configuration instructions or pass --without-python to
          suppress this message and silently skip all Boost.Python targets
warning: Python location is not configured
warning: the Boost.Python library won't be built
Building Boost.Regex with the optional Unicode/ICU support disabled.
Please refer to the Boost.Regex documentation for more information
(don't panic: this is a strictly optional feature).
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
DEBUGGING --- requested version: --- / ---
DEBUGGING --- all detected versions: --- 7.1 ---
DEBUGGING --- selected version: --- 7.1 / ---
DEBUGGING --- selected version after alias processing: --- 7.1 / ---
DEBUGGING --- options: --- <command>D:\Program Files\Microsoft Visual 
Studio .NET 2003\Vc7\bin\cl.exe ---
DEBUGGING --- command1: --- D:\Program Files\Microsoft Visual Studio 
.NET 2003\Vc7\bin\cl.exe ---
DEBUGGING --- command2: --- D:\Program Files\Microsoft Visual Studio 
.NET 2003\Vc7\bin\cl.exe ---
--------------------------------------------------------------
   As you can see from the 'DEBUGGING' messages, the target gets
defined before the default toolset has been deduced. It does get
deduced correctly but a bit too late.
   If you go on and check the generated build commands in these two
cases you'll see that the build commands for compiling the 
"libs\graph\src\read_graphviz_spirit.cpp" file differ.
   Unfortunately, I do not have enough knowledge about Boost.Build to 
track this one down in its internals... but I know that this did not
happen with the 1.33.0 Boost library release.
   Hope this gets cleared up...
   Best regards,
     Jurko Gospodnetiæ

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