Skip to content

Conversation

@guitargeek
Copy link
Contributor

@guitargeek guitargeek commented Mar 17, 2025

Right now, I get the following error when building ROOT with builtin_llvm=OFF and clad=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_DIR to Clad to the actual LLVM_DIR that is found by find_package(LLVM).

For builtin_llvm=ON this should also work, because LLVM_DIR is correctly set in the interpreter/CMakeLists.txt file.

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-lib
  • LLVM_DIR: /nix/store/8w3mp5c3mmnb0g2fnns881am7663g24d-llvm-18.1.8-dev/lib/cmake/llvm

And here fore builtin_llvm=ON, where it doesn't matter:

  • LLVM_BINARY_DIR: /home/rembserj/code/root/root_build/interpreter/llvm-project/llvm
  • LLVM_DIR: /home/rembserj/code/root/root_build/interpreter/llvm-project/llvm

Looks like the problem for me is that on NixOS, the binary and development parts of the package are split into different prefixes.

Right now, I get the following error when building ROOT with
`builtin_llvm=OFF` and `clad=ON`:
```txt
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_DIR` to Clad to the actual
`LLVM_DIR` that is found by `find_package(LLVM)`.

For `builtin_llvm=ON` this should also work, because `LLVM_DIR` is
correctly set in the `interpreter/CMakeLists.txt` file.
@guitargeek guitargeek added the clean build Ask CI to do non-incremental build on PR label Mar 17, 2025
@guitargeek guitargeek requested a review from aaronj0 March 17, 2025 14:18
@guitargeek guitargeek self-assigned this Mar 17, 2025
@guitargeek guitargeek requested a review from bellenot as a code owner March 17, 2025 14:18
Copy link
Contributor

@aaronj0 aaronj0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@guitargeek guitargeek merged commit 2542240 into root-project:master Mar 17, 2025
22 checks passed
@guitargeek guitargeek deleted the clad_llvm_dir branch March 17, 2025 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clean build Ask CI to do non-incremental build on PR in:Build System

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants