Home | News | Documentation | Download

Unable To Build On Windows with Latest Cling


#1

The Following Script (Mingw) used to work for building on windows: (commit 50a795610f1a576df5719378fb7bf68aefb5f8b5 of the cling repo):

#this is the directory where final LLVM binaries will be installed to.
LLVM_INSTALL_DIR="C:/Dev/LLVM_FULL"
COMPILER="Visual Studio 15 2017 Win64"



rm -r src -f
git clone "http://root.cern.ch/git/llvm.git" src
cd src
git checkout cling-patches
cd tools

git clone "https://github.com/root-project/cling" 
cd cling
git checkout oldMaster
cd ..

git clone "http://root.cern.ch/git/clang.git"
cd clang
git checkout cling-patches

cd ../../..


rm -r build_release -f

mkdir build_release


cd build_release
cmake -DCMAKE_INSTALL_PREFIX=$LLVM_INSTALL_DIR/Release -DCMAKE_BUILD_TYPE=Release -G "$COMPILER" ../src -Thost=x64
cmake --build . --target install --config Release

Now with the latest master I get the following errors:

python.exe (found version "3.6.3")
-- Constructing LLVMBuild project information
-- LLVMHello ignored -- Loadable modules not supported on this platform.
-- Targeting AArch64
-- Targeting AMDGPU
-- Targeting ARM
-- Targeting BPF
-- Targeting Hexagon
-- Targeting Lanai
-- Targeting Mips
-- Targeting MSP430
-- Targeting NVPTX
-- Targeting PowerPC
-- Targeting Sparc
-- Targeting SystemZ
-- Targeting X86
-- Targeting XCore
-- Could NOT find Z3 (missing: Z3_LIBRARIES Z3_INCLUDE_DIR) (Required is at leas                                                                          t version "4.5")
-- Looking for sys/resource.h
-- Looking for sys/resource.h - not found
-- Clang version: 5.0.0
-- SampleAnalyzerPlugin ignored -- Loadable modules not supported on this platfo                                                                          rm.
-- PrintFunctionNames ignored -- Loadable modules not supported on this platform                                                                          .
-- AnnotateFunctions ignored -- Loadable modules not supported on this platform.
-- BugpointPasses ignored -- Loadable modules not supported on this platform.
-- Cling version (from VERSION file): 0.6~dev
CMake Error at tools/cling/CMakeLists.txt:444 (string):
  string sub-command REPLACE requires at least four arguments.


-- Configuring incomplete, errors occurred!
See also "G:/LLVM/build_release/CMakeFiles/CMakeOutput.log".
See also "G:/LLVM/build_release/CMakeFiles/CMakeError.log".
Microsoft (R) Build Engine version 15.5.180.51428 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1009: Project file does not exist.
Switch: install.vcxproj

CMakeOutput.txt (83.0 KB)
CMakeError.txt (209.8 KB)

Has something changed in the build procedure?

Thanks! Trevor


#2

You should be able to switch it off. Cling does not require Z3.


#3

Adding -DCLING_INCLUDE_TESTS=0 to the build script allows it to fully build.


#4

However now cling-demo throws the following errors:

PS G:\LLVM\build_release\bin\Release> .\cling-demo.exe
RegQueryValueEx: returned 2: The system cannot find the file specified.
RegOpenKeyEx: returned 2: The system cannot find the file specified.
RegQueryValueEx: returned 2: The system cannot find the file specified.
RegOpenKeyEx: returned 2: The system cannot find the file specified.
ERROR in cling::CIFactory::createCI():
  resource directory lib\clang\5.0.0 not found!
input_line_2:1:10: fatal error: 'cling/Interpreter/RuntimeUniverse.h' file not found
#include "cling/Interpreter/RuntimeUniverse.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
starting inheritance evaluation test (should return 5).
In file included from input_line_3:1:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\iostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\istream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\ostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\ios:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\xlocnum:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\climits:5:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\yvals.h:111:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\crtdefs.h:9:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\vcruntime.h:184:30: error: typedef redefinition with different types ('unsigned int' vs 'unsigned long long')
    typedef unsigned int     size_t;
                             ^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\vcruntime.h:196:13: error: unknown type name '_Bool'
    typedef _Bool __vcrt_bool;
            ^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\vcruntime.h:215:22: error: 'short wchar_t' is invalid
    typedef unsigned short wchar_t;
                     ^
In file included from input_line_3:1:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\iostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\istream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\ostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\ios:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\xlocnum:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\climits:5:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\yvals.h:111:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\crtdefs.h:10:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\ucrt\corecrt.h:145:13: error: unknown type name '_Bool'
    typedef _Bool __crt_bool;
            ^
In file included from input_line_3:1:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\iostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\istream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\ostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\ios:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\xlocnum:7:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\cmath:7:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\cstdlib:34:13: error: using declaration requires a qualified name
using _CSTD size_t; using _CSTD div_t; using _CSTD ldiv_t;
            ^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\cstdlib:34:33: error: using declaration requires a qualified name
using _CSTD size_t; using _CSTD div_t; using _CSTD ldiv_t;
                                ^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\cstdlib:34:52: error: using declaration requires a qualified name
using _CSTD size_t; using _CSTD div_t; using _CSTD ldiv_t;
                                                   ^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\cstdlib:35:13: error: using declaration requires a qualified name
using _CSTD abort; using _CSTD abs; using _CSTD atexit;
            ^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\cstdlib:35:32: error: using declaration requires a qualified name
using _CSTD abort; using _CSTD abs; using _CSTD atexit;
                               ^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\cstdlib:35:49: error: using declaration requires a qualified name
using _CSTD abort; using _CSTD abs; using _CSTD atexit;
                                                ^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\cstdlib:36:13: error: using declaration requires a qualified name
using _CSTD atof; using _CSTD atoi; using _CSTD atol;
            ^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\cstdlib:36:31: error: using declaration requires a qualified name
using _CSTD atof; using _CSTD atoi; using _CSTD atol;
                              ^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\cstdlib:36:49: error: using declaration requires a qualified name
using _CSTD atof; using _CSTD atoi; using _CSTD atol;
                                                ^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\cstdlib:37:13: error: using declaration requires a qualified name
using _CSTD bsearch; using _CSTD calloc; using _CSTD div;
            ^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\cstdlib:37:34: error: using declaration requires a qualified name
using _CSTD bsearch; using _CSTD calloc; using _CSTD div;
                                 ^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\cstdlib:37:54: error: using declaration requires a qualified name
using _CSTD bsearch; using _CSTD calloc; using _CSTD div;
                                                     ^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\cstdlib:38:13: error: using declaration requires a qualified name
using _CSTD exit; using _CSTD free;
            ^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\cstdlib:38:31: error: using declaration requires a qualified name
using _CSTD exit; using _CSTD free;
                              ^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\cstdlib:39:13: error: using declaration requires a qualified name
using _CSTD labs; using _CSTD ldiv; using _CSTD malloc;
            ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
PS G:\LLVM\build_release\bin\Release>











#5

@bellenot can you help here?


#7

I can’t build cling right now (I won’t have access to my computers until sometime next week), but I think I know what the problem is. Starting from the version 2017, Visual Studio doesn’t have any Registry entries anymore. Then, to determine its location, we use the VCToolsInstallDir environment variable (which is usually set in the Developer Command Prompt).
So you have to either start from a Visual Studio Developer Command Prompt, or to manually set the VCToolsInstallDir environment variable pointing (for example) to:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128
Could you try and let men know? (no need to re-compile anything)

Cheers, Bertrand


#8

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.