Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Can't compile llvm for QtCreator

    Tools
    4
    9
    1589
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • martinv_
      martinv_ last edited by

      Hello,

      QtCreator sources cloned from code.qt.io/cgit contain a README.md with the following instructions to build llvm (I'm using Linux):

      Build LLVM/Clang by roughly following the instructions at
      http://llvm.org/docs/GettingStarted.html#git-mirror:

      1. Clone LLVM and checkout a suitable branch
        git clone -b release_60-based https://code.qt.io/clang/llvm

      2. Clone Clang into llvm/tools/clang and checkout a suitable branch
        git clone -b release_60-based https://code.qt.io/clang/clang llvm/tools/clang

      3. Build and install LLVM/Clang
        mkdir build
        cd build

        For Linux/macOS:
        cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=<installation location> -DLLVM_ENABLE_RTTI=ON ../llvm
        make install

      When I run make, the compilation goes fine until 91% and then I get the following error:

      [ 91%] Linking CXX executable ../../../../bin/clang
      /usr/bin/ld: cannot find -lclazyPlugin
      collect2: error: ld returned 1 exit status
      make[2]: *** [tools/clang/tools/driver/CMakeFiles/clang.dir/build.make:296: bin/clang-6.0] Error 1
      make[1]: *** [CMakeFiles/Makefile2:23647: tools/clang/tools/driver/CMakeFiles/clang.dir/all] Error 2
      make: *** [Makefile:152: all] Error 2

      Is there a workaround? Should I just wait for a fix to appear in the source tree? The CMakeLists.txt of llvm cloned from
      the above address does not have any configuration options regarding CLazy plugin.

      Kind regards,

      Martin

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        What branch of Qt Creator did you try to build ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • martinv_
          martinv_ last edited by

          Hi,

          this was QtCreator master cloned from git://code.qt.io/qt-creator/qt-creator.git

          I use QtCreator for C++ code development, but don't develop QtCreator itself - I just need the 'vanilla' version and don't really have a reason to check out other branches.

          I'm surprised nobody else observed this.

          Btw., I'm compiling llvm to have it as C++ code model in QtCreator, but the error occurs before I even get to compiling QtCreator. The only link to QtCreator is that

          1. I followed the instructions in its Readme
          2. I tried to compile llvm sources checked out from your server (https://code.qt.io/clang/llvm). I suppose these are somehow modified compared to the original llvm sources. QtCreator branch should be irrelevant here.

          Cheers,

          Martin

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            You should rather build the branch that matches the version you want to use.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply Reply Quote 0
            • martinv_
              martinv_ last edited by martinv_

              I want to use any branch that works. I tried to recompile QtCreator recently and got an error saying that I need to upgrade my LLVM installation to 6.0, and that's what I'm trying to do. You can hardly blame me for following the instructions in QtCreator README.

              There's no attempt to experiment or tweak things here. The defaults don't work for me.

              1 Reply Last reply Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                I'm not blaming you. That was rather a suggestion to follow the current "stable branch" rather than master that is the "development" branch.

                By the way, why not use the pre-built version of LLVM as suggested in the Readme file ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply Reply Quote 1
                • L
                  ldog last edited by

                  I have signed up for this forum just to say I have the exact same issue as OP and since he hasn't resolved and I haven't been able to either, I hope someone can help us.

                  It's likely that others have come across the same issue as well.

                  aha_1980 1 Reply Last reply Reply Quote 0
                  • aha_1980
                    aha_1980 Lifetime Qt Champion @ldog last edited by aha_1980

                    @ldog, just citing @SGaist

                    By the way, why not use the pre-built version of LLVM as suggested in the Readme file ?

                    regards

                    Qt has to stay free or it will die.

                    L 1 Reply Last reply Reply Quote 0
                    • L
                      ldog @aha_1980 last edited by

                      @aha_1980 Thanks for the suggestion, I haven't tried the prebuilt yet, but I've been able to resolve this issue by compiling the source of LLVM and Clang 6.0 from http://releases.llvm.org/download.html

                      I don't know why the two sources would differ so much, it might be worth investigating.

                      1 Reply Last reply Reply Quote 1
                      • First post
                        Last post