Wrong MSVC with ExternalProject_Add

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Wrong MSVC with ExternalProject_Add

Gaël de Chalendar
Hi,

I encounter a problem using cmake (3.9 an 3.10) with Visual c++ 2015 under
Windows 10.

My build works with the "Visual Studio 14 2015 Win64" generator but I fail to
build using the Ninja generator.

I first solved a first step with help from stackoverflow and a blog post:
https://stackoverflow.com/questions/47904633/how-to-use-together-buildbot-cmake-ninja-and-visual-studio-c-compiler

Now, the initial cmake step runs well:

cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_IGNORE_PATH=C:/Strawberry/c/
bin -DCMAKE_INSTALL_PREFIX=C:\disk\amose-buildbot-worker\lima-master-
windows-10\Dist\master\Release -DWITH_ARCH=ON -DLIMA_RESOURCES=build -
DLIMA_VERSION_RELEASE=master -DSHORTEN_POR_CORPUS_FOR_SVMLEARN=TRUE C:\disk
\amose-buildbot-worker\lima-master-windows-10\Sources
 in dir Z:\b (timeout 1200 secs)
 watching logfiles {}
 argv: [b'cmake', b'-G', b'Ninja', b'-DCMAKE_BUILD_TYPE=Release', b'-
DCMAKE_IGNORE_PATH=C:/Strawberry/c/bin', b'-DCMAKE_INSTALL_PREFIX=C:\\disk\
\amose-buildbot-worker\\lima-master-windows-10\\Dist\\master\\Release', b'-
DWITH_ARCH=ON', b'-DLIMA_RESOURCES=build', b'-DLIMA_VERSION_RELEASE=master',
b'-DSHORTEN_POR_CORPUS_FOR_SVMLEARN=TRUE', b'C:\\disk\\amose-buildbot-worker\
\lima-master-windows-10\\Sources']
 environment:
<snip environment variables>
-- The C compiler identification is MSVC 19.0.24210.0
-- The CXX compiler identification is MSVC 19.0.24210.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
Studio 14.0/VC/bin/amd64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
Studio 14.0/VC/bin/amd64/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 14.0/VC/bin/amd64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual
Studio 14.0/VC/bin/amd64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
SHORTEN_POR_CORPUS_FOR_SVMLEARN=TRUE
WITH_ASAN=OFF
WITH_ARCH=ON
Windows flags
PERL5LIB=C:/disk/amose-buildbot-worker/lima-master-windows-10/Sources/
lima_pelf/evalPosTagging/SVM/SVMTool-1.3.1/lib:
PATH=C:/disk/amose-buildbot-worker/lima-master-windows-10/Sources/lima_pelf/
evalPosTagging/SVM/SVMTool-1.3.1/bin:C:/Users/buildbot/Projets/externals
\bin;C:/Users/buildbot/Projets/externals\lib;C:\disk\amose-buildbot-worker
\lima-master-windows-10\Dist\master\Release\bin;C:\disk\amose-buildbot-worker
\lima-master-windows-10\Dist\master\Release\lib;C:\Program Files (x86)\MSBuild
\14.0\bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN
\amd64;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Windows
\Microsoft.NET\Framework64\;C:\Program Files (x86)\Windows Kits\8.1\bin\x64;C:
\Program Files (x86)\Windows Kits\8.1\bin\x86;c:\d\bin;c:\d\share\apps\lima
\scripts;C:\Qt\Qt5.6.3\5.6.3\msvc2015_64\bin;%BOOST_LIBRARYDIR%;c:\msys64\usr
\bin;C:\ProgramData\chocolatey\lib\msys2;C:\tools\msys64;C:\tools\msys64\usr
\bin;C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs
\Microsoft.UniversalCRT.Debug\10.0.10240.0\Redist\Debug\x86;C:
\Python36\Scripts\;C:\Python36\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS
\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\ProgramData
\chocolatey\bin;C:\Program Files\Git\cmd;C:\Program Files (x86)\Windows Kits
\8.1\Windows Performance Toolkit\;C:\local\boost_1_58_0\lib64-msvc-12.0;C:
\Program Files\CMake\bin;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:
\Strawberry\perl\bin;C:\Program Files\Java\jdk1.8.0_162\bin;C:\Users\buildbot
\AppData\Local\Microsoft\WindowsApps;c:\Qt\Qt5.6.3\5.6.3\msvc2015_64;;c:
\python36\lib\site-packages\pypiwin32_system32
Found Qt5 5.6.3
Adding module Core
Adding module Core
-- Configuring done
-- Generating done
-- Build files have been written to: Z:/b
program finished with exit code 0
elapsedTime=35.421545

But wen the build step runs, the configuration of the first ExternalProject_Add
fails:

cmake --build . --config Release
 in dir Z:\b (timeout 3600 secs)
 watching logfiles {}
 argv: [b'cmake', b'--build', b'.', b'--config', b'Release']
 environment:
<snip environment  variables>
 using PTY: False
[1/55] Creating directories for 'lima_common'
[1/55] No download step for 'lima_common'
[2/55] No update step for 'lima_common'
[3/55] No patch step for 'lima_common'
[4/55] Performing configure step for 'lima_common'
-- The C compiler identification is MSVC 19.0.24210.0
-- The CXX compiler identification is MSVC
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
Studio 14.0/VC/bin/amd64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
Studio 14.0/VC/bin/amd64/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 14.0/VC/bin/amd64/cl.exe
CMake Error at C:/Program Files/CMake/share/cmake-3.10/Modules/Platform/
Windows-MSVC.cmake:67 (message):
  MSVC compiler version not detected properly:
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.10/Modules/Platform/Windows-MSVC-
CXX.cmake:1 (include)
  C:/Program Files/CMake/share/cmake-3.10/Modules/CMakeCXXInformation.cmake:48
(include)
  Z:/b/lima_common/src/lima_common-build/CMakeFiles/CMakeTmp/CMakeLists.txt:2
(project)
CMake Error at C:/Program Files/CMake/share/cmake-3.10/Modules/
CMakeTestCXXCompiler.cmake:30 (try_compile):
  Failed to configure test project build system.
Call Stack (most recent call first):
  CMakeLists.txt:17 (project)
