Skip to content

Cannot use llvm-20-dev without mlir-20-tools and libpolly-20-dev installed #109392

@dtcxzyw

Description

@dtcxzyw

Reproducer:

cmake_minimum_required(VERSION 3.20)
enable_testing()

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

set(CMAKE_FIND_PACKAGE_SORT_ORDER NATURAL)
set(CMAKE_FIND_PACKAGE_SORT_DIRECTION DEC)

set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

project(Test)

find_package(LLVM REQUIRED CONFIG)
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
include(AddLLVM)

cmake complains:

CMake Error at /usr/lib/llvm-20/lib/cmake/llvm/LLVMExports.cmake:1914 (message):
  The imported target "mlir-pdll-lsp-server" references the file

     "/usr/lib/llvm-20/bin/mlir-pdll-lsp-server"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/lib/llvm-20/lib/cmake/llvm/LLVMExports.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  /usr/lib/llvm-20/cmake/LLVMConfig.cmake:370 (include)
  CMakeLists.txt:15 (find_package)


-- Configuring incomplete, errors occurred!

Workaround: install mlir-20-tools and libpolly-20-dev as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions