0

I try to build and install the LLVM source on Windows (specifically LLVM-8, but the issue exists on the latest version as well), using Visual Studio 2019 and CMake 3.18.2, following the guide from http://llvm.org/docs/GettingStarted.html#getting-the-source-code-and-building-llvm.

The output however looks the same as discussed in Building LLVM using Visual Studio, but the solution did not change anything for me.

I ran the following commands:

git clone --config core.autocrlf=false https://github.com/llvm/llvm-project.git
cd llvm-project
mkdir build
cd build
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall" x64
cmake ../llvm -G "Visual Studio 16 2019" -DLLVM_OPTIMIZED_TABLEGEN=TRUE -DLLVM_ENABLE_PROJECTS=clang -Thost=x64

I also tried the following:

  • not explicitly specifying a Generator (or any cmake arguments for that matter)
  • using the x64 Native Tools Command Prompt for VS 2019 instead of calling vcvarsall
  • running the command prompt / native tools command prompt as admin

Here is an extract of the output. As you can see, on the Check for working C / CXX compiler it says skipped at the end, which I suspect to be the issue.. But failed to resolve.

-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19041.
-- The C compiler identification is MSVC 19.27.29111.0
-- The CXX compiler identification is MSVC 19.27.29111.0
-- The ASM compiler identification is MSVC
-- Found assembler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- clang project is enabled
-- clang-tools-extra project is disabled
-- compiler-rt project is disabled
-- debuginfo-tests project is disabled
-- libc project is disabled
-- libclc project is disabled
-- libcxx project is disabled
-- libcxxabi project is disabled
-- libunwind project is disabled
-- lld project is disabled
-- lldb project is disabled
-- mlir project is disabled
-- openmp project is disabled
-- parallel-libs project is disabled
-- polly project is disabled
-- pstl project is disabled
-- flang project is disabled
-- Looking for dlfcn.h
-- Looking for dlfcn.h - not found
-- Looking for errno.h
-- Looking for errno.h - found
-- Looking for fcntl.h
-- Looking for fcntl.h - found
-- Looking for link.h
-- Looking for link.h - not found
-- Looking for malloc/malloc.h
-- Looking for malloc/malloc.h - not found
-- Looking for signal.h
-- Looking for signal.h - found
-- Looking for sys/ioctl.h
-- Looking for sys/ioctl.h - not found
-- Looking for sys/mman.h
-- Looking for sys/mman.h - not found
-- Looking for sys/param.h
-- Looking for sys/param.h - not found
-- Looking for sys/resource.h
-- Looking for sys/resource.h - not found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/time.h
-- Looking for sys/time.h - not found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for sysexits.h
-- Looking for sysexits.h - not found
-- Looking for termios.h
-- Looking for termios.h - not found
-- Looking for unistd.h
-- Looking for unistd.h - not found
-- Looking for valgrind/valgrind.h
-- Looking for valgrind/valgrind.h - not found
-- Looking for fenv.h
-- Looking for fenv.h - found
-- Looking for FE_ALL_EXCEPT
-- Looking for FE_ALL_EXCEPT - found
-- Looking for FE_INEXACT
-- Looking for FE_INEXACT - found
-- Looking for mach/mach.h
-- Looking for mach/mach.h - not found
-- Looking for histedit.h
-- Looking for histedit.h - not found
-- Looking for CrashReporterClient.h
-- Looking for CrashReporterClient.h - not found
-- Looking for pfm_initialize in pfm
-- Looking for pfm_initialize in pfm - not found
leyren
  • 524
  • 6
  • 20
  • By itself, `skipped` is not an error indicator. Do you have an error when building the project after such configuration? – Tsyvarev Sep 03 '20 at 08:44
  • No, it builds successfully. But especially the whole plethora of 'not found' warnings is making me wonder how that affects the build, even if it succeeds. – leyren Sep 03 '20 at 09:39
  • A message "not found" is not a *warning*. It is just a fact that a file, which could be used for implementation on one system, cannot be used on your system. E.g. it is known that `dlfcn.h` header [is absent on Windows](https://stackoverflow.com/questions/1397022/mingw-3-4-5-missing-dlfcn-h). [The same](https://stackoverflow.com/questions/341817/is-there-a-replacement-for-unistd-h-for-windows-visual-c) is about `unistd.h`. If you courios about why **specific** header file is "not found", then ask about it (but make sure to search before asking). – Tsyvarev Sep 03 '20 at 10:24
  • I see, so I was misinterpreting the messages. – leyren Sep 03 '20 at 11:05
  • 1
    Does this answer your question? [Check for working C compiler: "cl.exe - skipped" : Visual Studio 2019](https://stackoverflow.com/questions/64212759/check-for-working-c-compiler-cl-exe-skipped-visual-studio-2019) – fdk1342 May 20 '21 at 18:17

1 Answers1

0

I've built it recently in VS 2019, using clang-cl toolset. As I recall, other VS toolsets still have issues.

CMakeSettings.json:

{
  "configurations": [
    {
      "name": "x64-Clang-Release",
      "generator": "Ninja",
      "configurationType": "Release",
      "buildRoot": "${projectDir}\\..\\_build\\${name}",
      "installRoot": "${projectDir}\\..\\_install",
      "cmakeCommandArgs": "-DLLVM_ENABLE_PROJECTS=\"clang\"",
      "buildCommandArgs": "-v",
      "ctestCommandArgs": "",
      "inheritEnvironments": [ "clang_cl_x64" ],
      "variables": []
    }
  ]
}

clang-cl toolset payload in VS Installer

Dmitry Sokolov
  • 3,118
  • 1
  • 30
  • 35