Boost logo

Boost-Build :

From: Michael Stevens (Michael.Stevens_at_[hidden])
Date: 2004-06-09 03:18:23


Hi Volodya,

Thanks for raising this again. I've tried to put all I know about this problem
an my own take on the solution.

> I'd like to finally settle the question that Michael raised some time ago.
> Briefly, given
>
> using gcc ;
> using gcc : 3.3 : g++-3.3 ;
>
> it is not clear if default-configured gcc is the same as gcc 3.3, or not.
> This might cause a problem for user, since he can build the project twice
> without need, and it causes some complexity for toolsets.
Actually the problem is slightly worse given the existing 'optional'
definition of the version parameter for the gcc toolset. If we have only one
gcc toolset definition in the configuration thus:
using gcc : 3.3 : g++-3.3 ;
It can be built as expected as either 'gcc' or 'gcc-3.3'. Unexpectedly however
this results in building of two separate build targets (in two separate
directories) as you noted above.

>
> Here's what I propose: each "configuration parameter" of toolset should be
> either specified on all calls of the "using" rule, or omitted in all the
> calls. The rationale is: first time user can invoke "using gcc ; " and it
> will work. Advanced user, who wants to configure several version, probably
> knows the version number of default "gcc" as well, so it's no problem for
> him.
Agreed "using gcc ;" is nice for new users. I think it is logical that it
defines the default tool name on the default path with default options.
>
> I plan to introduce auxilliary funciton to call for this rule
> automatically, but that's implementation issue.

I was hoping there was a simpler solution to this problem that I had been
experimenting with. As with the new intel linux toolset the prerequisite is
that the version parameter be mandatory. If we have the following
configutation
using intel : 8.0 ;
then we can build the actual target named 'intel-linux-8.0' interchangeably by
invoking an of the four targets 'intel-linux-8.0', 'intel-8.0',
'intel-linux', or 'intel'.
This is very nice!

At the moment this new method has two problems.

Firstly 'using gcc ;' would be an error as the version parameter has not been
specified. My solution to this was to make the 'using' rule fill in the
version parameter with a default where it is not specified. That is
gcc.init( "default" ) would be invoked in this case.
This has one draw back. The build target (and therefore the paths generated)
will be called 'gcc-default', this may or may not be confusing for a new
user. This could be improved by either
a) thinking of a better name instead of "default"
b) using "" for the default case an surpessing the trailing '-' in the target
path. This seems overly complex to me however and may result in confusion
later!

The second problem is that the version parameter is currently not checked for
uniqueness. Therefore if we configure
using intel : 8.0 : 'namea' : 'compilea' ;
using intel : 8.0 : 'nameb' : 'compileb' ;

no error is detected. Building 'intel' results in a command line with all
parameters concatenated! I have not developed any solution to this but it
would be nice if it was handled by the 'using' rule automatically.

With this definition of version
using gcc ;
using gcc : 3.3 : g++-3.3 ;
can be invoked as
'gcc', 'gcc-default', or 'gcc-3.3'
with the first to building the 'gcc-default' target and the last the 'gcc-3.3'
which seems nicely logical.

Conversly
using gcc : 3.3 : g++-3.3 ;
using gcc ;
would also work but invoking 'gcc' would build the first named target which is
'gcc-3.3'. This does not seem to bad.

I hope all this makes sense

Michael

 


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