Boost logo

Boost :

Subject: Re: [boost] Building Boost 1.69 with Visual Studio 1.69
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2019-03-26 15:13:23


> -----Original Message-----
> From: Boost [mailto:boost-bounces_at_[hidden]] On Behalf Of Steven Watanabe via Boost
> Sent: 25 March 2019 18:59
> To: boost_at_[hidden]
> Cc: Steven Watanabe
> Subject: Re: [boost] Building Boost 1.69 with Visual Studio 1.69
>
> AMDG
>
> On 3/25/19 12:09 PM, Paul A. Bristow via Boost wrote:
> >
> > <snip>
> > using msvc
> > : # Version VS 2019 preview
> > 14.2
> > : # compiler location (Note that the file layout completely changed recently)
> > "C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.20.27508/bin/Hostx64/x64/cl.exe"
> > : # Options
> > <define>BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE # Needed if you are working on develop or master ahead of
> the latest release.
> > ;
>
> I recommend adding <setup>"C:/path/to/vcvarsall.bat"
> I don't know whether this will fix everything, but
> the immediate cause of the errors that you're seeing
> is that the location of vcvarsall.bat is version dependent
> and Boost.Build fails to find it.

Correct, as ever.

Sadly, hoping it would 'Just work', as others suggested with user-config.jam

using msvc : 14.1 ;
using msvc : 14.2 ;

didn't work for me. The log looked confused about both cl.exe and vsvarsall.bat.

(I did a --clean and --reconfigure first to make sure)

So, taking Steven's advice, I have now specified both compilers and both setups in my user-config.jam thus:

using msvc
  : # Version VS 2017
    14.1
  : # Compiler location
    "C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/Hostx64/x64/cl.exe"
  : # Options
   <setup>"C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Auxiliary/Build/vcvarsall.bat"
   <define>BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE # Needed if you are working on develop or master ahead of the latest release.
;

# Used, for example, thus
# b2 toolset=msvc-14.1

using msvc
  : # Version VS 2019 Preview
    14.2
  : # Compiler location
    "C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.20.27508/bin/Hostx64/x64/cl.exe"
  : # Options
    <setup>"C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Auxiliary/Build/vcvarsall.bat"
    <define>BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE # Needed if you are working on develop or master ahead of the latest release.
;

I:\boost\libs\hello_boost\example>b2 -a address-model=64 toolset=msvc-14.1,msvc-14.2 -d2 --debug-configuration > both_cl_setup.log

runs with two promising messages:

notice: will use
  'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\cl.exe'
  for msvc, condition <toolset>msvc-14.1

notice: will use
  'C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.20.27508/bin/Hostx64/x64/cl.exe'
  for msvc, condition <toolset>msvc-14.2

and two runs of vcvarsall.bat as expected.

 An extract from the log (zip attached) from this command is not quite as I would expect with a confusing/confused warning.

# notice: will use 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.20.27508/bin/Hostx64/x64/cl.exe'
for msvc, condition <toolset>msvc-14.2
# Used, for example, thus
# b2 toolset=msvc-14.2

notice: Loading user-config configuration file 'user-config.jam' from 'C:/Users/Paul'.
notice: [msvc-cfg] msvc-14.1 detected, command: 'C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\cl.exe'
warning: toolset msvc initialization:
warning: can not find user-provided command
  'C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/Hostx64/x64/cl.exe'
warning: initialized from C:\Users\Paul\user-config.jam:101

warning: Did not find command for MSVC toolset.
If you have Visual Studio 2017 installed you will need to specify the full path to the command,
set VS150COMNTOOLS for your installation, or build from the 'Visual Studio Command Prompt for VS 2017'.

notice: will use 'C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/Hostx64/x64/cl.exe'
for msvc, condition <toolset>msvc-14.1

These two cl.exe listed above are the same file:

  'C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/Hostx64/x64/cl.exe'
  'C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/Hostx64/x64/cl.exe'

but bjam uses the specified on just the same.

Automatically finding msvc cl.exe and specifying it colliding?

but both pass OK :-)

Hello Boost!
Platform: Win32
Compiler: Microsoft Visual C++ version 14.1
STL : Dinkumware standard library version 650
Boost : 1.70.0
_MSC_FULL_VER = 191627027

Hello Boost!
Platform: Win32
Compiler: Microsoft Visual C++ version 1920
STL : Dinkumware standard library version 650
Boost : 1.70.0
_MSC_FULL_VER = 192027508

which looks plausible.
_MSC_FULL_VER though it doesn't say 14.2 but 1920 instead.
No doubt this will change when the 'official' release is out in several days' time.

I'll try something more adventurous next ;-)

Thanks

Paul

---
Paul A. Bristow
Prizet Farmhouse
Kendal UK LA8 8AB
+44 (0) 1539 561830



Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk