-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
dependency(LLVM) always finds newest installation #13906
Comments
FWIW, here is the workaround I have: https://gitlab.kitware.com/paraview/common-superbuild/-/merge_requests/671/diffs#diff-content-ced25e2aa2f7e2cf5d5068bb46cdfac0f08908df |
If you're using cmake, invoking with Upstream Mesa moved to requring llvm-config for !Windows. I'm not sure that the move the cmake as the default finder was a good one, and I'd be okay with swapping back to llvm-config before cmake if others are cool with that. As an aside, LLVM + Clang are the reason I got involved with cps. This is a hard set of dependencies to use. |
@dcbaker can you show why upstream Mesa went for llvm-config for !Windows (especially for Linux) and how to fix it (for using CMake with Mesa's Meson scripts)? |
@rilian-la-te https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25042 Basically the same complaint we have here, the cmake finder doesn't do the right thing, even when you set the options correctly |
I think the issue is that the CMake code wrapping |
Describe the bug
Meson's CMake LLVM strategy ends up finding the newest version rather than the intended version if it is older than any version found by default. This is because of the
LLVM_MESON_VERSIONS
loop that searches for versions in decreasing order. When it finds the first one, it stops searching thinking it is suitable.I was able to find the intended one by leveraging CMake's search mechanisms by neutering the version loops and just searching for LLVM with a suitable
CMAKE_PREFIX_PATH
setup rather than searching for any specific versions.Ideas:
LLVM_MESON_VERSIONS
list before searching (allows projects to say['>= 15', '< 16']
or something)find_package
mechanismsllvm-config
search strategy (easy to override at build time withLLVM_CONFIG
envvar)To Reproduce
Building mesa with LLVM support. System LLVM installed is newer (e.g., 17, 19) than custom build (e.g., 15). By default Meson will use the CMake search strategy and always find the newest (system here) version rather than the intended version.
Setup:
dnf install llvm-devel
(brings LLVM 19)Expected behavior
Selecting the LLVM to use should be "easy".
system parameters
meson --version
1.5.2
The text was updated successfully, but these errors were encountered: