Boost logo

Boost-Build :

Subject: [Boost-build] toolset and --toolset and --ignore-config
From: Raffi Enficiaud (raffi.enficiaud_at_[hidden])
Date: 2010-07-06 05:22:37


(message re-posted)

Hello all,

I am interested in building boost without taking into account
any other previous installation of Boost. Plus, I do not want
to edit any configuration file coming with a particular release
of Boost, in order to make things easily reproducible.

On Linux, I use the --ignore-config option on the command line.
In fact, I encountered some "troubleshooting" on Ubuntu where
a previous version of Boost was installed with the package
manager. So, I really like this option, or in other words,
I really like the fact that I am building something
without the intrusion of any configuration file external
to the source tree.

My problem now is about the toolset and --toolset options on
Windows, together with the --ignore-option.
I have several flavors of Visual (2005, 2008Express and now
2010Express). The ignore-config option is making things tricky
on Windows.

First of all, I start a batch for each of the flavour of
Visual, that correctly defines the compiler and PATH settings
(these batches come with the Visual themselves). So I was
expecting that the default would have been the correct use
in regards to then environment settings. But when I start
a batch for Visual 2008, it systematically takes Visual 2010
as the default (maybe the most recent version ?).

So I tried to use the toolset option. First of all, I was not
aware of any difference between "toolset" and "--toolset".
so I went a bit into build-system.jam. Although I do not
understand anything to the syntax (sorry), the lines
559 to 562 tell me that no toolset or --toolset option
will be processed if "--ignore-config" is set.

The command line I use is:

F:\External Dependencies\boost_1_43_0>bjam.exe
  --prefix="f:\External Dependencies"
  --build-type=complete --layout=versioned
  -q
  toolset=msvc-9.0express install
  --debug-configuration

First it configures the MSVC 2010 (I do not know exactly why),
but then it configures correctly MSVC 2008 plus the build
is made against MSVC 2008. I was a bit disturbed by the fact
that the environment variables are set for MSVC 2008, and so
cl.exe gives the version number of MSVC 2008.
Without the toolset option, MSVC 2010 is used, even under
the environment of MSVC 2008.

The --ignore-config totally disables the command line options
(line 559 of build-system.jam), but I do not really understand
why and the behaviour is not the same as under Linux.

F:\External Dependencies\boost_1_43_0>bjam.exe
  --prefix="f:\External Dependencies"
  --build-type=complete
  --layout=versioned
  -q
  toolset=msvc-9.0express
  --ignore-config
  install
  --debug-configuration
  
gives me this error:
[...]/tools/build/v2/build\feature.jam:307: in implied-subfeature
  from module feature
error: "9.0express" is not a known subfeature value of <toolset>msvc
[...]/tools/build/v2/build\feature.jam:491: in validate-value-string
from module feature

while ("--toolset"):
F:\External Dependencies\boost_1_43_0>bjam.exe
  --prefix="f:\External Dependencies"
  --build-type=complete
  --layout=versioned
  -q
  --toolset=msvc-9.0express
  --ignore-config
  install
  --debug-configuration

gives me this:
notice: [msvc-cfg] msvc-10.0 detected,
  command: 'C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\cl.exe'
notice: [msvc-cfg] msvc-10.0express detected,
  command: 'C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\cl.exe'
notice: [msvc-cfg] msvc-9.0express detected,
  command: 'C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\cl.exe'
notice: will use 'C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\cl.exe'
  for msvc, condition <toolset>msvc-10.0

+ compiles using MSVC 2010 (under MSVC 2008 environment).

So I was wondering what is exactly the policy for these options, and
their correspondance with Linux.
- The --ignore-config is a valuable anti-aliasing option with other
  versions
- Under Linux, there is no need to specify the toolset since it
  uses the environment, while under Windows the most recent version
  of MSVC is used and the toolset option is disabled.

Should we definitely avoid using --ignore-config on Windows, or should
we activate the tooset option together with --ignore-config, or should
we use the compiler set in the environment ?

Any idea ?

Regards,
Raffi Enficiaud


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