Can't compile llvm for QtCreator
-
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:-
Clone LLVM and checkout a suitable branch
git clone -b release_60-based https://code.qt.io/clang/llvm -
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 -
Build and install LLVM/Clang
mkdir build
cd buildFor 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 2Is 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
-
-
Hi,
What branch of Qt Creator did you try to build ?
-
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
- I followed the instructions in its Readme
- 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
-
You should rather build the branch that matches the version you want to use.
-
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.
-
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 ?
-
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 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.