Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-136486

[qttools] Cannot configure with LLVM19 and 20 installed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.10
    • None

    Description

      I have llvm 20 installed in /opt/llvm-20, and llvm 19 installed in /usr/lib/llvm-19. ClangConfig.cmake is at /usr/lib/llvm-19/lib/cmake/clang/ClangConfig.cmake. I'm not sure why this doesn't work..

      + /home/moheim/qt/qt6/qtbase/configure -top-level -submodules qttools -- -DBUILD_qttools=ON -DCMAKE_C_COMPILER=clang-19 -DCMAKE_CXX_COMPILER=clang++-19 -DLLVM_INSTALL_DIR=/usr/lib/llvm-19
      '/usr/bin/cmake' '-DQT_BUILD_SUBMODULES=qttools' '-DBUILD_qttools=ON' '-DCMAKE_C_COMPILER=clang-19' '-DCMAKE_CXX_COMPILER=clang++-19' '-DLLVM_INSTALL_DIR=/usr/lib/llvm-19' '-DQT_INTERNAL_CALLED_FROM_CONFIGURE:BOOL=TRUE' '-G' 'Ninja' '/home/moheim/qt/qt6'
      -- Checking dependencies of submodule 'qtbase'
      -- Checking dependencies of submodule 'qtactiveqt'
      -- Checking dependencies of submodule 'qtimageformats'
      -- Checking dependencies of submodule 'qtlanguageserver'
      -- Checking dependencies of submodule 'qtshadertools'
      -- Checking dependencies of submodule 'qtsvg'
      -- Checking dependencies of submodule 'qtdeclarative'
      -- Checking dependencies of submodule 'qttools'
      -- Configuring submodule 'qtbase'
      -- [QtBase] CMAKE_BUILD_TYPE was already explicitly set to: 'Release'
      -- Configuring submodule 'qtactiveqt'
      Condition "WIN32" is not met, enabling documentation build only.
      -- Configuring submodule 'qtimageformats'
      -- Configuring submodule 'qtlanguageserver'
      -- Configuring submodule 'qtshadertools'
      -- Configuring submodule 'qtsvg'
      -- Configuring submodule 'qtdeclarative'
      -- Configuring submodule 'qttools'
      CMake Warning at qttools/cmake/FindWrapLibClang.cmake:72 (find_package):
        Could not find a configuration file for package "Clang" that exactly
        matches requested version "20.1.0".
      
        The following configuration files were considered but not accepted:
      
          /usr/lib/llvm-19/lib/cmake/clang/ClangConfig.cmake, version: 19.1.1
          /usr/lib/cmake/clang-18/ClangConfig.cmake, version: 18.1.8
          /usr/lib/cmake/clang-14/ClangConfig.cmake, version: unknown
          /usr/lib/cmake/clang-19/ClangConfig.cmake, version: 19.1.1
          /usr/lib/cmake/clang-13/ClangConfig.cmake, version: unknown
          /usr/lib/cmake/clang-15/ClangConfig.cmake, version: unknown
          /lib/cmake/clang-18/ClangConfig.cmake, version: 18.1.8
          /lib/cmake/clang-14/ClangConfig.cmake, version: unknown
          /lib/cmake/clang-19/ClangConfig.cmake, version: 19.1.1
          /lib/cmake/clang-13/ClangConfig.cmake, version: unknown
          /lib/cmake/clang-15/ClangConfig.cmake, version: unknown
      
      Call Stack (most recent call first):
        qtbase/cmake/QtFindPackageHelpers.cmake:141 (find_package)
        qttools/configure.cmake:6 (qt_find_package)
        qtbase/cmake/QtFeature.cmake:1030 (include)
        qttools/src/CMakeLists.txt:18 (qt_feature_evaluate_features)
      
      
      CMake Warning at qttools/cmake/FindWrapLibClang.cmake:72 (find_package):
        Could not find a configuration file for package "Clang" that exactly
        matches requested version "20.1.0".
      
        The following configuration files were considered but not accepted:
      
          /usr/lib/llvm-19/lib/cmake/clang/ClangConfig.cmake, version: 19.1.1
          /usr/lib/cmake/clang-18/ClangConfig.cmake, version: 18.1.8
          /usr/lib/cmake/clang-14/ClangConfig.cmake, version: unknown
          /usr/lib/cmake/clang-19/ClangConfig.cmake, version: 19.1.1
          /usr/lib/cmake/clang-13/ClangConfig.cmake, version: unknown
          /usr/lib/cmake/clang-15/ClangConfig.cmake, version: unknown
          /lib/cmake/clang-18/ClangConfig.cmake, version: 18.1.8
          /lib/cmake/clang-14/ClangConfig.cmake, version: unknown
          /lib/cmake/clang-19/ClangConfig.cmake, version: 19.1.1
          /lib/cmake/clang-13/ClangConfig.cmake, version: unknown
          /lib/cmake/clang-15/ClangConfig.cmake, version: unknown
      
      Call Stack (most recent call first):
        qtbase/cmake/QtFindPackageHelpers.cmake:141 (find_package)
        qttools/configure.cmake:6 (qt_find_package)
        qtbase/cmake/QtModuleHelpers.cmake:703 (include)
        qttools/src/global/CMakeLists.txt:8 (qt_internal_add_module)
      
      
      
      -- Configuration summary has been written to /home/moheim/qt/build-qttools/config.summary
      
      WARNING:
      QDoc will not be compiled, probably because clang's C and C++ libraries could not be located.
      This means that you cannot build the Qt documentation. You may need to set the CMake variables
      CMAKE_PREFIX_PATH or LLVM_INSTALL_DIR to the location of your llvm installation.
      Other than clang's libraries, you may need to install another package, such as clang itself, to
      provide the ClangConfig.cmake file needed to detect your libraries. Once this file is in place,
      the configure script may be able to detect your system-installed libraries without further
      environment variables.
      
      NOTE: You WILL also need to set the FEATURE_clang CMake variable to ON to re-try finding the
      dependencies.
      
      On macOS, you can use Homebrew's llvm package.
      Run `brew install llvm` and then configure with
      
       `configure LLVM_INSTALL_DIR=/opt/homebrew/opt/llvm FEATURE_clang=ON` for macOS arm64
      or
       `configure LLVM_INSTALL_DIR=/usr/local/opt/llvm FEATURE_clang_ON` for macOS x86_64.
      
      On Linux, you can try installing the clang package from your distribution's package manager.
      On Debian / Ubuntu run `sudo apt install libclang-dev`.
      On Fedora / RHEL run `sudo dnf install clang-devel`.
      On ArchLinux run `sudo pacman -S clang llvm`.
      
      Alternatively, you can use the prebuilt binaries hosted by Qt.
      These let you link LLVM/Clang libraries statically, but only support Release builds on Windows.
      https://download.qt.io/development_releases/prebuilt/libclang/qt/
      
      After installing, reconfigure with
      
       `/qt_src/configure FEATURE_clang=ON` for a top-level build that includes the qttools repo
      or
       `/qt_build/qt-configure-module /path/to/qttools FEATURE_clang=ON` for a per-submodule build
      
      
      -- Configuring done (12.2s)
      -- Generating done (1.8s)
      -- Build files have been written to: /home/moheim/qt/build-qttools
      

      Attachments

        1. archive_no_workaround.zip
          24.08 MB
          Moss Heim
        2. archive.zip
          23.94 MB
          Moss Heim
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtbuildsystem Qt Build System Team
            moheim Moss Heim
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes