-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build system doesn't pick default LLVM libraries #148
Comments
CastXML uses |
The build works when I force LLVM 8 via the respective CMake config variable. Actually, I have bunch of
But the only fully usable LLVM is version 8, which is how I want it to be. The problem is maybe because I have more than one
And those files don't even come from
From my brief search, the way CMake sorts results in case multiple candidates are found via
Therefore whatever is the "default system version" of LLVM is ignored by the CMake build, which picks one pretty much at random... So in other words, it looks like only keeping a single clang would help CMake to automatically use the correct LLVM version. I experimented a bit and found that adding the below lines before
Relevant documentation is here:
I created a commit with those changes at mbdevpl@adad560 - would it be desired/acceptable to submit pull request, or is this not something you'd like to see in CastXML? |
@mbdevpl yes, please open a PR with that change. |
Opened #149. |
i ran into the same issue and after a bit of a research it worked for me. it turns out that i have multiple version of libclang
so i had to remove the oldest version which is 6.0
and finally ran cmake
|
Without this change, make cpp2v results in CMake Error at /usr/lib/llvm-7/lib/cmake/clang/ClangTargets.cmake:544 (message): The imported target "clangBasic" references the file "/usr/lib/llvm-7/lib/libclangBasic.a" if llvm-7 is installed in addition to llvm-10. See also CastXML/CastXML#148
Had the same issue. I got confused after reading the PR comments (it makes total sense to me), then glad your method worked. Maybe worth reopening issue? |
I'd like to report a build system issue(?) here. I'm not sure if this would be an issue according to the dev team, but I'd like to get your opinion on this if possible.
Expected behaviour: CastXML build uses the default clang libraries in the build.
Actual: it doesn't do that.
Details of what I observed are below:
I have few LLVMs in my system (6, 7, 8). However, the default is version 8.
Nevertheless, CastXML seems to insist on the version 6 installation, which on my system also happens to be incomplete. (I need version 6 only for some other legacy software, and no libclang-6.0-dev is installed because that legacy software doesn't need all of clang so I don't have it installed.)
In any case, the CastXML build chooses non-default LLVM, and breaks as expected:
I wonder, why CastXML prefers 6 when my system prefers 8?
Fortunately, I still can force the version, as CastXML's readme states:
The text was updated successfully, but these errors were encountered: