Pepper Gray
Pepper Gray

Reputation: 1

cmake error: "include could not find requested file"

I want to build https://github.com/darlinghq/darling/ as described in the docs, but I get this error:

$ cmake ..

CMake Error at /usr/lib/x86_64-linux-gnu/cmake/llvm/LLVMConfig.cmake:354 (include):
  include could not find requested file:

    /usr/lib/lib/cmake/llvm/LLVMExports.cmake
Call Stack (most recent call first):
  src/external/metal/deps/indium/CMakeLists.txt:5 (find_package)


CMake Error at /usr/lib/x86_64-linux-gnu/cmake/llvm/LLVMConfig.cmake:375 (include):
  include could not find requested file:

    /usr/lib/lib/cmake/llvm/LLVM-Config.cmake
Call Stack (most recent call first):
  src/external/metal/deps/indium/CMakeLists.txt:5 (find_package)

Running this on a fresh install works fine, but it fails on my system.

The immediate problem is, that something goes wrong with computing the path. cmake looks at

/usr/lib/lib/cmake/llvm/LLVMExports.cmake

but the file is here:

/usr/lib/cmake/llvm/LLVMExports.cmake

Debuggin cmake shows this:

$ cmake --debug-output ..

CMake Error at /usr/lib/x86_64-linux-gnu/cmake/llvm/LLVMConfig.cmake:354 (include):
  include could not find requested file:

    /usr/lib/lib/cmake/llvm/LLVMExports.cmake
Call Stack (most recent call first):
  src/external/metal/deps/indium/CMakeLists.txt:5 (find_package)


   Called from: [2] /usr/lib/x86_64-linux-gnu/cmake/llvm/LLVMConfig.cmake
                [1] /home/darling/src/external/metal/deps/indium/CMakeLists.txt
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/llvm/LLVMConfig.cmake:375 (include):
  include could not find requested file:

    /usr/lib/lib/cmake/llvm/LLVM-Config.cmake
Call Stack (most recent call first):
  src/external/metal/deps/indium/CMakeLists.txt:5 (find_package)


   Called from: [2] /usr/lib/x86_64-linux-gnu/cmake/llvm/LLVMConfig.cmake
                [1] /home/darling/src/external/metal/deps/indium/CMakeLists.txt
   Returning to         /home/darling/src/external/metal
   Called from: [1] /home/darling/src/external/metal/CMakeLists.txt
   Returning to         /home/darling/src
   Called from: [1] /home/darling/src/CMakeLists.txt
   Returning to         /home/darling
   Called from: [1] /home/darling/CMakeLists.tx

I'm on Arch/Manjaro, but I ran this on a fresh Arch container and on a Manjaro Live CD and it worked fine for both. So the issues seems to be somehow realted to my system, maybe due to certain packages I have installed. Nevertheless I don't think this should happen, so I'm looking for some help with further debugging and maybe fixing this (either the build or my system).

-- Edit 1---

/usr/lib/x86_64-linux-gnu/cmake/llvm/LLVMConfig.cmake computes the path for LLVMExports.cmake:

# This file provides information and services to the final user.

# Compute the installation prefix from this LLVMConfig.cmake file location.
get_filename_component(LLVM_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(LLVM_INSTALL_PREFIX "${LLVM_INSTALL_PREFIX}" PATH)
get_filename_component(LLVM_INSTALL_PREFIX "${LLVM_INSTALL_PREFIX}" PATH)
get_filename_component(LLVM_INSTALL_PREFIX "${LLVM_INSTALL_PREFIX}" PATH)

...

344: set(LLVM_CMAKE_DIR "${LLVM_INSTALL_PREFIX}/lib/cmake/llvm")
354:   include("${LLVM_CMAKE_DIR}/LLVMExports.cmake")

So there seems nothing be wrong with the file itself, but with the way these variables are computed for this build.

Upvotes: 0

Views: 138

Answers (0)

Related Questions