[CMake] Fix building Clad with builtin_llvm=OFF
#18026
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Right now, I get the following error when building ROOT with
builtin_llvm=OFFandclad=ON:CMake Error at CMakeLists.txt:94 (find_package): Could not find a package configuration file provided by "LLVM" with any of the following names: LLVMConfig.cmake llvm-config.cmake Add the installation prefix of "LLVM" to CMAKE_PREFIX_PATH or set "LLVM_DIR" to a directory containing one of the above files. If "LLVM" provides a separate development package or SDK, be sure it has been installed. CMake Error at /home/rembserj/code/root/root_build/interpreter/cling/tools/plugins/clad/clad-prefix/src/clad-stamp/clad-configure-RelWithDebInfo.cmake:47 (message): Stopping after outputting logs.This commit suggests to set the
LLVM_DIRto Clad to the actualLLVM_DIRthat is found byfind_package(LLVM).For
builtin_llvm=ONthis should also work, becauseLLVM_DIRis correctly set in theinterpreter/CMakeLists.txtfile.For some more context, here are the values of these variables when I build with
builtin_llvm=OFF:LLVM_BINARY_DIR: /nix/store/q45c1db56miy74dx02ibnql0cvxn3b13-llvm-18.1.8-libLLVM_DIR: /nix/store/8w3mp5c3mmnb0g2fnns881am7663g24d-llvm-18.1.8-dev/lib/cmake/llvmAnd here fore
builtin_llvm=ON, where it doesn't matter:LLVM_BINARY_DIR: /home/rembserj/code/root/root_build/interpreter/llvm-project/llvmLLVM_DIR: /home/rembserj/code/root/root_build/interpreter/llvm-project/llvmLooks like the problem for me is that on NixOS, the binary and development parts of the package are split into different prefixes.