Skip to content
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

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

Merged
merged 2 commits into from
Nov 9, 2023

Conversation

c-rhodes
Copy link
Collaborator

@c-rhodes c-rhodes commented Nov 7, 2023

This updates the standalone build docs for compiler-rt to replace deprecated LLVM_CONFIG_PATH with LLVM_CMAKE_DIR. A warning (added in D137024) is emitted for the current instructions.

…E_DIR

This updates the standalone build docs for compiler-rt to replace
deprecated LLVM_CONFIG_PATH with LLVM_CMAKE_DIR. A warning (added in
D137024) is emitted for the current instructions.
@c-rhodes c-rhodes merged commit 0199d51 into llvm:main Nov 9, 2023
2 of 3 checks passed
@c-rhodes c-rhodes deleted the compiler-rt-www-llvm-cmake-dir branch November 9, 2023 08:05
@@ -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

vitalybuka added a commit that referenced this pull request Jul 17, 2024
sgundapa pushed a commit to sgundapa/upstream_effort that referenced this pull request Jul 23, 2024
yuxuanchen1997 pushed a commit that referenced this pull request Jul 25, 2024
Summary: Follow up to #71500

Test Plan: 

Reviewers: 

Subscribers: 

Tasks: 

Tags: 


Differential Revision: https://phabricator.intern.facebook.com/D60250884
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants