mesonbuild / meson

The Meson Build System
http://mesonbuild.com
Apache License 2.0
5.57k stars 1.62k forks source link

llvm-config was found, but LLVM dep was not found #13062

Open 0b-s3rv3r opened 6 months ago

0b-s3rv3r commented 6 months ago

Describe the bug LLVM dep was not found.

The Meson build system
Version: 1.4.0
Source dir: C:\Users\Patryk\Desktop\1479
Build dir: C:\Users\Patryk\Desktop\1479\build
Build type: native build
Project name: 1479
Project version: 0.1
C++ compiler for the host machine: clang++ (clang 18.1.3 "clang version 18.1.3")
C++ linker for the host machine: clang++ link 14.38.33133.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
WARNING: The LLVM dependency was not found via CMake since both a C and C++ compiler are required.
llvm-config found: YES (C:\llvm\build\Release\bin\llvm-config.EXE) 19.0.0
Run-time dependency LLVM found: NO (tried cmake)

meson.build:17:11: ERROR: Dependency "llvm" not found, tried cmake

A full log can be found at C:\Users\Patryk\Desktop\1479\build\meson-logs\meson-log.txt
WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.

llvm version:

llvm-config --version
19.0.0git

To Reproduce

dep_llvm = dependency(
  'llvm',
  version : '>=19.0.0'
)

Expected behavior Meson should find LLVM dep

system parameters

thesamesam commented 6 months ago

WARNING: The LLVM dependency was not found via CMake since both a C and C++ compiler are required.

It seems to think you don't have a C compiler.

0b-s3rv3r commented 6 months ago

You mean clang ? I have both clang and clang++.

> clang --version
clang version 18.1.3
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
> clang++ --version
clang version 18.1.3
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
dcbaker commented 6 months ago

You need to tell Meson to use it. project('name', 'c', 'cpp'), or, if you want to be more conservative:

project('name', 'cpp')

dep_llvm = dependency('llvm', method : 'config-tool', required : false. modules : ...)
if not dep_llvm.found()
   add_langauges('c', native : false)
   dep_llvm = dependency('llvm', method : 'cmake', moduies : ...)
endif
dcbaker commented 6 months ago

Also, what does the dependency('llvm') line look like?

0b-s3rv3r commented 6 months ago

Warning disappeared, but the same error as before still occurs.

The Meson build system
Version: 1.4.0
Source dir: C:\Users\Patryk\Desktop\1479
Build dir: C:\Users\Patryk\Desktop\1479\build
Build type: native build
Project name: 1479
Project version: 0.1
C compiler for the host machine: clang (clang 18.1.3 "clang version 18.1.3")
C linker for the host machine: clang link 14.38.33133.0
C++ compiler for the host machine: clang++ (clang 18.1.3 "clang version 18.1.3")
C++ linker for the host machine: clang++ link 14.38.33133.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found CMake: C:\Program Files\CMake\bin\cmake.EXE (3.28.0)
llvm-config found: YES (C:\llvm\build\Release\bin\llvm-config.EXE) 19.0.0
Run-time dependency LLVM found: NO (tried cmake)

meson.build:17:7: ERROR: Dependency "llvm" not found, tried cmake

A full log can be found at C:\Users\Patryk\Desktop\1479\build\meson-logs\meson-log.txt
0b-s3rv3r commented 6 months ago

I'am also pasting here log from meson logs.

Dependency lookup for llvm with method 'config-tool' failed: Could not generate  for LLVM.
llvm-config: error: LLVM-19git.dll is missing

Run-time dependency LLVM found: NO (tried cmake)

meson.build:17:7: ERROR: Dependency "llvm" not found, tried cmake
dcbaker commented 6 months ago

It's telling you that it's only trying CMake as a dependency method, when the meson.build script calls dependency('llvm'), what additional arguments are being passed to it?

0b-s3rv3r commented 6 months ago

I don't have any additional args for now. I Just straight call dependency.

project('project', 'cpp', 'c', version: '0.1', meson_version: '1.4.0')
llvm = dependency('llvm')