Re: Regenerating msvc-setup.bat

Edward Diener via Boost-build <[email protected]> Sun, 14 Jul 2019 20:35:46 -0400
Newsgroups gmane.comp.lib.boost.build
Message-ID <[email protected]>
On 7/14/2019 6:10 PM, Steven Watanabe via Boost-build wrote:
> AMDG
> 
> On 7/14/19 3:16 AM, Edward Diener via Boost-build wrote:
>> <snip> I am pretty sure that having a single msvc-setup.bat for
>> all versions of Intel C++ on Windows and vc++ compatibility for any
>> given version can not be correct design, <snip>
>>
> 
> 
> You're correct.  The issue is here:
> https://github.com/boostorg/build/blob/develop/src/tools/msvc.jam#L1101
> 
> This ignores the version of intel, because it's hard-coded for msvc.

I do not understand all that 'set-setup-command' code but I do 
understand your point about the particular line.

I have discovered that I can force the msvc-setup.bat for intel-win to 
be regenerated for each b2 invocation when specifying an intel toolset with:

toolset.flags intel-win .REWRITE-SETUP $(cpu-conditions) : true ;

added to the logic in intel-win just before

toolset.flags intel-win .SETUP-SCRIPT $(cpu-conditions) : $(setup) ;
toolset.flags intel-win .SETUP-OPTIONS $(cpu-conditions) : "$(c) 
$(iclvars_vs_arg)" ;

in the intel_win.configure-really code. I have coded the above solution 
using the '<rewrite-setup-scripts>always' option to indicate that 
msvc-setup.bat should be regenerated. So the logic above is really:

if $(rewrite-setupscript) = always
{
     toolset.flags intel-win .REWRITE-SETUP $(cpu-conditions) : true ;
}
toolset.flags intel-win .SETUP-SCRIPT $(cpu-conditions) : $(setup) ;
toolset.flags intel-win .SETUP-OPTIONS $(cpu-conditions) : "$(c) 
$(iclvars_vs_arg)" ;
This allows me to test different versions of Intel C++ on Windows, each 
having a compatibility with different versions of vc++ by specifying the 
'<rewrite-setup-scripts>always' option in each toolset definition. In 
the current Boost Build intel-win code the msvc-setup.bat once generated 
is never replaced. Of course even my temporary fix will not solve the 
problem of running b2 with different Intel Window toolsets at the "same 
time" because the single msvc-setup.bat will be overwritten by each 
intel toolset used. The real culprit is that the single msvc-setup.bat 
for all versions of Intel C++ for Windows and all possible vc++ 
compatibilities for each version is inadequate.

The right solution is to have different msvc-setup.bat files for intel 
generated in subdirectories for each version of Intel C++ for Windows/ 
each vc++ compatibility. I just do not know how to tell the 
'set-setup-command' where to place the msvc-setup.bat. I do notice that 
for msvc there are separate subdirectories for each msvc-setup.bat, so 
evidently my solution seems somehow doable.

Did anybody even realize that the current change to provide our own 
setup scripts, combined with the single msvc-setup.bat location for the 
intel-win toolset, destroys the ability for end-users to use more than a 
single Intel C++ for Window implementation/vc++ compatibility with Boost 
Build as it currently exists ? Or was it actually known but just deemed 
too small a situation, given how few users probably use Intel C++ for 
Windows in the first place, to matter that much ? I am not trying to 
criticize anybody but I am just curious if anybody knew about this 
before I discovered it through attempting to test Intel C++ on Windows 
against some Boost libraries.

_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build