-- Configuring incomplete, errors occurred!
See also "Z:/b/lima_common/src/lima_common-build/CMakeFiles/CMakeOutput.log".
FAILED: lima_common/src/lima_common-stamp/lima_common-configure
cmd.exe /C "cd /D Z:\b\lima_common\src\lima_common-build && "C:\Program Files
\CMake\bin\cmake.exe" -DCMAKE_INSTALL_PREFIX:PATH=C:\disk\amose-buildbot-
worker\lima-master-windows-10\Dist\master\Release -
DCMAKE_BUILD_TYPE:STRING=Release -DLIMA_VERSION_RELEASE:STRING=\"master\" -
DBoost_DEBUG=ON -DWITH_ASAN:BOOL=OFF -DWITH_ARCH:BOOL=ON -
DSHORTEN_POR_CORPUS_FOR_SVMLEARN:BOOL=TRUE -DCMAKE_IGNORE_PATH=C:/Strawberry/
c/bin "-DCMAKE_CXX_FLAGS:STRING=/Zc:wchar_t- /EHsc /GR /W4 /MP /FAu /DWIN32 /
D_WINDOWS /W3 /GR /EHsc" "-DCMAKE_CXX_FLAGS_DEBUG:STRING=/MDd /Zi /Ob0 /Od /
RTC1" "-DCMAKE_CXX_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /DNDEBUG" -
DBOOST_ROOT:STRING= -DBOOST_LIBRARYDIR:STRING= -DENVPATH:STRING=C:/disk/amose-
buildbot-worker/lima-master-windows-10/Sources/lima_pelf/evalPosTagging/SVM/
SVMTool-1.3.1/bin:C:/Users/buildbot/Projets/externals\bin C:/Users/buildbot/
Projets/externals\lib C:\disk\amose-buildbot-worker\lima-master-
windows-10\Dist\master\Release\bin C:\disk\amose-buildbot-worker\lima-master-
windows-10\Dist\master\Release\lib "C:\Program Files (x86)\MSBuild\14.0\bin
\amd64" "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64" C:
\Windows\Microsoft.NET\Framework64\v4.0.30319 C:\Windows\Microsoft.NET
\Framework64 "C:\Program Files (x86)\Windows Kits\8.1\bin\x64" "C:\Program
Files (x86)\Windows Kits\8.1\bin\x86" c:\d\bin c:\d\share\apps\lima\scripts C:
\Qt\Qt5.6.3\5.6.3\msvc2015_64\bin %BOOST_LIBRARYDIR% c:\msys64\usr\bin C:
\ProgramData\chocolatey\lib\msys2 C:\tools\msys64 C:\tools\msys64\usr\bin "C:
\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs
\Microsoft.UniversalCRT.Debug\10.0.10240.0\Redist\Debug\x86" C:
\Python36\Scripts C:\Python36 C:\WINDOWS\system32 C:\WINDOWS C:\WINDOWS
\System32\Wbem C:\WINDOWS\System32\WindowsPowerShell\v1.0 C:\ProgramData
\chocolatey\bin "C:\Program Files\Git\cmd" "C:\Program Files (x86)\Windows
Kits\8.1\Windows Performance Toolkit" C:\local\boost_1_58_0\lib64-msvc-12.0
"C:\Program Files\CMake\bin" C:\Strawberry\c\bin C:\Strawberry\perl\site\bin
C:\Strawberry\perl\bin "C:\Program Files\Java\jdk1.8.0_162\bin" C:\Users
\buildbot\AppData\Local\Microsoft\WindowsApps c:\Qt\Qt5.6.3\5.6.3\msvc2015_64
c:\python36\lib\site-packages\pypiwin32_system32 -DENVPERL5LIB:STRING=C:/disk/
amose-buildbot-worker/lima-master-windows-10/Sources/lima_pelf/evalPosTagging/
SVM/SVMTool-1.3.1/lib: -GNinja C:/disk/amose-buildbot-worker/lima-master-
windows-10/Sources/lima_common/ && "C:\Program Files\CMake\bin\cmake.exe" -E
touch Z:/b/lima_common/src/lima_common-stamp/lima_common-configure"
ninja: build stopped: subcommand failed.
program finished with exit code 1
elapsedTime=18.751174

Environment variables are the same at both configure and build steps.

Here is the code of the externalproject_add (from a macro, thus the
variables):
  ## Add external project
  ExternalProject_Add(
    ${_project}
    PREFIX "${_project}"
    DOWNLOAD_COMMAND ""
    PATCH_COMMAND ""
    UPDATE_COMMAND ""
    SOURCE_DIR ${CMAKE_SOURCE_DIR}/${_project}/
    INSTALL_DIR $ENV{LIMA_DIST}
    USES_TERMINAL_DOWNLOAD 1
    USES_TERMINAL_UPDATE 1
    USES_TERMINAL_CONFIGURE 1
    USES_TERMINAL_BUILD 1
    USES_TERMINAL_TEST 1
    USES_TERMINAL_INSTALL 1
    TEST_AFTER_INSTALL 1
    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=$ENV{LIMA_DIST}
        -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
        -DLIMA_VERSION_RELEASE:STRING="${LIMA_VERSION_RELEASE}"
        -DBoost_DEBUG=ON
        -DWITH_ASAN:BOOL=${WITH_ASAN}
        -DWITH_ARCH:BOOL=${WITH_ARCH}
        -DSHORTEN_POR_CORPUS_FOR_SVMLEARN:BOOL=$
{SHORTEN_POR_CORPUS_FOR_SVMLEARN}
        -DCMAKE_IGNORE_PATH=${CMAKE_IGNORE_PATH}
        -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
        -DCMAKE_CXX_FLAGS_DEBUG:STRING=${CMAKE_CXX_FLAGS_DEBUG}
        -DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE}
        -DBOOST_ROOT:STRING=${BOOST_ROOT}
        -DBOOST_LIBRARYDIR:STRING=${BOOST_LIBRARYDIR}
        -DENVPATH:STRING=$ENV{PATH}
        -DENVPERL5LIB:STRING=$ENV{PERL5LIB}
  )

Any idea of what to search for next ?

Best regards,

Gaël
--

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

smime.p7s (4K) Download Attachment