I tried to build boost 1.65.0 using Visual Studio 2017 x64 and Windows 10.
This is how my power shell build script looks like:
. ".\Invoke-CmdScript.ps1"
# We expect PowerShell Version 5
if(-Not $PSVersionTable.PSVersion.Major -eq 5) {
Write-Host "Expecting PowerShell Version 5"
return
}
# Now download boost 1.65.0
Invoke-WebRequest http://dl.bintray.com/boostorg/release/1.65.0/source/boost_1_65_0.zip -OutFile C:\thirdparty\vs2017\x64\boost_1_65_0.zip
# Check file hash
$value = Get-FileHash C:\thirdparty\vs2017\x64\boost_1_65_0.zip -Algorithm SHA256
if($value.Hash -ne "f3f5c37be45eb6516c95cd147d8aa4abb9b52121fc3eccc1fc65c4af0cf48592") {
Write-Host "boost archive seems to be corrupted"
return
}
# Extract file
$strFileName="$env:ProgramFiles\7-Zip\7z.exe"
If (Test-Path $strFileName){
# Use 7-zip
if (-not (test-path "$env:ProgramFiles\7-Zip\7z.exe")) {throw "$env:ProgramFiles\7-Zip\7z.exe needed"}
set-alias sz "$env:ProgramFiles\7-Zip\7z.exe"
sz x C:\thirdparty\vs2017\x64\boost_1_65_0.zip -oC:\thirdparty\vs2017\x64
} Else {
# use slow Windows stuff
Expand-Archive C:\thirdparty\vs2017\x64\boost_1_65_0.zip -DestinationPath C:\thirdparty\vs2017\x64\boost_1_65_0
}
# Removed downloaded zip archive
Remove-Item C:\thirdparty\vs2017\x64\boost_1_65_0.zip
# Setup VS2017 x64 environment
Invoke-CmdScript -script "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" -parameters amd64
# Build
cd C:\thirdparty\vs2017\x64\boost_1_65_0
Invoke-CmdScript -script "bootstrap.bat"
$cpuInfo = Get-CimInstance -ClassName 'Win32_Processor' `
| Select-Object -Property 'DeviceID', 'Name', 'NumberOfCores', 'NumberOfLogicalProcessors';
Write-Host $cpuInfo.NumberOfLogicalProcessors
.\b2.exe --toolset=msvc-14.1 address-model=64 --build-type=complete stage -j $cpuInfo.NumberOfLogicalProcessors
To boil it down – it simple does:
bootstrap.bat
b2.exe --toolset=msvc-14.1 address-model=64 --build-type=complete stage –j 8
Execution bootstrap.bat seems to work. But b2 yields some errors – vcvarsall.bat not found:
Nevertheless, it seems that everything is build fine:
Is it safe to ignore those error messages? Can someone reproduce those errors?