Page MenuHomePhabricator

MITK superbuild may fail with visual studio 2017 at boost
Closed, ResolvedPublic

Description

The current MITK master fails to build on my system due to problems building Boost (and later Matchpoint)

1>------ Build started: Project: Boost, Configuration: Release x64 ------
1>Building Custom Rule D:/projects/bug/MITK/CMakeLists.txt
1>CMake does not need to re-run because D:/projects/bug/bin/CMakeFiles/generate.stamp is up-to-date.
1>Creating directories for 'Boost'
1>Performing download step (download, verify and extract) for 'Boost'
1>-- Downloading...
1>   dst='D:/projects/bug/bin/ep/src/boost_1_64_0.7z'
1>   timeout='none'
1>-- Using src='http://mitk.org/download/thirdparty/boost_1_64_0.7z'
1>-- [download 0% complete]
<SNIP>
1>-- [download 100% complete]
1>-- verifying file...
1>       file='D:/projects/bug/bin/ep/src/boost_1_64_0.7z'
1>-- Downloading... done
1>-- extracting...
1>     src='D:/projects/bug/bin/ep/src/boost_1_64_0.7z'
1>     dst='D:/projects/bug/bin/ep/src/Boost'
1>-- extracting... [tar xfz]
1>-- extracting... [analysis]
1>-- extracting... [rename]
1>-- extracting... [clean up]
1>-- extracting... done
1>No update step for 'Boost'
1>No patch step for 'Boost'
1>Performing configure step for 'Boost'
1>Building Boost.Build engine
1>
1>Failed to build Boost.Build engine.
1>Please consult bootstrap.log for further diagnostics.
1>
1>You can try to obtain a prebuilt binary from
1>
1>   http://sf.net/project/showfiles.php?group_id=7586&package_id=72941
1>
1>Also, you can file an issue at http://svn.boost.org
1>Please attach bootstrap.log in that case.
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 2.
1>Done building project "Boost.vcxproj" -- FAILED.

bootstrap.log reads:

**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.0.26730.8
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x86'
###
### Using 'vc141' toolset.
###
yyacc.c
c1: fatal error C1083: Cannot open source file: 'yyacc.c': No such file or directory

Which seems to indicate that Microsofts changes in their directory structure might be at fault. MSVS 2017 (VC15.3.1) is the version supposed to be used, the above log indicates 14.1. The development console is now at

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat

In contrast MSVS 2015 called

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat

and the vcvarsall.bat is at

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat

instead of

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat

There seems to be a problem for boost recognizing the correct one.

Possibly this occurs for me only because I have several versions of visual studio installed.

Event Timeline

It seems the toolset version is correct as it is
https://github.com/boostorg/config/pull/119

I am able to bootstrap and build boost from the developer console of VS2017, however from within visual studio still fails.

Yes, v141 is right. I added a code path for MSVC 2017 not long ago. The build works fine on multiple machines with MSVC 2017 for me. Here is some of the output for MSVC 2017 (15.3.2) and CMake 3.9.1. I also build Boost yesterday with MSVC 2017 (15.3.1) and CMake 3.8.2.

CMake
The C compiler identification is MSVC 19.11.25507.1
The CXX compiler identification is MSVC 19.11.25507.1
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/HostX86/x64/cl.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/HostX86/x64/cl.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/HostX86/x64/cl.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/HostX86/x64/cl.exe -- works
bootstrap.log
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.0.26730.10
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x86'
###
### Using 'vc141' toolset.
###
command.c
compile.c
constants.c
debug.c
execcmd.c
execnt.c
filent.c
frames.c
function.c
glob.c
hash.c
hdrmacro.c
headers.c
jam.c
jambase.c
jamgram.c
lists.c
make.c
make1.c
object.c
Generating Code...
Compiling...
option.c
output.c
parse.c
pathnt.c
pathsys.c
regexp.c
rules.c
scan.c
search.c
subst.c
timestamp.c
variable.c
modules.c
strings.c
filesys.c
builtins.c
md5.c
class.c
cwd.c
w32_getreg.c
Generating Code...
Compiling...
native.c
set.c
path.c
regex.c
property-set.c
sequence.c
order.c
Generating Code...
...found 1 target...
...updating 1 target...
...updated 1 target...
...found 159 targets...
...updating 3 targets...
[MKDIR] bin.ntx86
[COMPILE] bin.ntx86\b2.exe
command.c
compile.c
constants.c
debug.c
execcmd.c
frames.c
function.c
glob.c
hash.c
hcache.c
headers.c
hdrmacro.c
jam.c
jambase.c
jamgram.c
lists.c
make.c
make1.c
mem.c
object.c
Compiling...
option.c
output.c
parse.c
pathsys.c
regexp.c
rules.c
scan.c
search.c
subst.c
w32_getreg.c
timestamp.c
variable.c
modules.c
strings.c
filesys.c
builtins.c
class.c
cwd.c
native.c
md5.c
Compiling...
set.c
path.c
regex.c
property-set.c
sequence.c
order.c
execnt.c
filent.c
pathnt.c
Generating code
Finished generating code
[COPY] bin.ntx86\bjam.exe
...updated 3 targets...

I googled for "Boost yyacc.c" and found someone complaining that the path wasn't quoted right leading to multiple arguments instead of one. So I tried again with spaces in the build directory but it works, too.

I searched for yyacc.c and YYACC in the Boost directory but there really isn't anything special.

Then I thought maybe you set your generator in CMake to Visual Studio 15 2017 instead of Visual Studio 15 2017 Win64 but even that works for me.

Downgrading from CMake 3.9.1 to 3.8.2 resolves in Matchpoint being build successfully. With a bit of fiddling I can build Boost manually and just skip the build step in the superbuild. However this is only a workaround for me.

At least Matchpoint fails for me as well with CMake 3.9.1.

The latest Boost version may work as well (v1.65.1).

Thanks for the info. Quoting from the link you posted above:

Have the same issue with 1.65.1 and VS2017 Update 2. Boost 1.64.0 was properly compiled in same environment without problems.

We are currently using 1.64 though.

Edit: Nevermind, it seems that user may have been using a different visual studio for 1.64 by accident.

Tested 1.65.1 without patch, didn't work.

kislinsk claimed this task.

Should work now. Not completely sure if it still works with the first version of MSVC 2017. If it doesn't, we need to check also the MSVC minor version to further restrict the patch.