Skip to content

[compiler-rt][www] replace deprecated LLVM_CONFIG_PATH with LLVM_CMAKE_DIR #71500

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

Merged
merged 2 commits into from
Nov 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler-rt/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ <h2>Get it and get involved!</h2>
<li>cd llvm-project</li>
<li>mkdir build-compiler-rt</li>
<li>cd build-compiler-rt</li>
<li>cmake ../compiler-rt -DLLVM_CONFIG_PATH=/path/to/llvm-config</li>
<li>cmake ../compiler-rt -DLLVM_CMAKE_DIR=/path/to/llvm-project/cmake/modules</li>
Copy link
Collaborator

Choose a reason for hiding this comment

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

It still mentions llvm-config on the line 120
and this instruction does not work for me.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It does not work -DCOMPILER_RT_INCLUDE_TESTS=ON (which I guess default):
-- Builtin supported architectures:
CMake Error at test/CMakeLists.txt:47 (umbrella_lit_testsuite_begin):
Unknown CMake command "umbrella_lit_testsuite_begin".

but work with -DCOMPILER_RT_INCLUDE_TESTS=OFF

Copy link
Collaborator

Choose a reason for hiding this comment

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

No, it still does not work - ninja just copy a few headers and that's it

-DLLVM_CMAKE_DIR=/full_path_to_llvm_build_dir/ works as expected, but I am not sure if that was expected.

cd llvm-project/
cmake -GNinja -B ../out/compiler-rt -S ./compiler-rt -DLLVM_CMAKE_DIR=$(readlink -f ../out/llvm_build) -DCMAKE_C_COMPILER=$(readlink -f ../out/llvm_build/bin/clang) -DCMAKE_CXX_COMPILER=$(readlink -f ../out/llvm_build/bin/clang++)
ninja -C ../out/compiler-rt
ninja -C ../out/compiler-rt check-all

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It does not work -DCOMPILER_RT_INCLUDE_TESTS=ON (which I guess default):
-- Builtin supported architectures:
CMake Error at test/CMakeLists.txt:47 (umbrella_lit_testsuite_begin):
Unknown CMake command "umbrella_lit_testsuite_begin".

but work with -DCOMPILER_RT_INCLUDE_TESTS=OFF

I don't think COMPILER_RT_INCLUDE_TESTS=ON is always the default, only if LLVM_TREE_AVAILABLE:

# Setting these variables from an LLVM build is sufficient that compiler-rt can
# construct the output paths, so it can behave as if it were in-tree here.
if (LLVM_LIBRARY_OUTPUT_INTDIR AND LLVM_RUNTIME_OUTPUT_INTDIR AND PACKAGE_VERSION)
set(LLVM_TREE_AVAILABLE On)
endif()
if (LLVM_TREE_AVAILABLE)

I can reproduce the error you're seeing when COMPILER_RT_INCLUDE_TESTS=ON:

cmake -G Ninja -S compiler-rt -B build-compiler-rt -DCMAKE_C_COMPILER=$HOME/clang+llvm-17.0.4-aarch64-linux-gnu/bin/clang-17 -DCMAKE_CXX_COMPILER=$HOME/clang+llvm-17.0.4-aarch64-linux-gnu/bin/clang++ -DLLVM_CMAKE_DIR=cmake -DCOMPILER_RT_INCLUDE_TESTS=ON
-- Builtin supported architectures:
Traceback (most recent call last):
File "", line 22, in
IndexError: list index out of range
CMake Error at test/CMakeLists.txt:47 (umbrella_lit_testsuite_begin):
Unknown CMake command "umbrella_lit_testsuite_begin".

but the fix proposed in #98707 doesn't fix it for me.

Copy link
Collaborator

@vitalybuka vitalybuka Jul 16, 2024

Choose a reason for hiding this comment

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

-DLLVM_CMAKE_DIR=cmake must be absolute path to the llvm/clang build dir
so probably -DLLVM_CMAKE_DIR=$HOME/clang+llvm-17.0.4-aarch64-linux-gnu for you

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

-DLLVM_CMAKE_DIR=cmake must be absolute path to the llvm/clang build dir so probably -DLLVM_CMAKE_DIR=$HOME/clang+llvm-17.0.4-aarch64-linux-gnu for you

that indeed did the trick, cheers

<li>make</li>
</ul>

Expand Down