Skip to content

CMake FindPackage error on Ubuntu 18.04.1 x64 #74

Open

Description

@HuguesDelorme

When running "cmake . -DCMAKE_BUILD_TYPE=Release" it systematically halts with this error :
CMake Error at generator/CMakeLists.txt:7 (Find_Package):
Could not find a package configuration file provided by "Clang" with any of
the following names:

ClangConfig.cmake
clang-config.cmake

Add the installation prefix of "Clang" to CMAKE_PREFIX_PATH or set
"Clang_DIR" to a directory containing one of the above files. If "Clang"
provides a separate development package or SDK, be sure it has been
installed.

I have packages clang + libllvm-6.0 + llvm-6.0 + llvm-6.0-runtime + libclang-6.0-dev + libclang1 + libclang-common-6.0-dev installed

Activity

  1. ogoffart commented on Dec 1, 2018

    @ogoffart
    Contributor

    Does the libclang-6.0-dev package not come with a ClangConfig.cmake file?
    Maybe there is a clang-dev package?

    You can try to do

    find /usr/ -name ClangConfig.cmake
    

    To find if you have the file.

  2. ogoffart commented on Dec 1, 2018

    @ogoffart
    Contributor

    https://packages.ubuntu.com/search?searchon=contents&keywords=ClangConfig.cmake&mode=exactfilename&suite=cosmic&arch=any
    says the package would be clang-6.0

    I suppose you would also need to do -DCMAKE_PREFIX_PATH=/usr/lib/llvm-6.0/lib/cmake/clang or someting like that

  3. HuguesDelorme commented on Dec 4, 2018

    @HuguesDelorme
    Author

    Hello Olivier,
    From what you advised I tried this:
    find /usr/ -name ClangConfig.cmake
    --> /usr/share/llvm-6.0/cmake/ClangConfig.cmake

    cmake . -DCMAKE_PREFIX_PATH=/usr/share/llvm-6.0/cmake
    -->
    -- Found LLVM 6.0.0 in /usr/lib/llvm-6.0
    -- Using LLVMConfig.cmake in: /usr/lib/llvm-6.0/cmake
    CMake Error at /usr/share/llvm-6.0/cmake/ClangConfig.cmake:18 (include):
    include could not find load file: /usr/lib/cmake/clang/ClangTargets.cmake
    Call Stack (most recent call first): generator/CMakeLists.txt:7 (Find_Package)

    For info:
    find /usr/ -name ClangTargets.cmake
    --> /usr/share/llvm-6.0/cmake/ClangTargets.cmake

    What could I try to fix this issue?

  4. rickywxg commented on May 19, 2019

    @rickywxg

    This is a debian packaging bug and was fixed in llvm-7.

    Please just remove the default llvm-6.0/clang-6.0 packages and install the version 7.
    sudo apt install llvm-7 clang-7 libclang-7-dev

  5. added a commit that references this issue on Feb 25, 2020
  6. added a commit that references this issue on Feb 25, 2020
  7. Durvi98 commented on Jun 10, 2021

    @Durvi98
  8. ogoffart commented on Jun 10, 2021

    @ogoffart
    Contributor

    Hi @Durvi98
    It doesn't look like you are commenting on the right github repository.

  9. eagerm commented on Jul 11, 2023

    @eagerm

    On Fedora, the missing packages are installed with "sudo dnf install llvm-devel".

  10. wetw0rk commented on Apr 8, 2024

    @wetw0rk

    I was able to build using the following (from the build directory), as of 2024.

    • sudo apt install llvm-15-dev clang-15 libclang-15-dev
    • cmake -DCMAKE_BUILD_TYPE=Release ..
    • make
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions