Skip to content

Conversation

RossBrunton
Copy link
Contributor

@RossBrunton RossBrunton commented Jun 9, 2025

This is a cmake variable which, if set to OFF, will disable building/configuring of
tests. It defaults to the value of LLVM_INCLUDE_TESTS.

@llvmbot llvmbot added openmp:libomp OpenMP host runtime openmp:libomptarget OpenMP offload runtime labels Jun 9, 2025
RossBrunton added a commit to RossBrunton/llvm-project that referenced this pull request Jun 9, 2025
If clang is not being built as part of this build, install headers into
`include` rather than `lib/clang/21/include` (the latter, in clangless
builds, will not be automatically included in search paths).

This, combined with llvm#143390 , allows builds that include OpenMP but not
clang to build successfully.
@jprotze
Copy link
Collaborator

jprotze commented Jun 10, 2025

More specifically, this variable disables configuring of tests. None of the OpenMP tests is built by default build targets.

RossBrunton added a commit to RossBrunton/llvm-project that referenced this pull request Jun 30, 2025
If clang is not being built as part of this build, install headers into
`include` rather than `lib/clang/21/include` (the latter, in clangless
builds, will not be automatically included in search paths).

This, combined with llvm#143390 , allows builds that include OpenMP but not
clang to build successfully.
RossBrunton added a commit to RossBrunton/llvm-project that referenced this pull request Aug 8, 2025
If clang is not being built as part of this build, install headers into
`include` rather than `lib/clang/21/include` (the latter, in clangless
builds, will not be automatically included in search paths).

This, combined with llvm#143390 , allows builds that include OpenMP but not
clang to build successfully.
RossBrunton added a commit to RossBrunton/llvm-project that referenced this pull request Aug 8, 2025
If clang is not being built as part of this build, install headers into
`include` rather than `lib/clang/21/include` (the latter, in clangless
builds, will not be automatically included in search paths).

This, combined with llvm#143390 , allows builds that include OpenMP but not
clang to build successfully.
This is a cmake variable which, if set to `OFF`, will disable building of
tests. It defaults to the value of `LLVM_INCLUDE_TESTS`.
@RossBrunton
Copy link
Contributor Author

@Meinersbur Wasn't sure who to tag with this, but you've touched this file recently. Mind having a look or letting me know if there's anyone else more suited?

@jprotze
Copy link
Collaborator

jprotze commented Aug 26, 2025

It would help, if you would line out the issue you are trying to address with this patch.

@Meinersbur Meinersbur requested a review from jprotze August 26, 2025 14:57
@Meinersbur
Copy link
Member

@jprotze LLVM has xyz_INCLUDE_TESTS options to speed up CMake configuration time and when cross-compiling where such tests could not run anyway but could result in a configuration error due to the CMakeLists.txt not prepared for cross-compilation.

@RossBrunton
Copy link
Contributor Author

For OpenMP specifically, the tests require Clang. With this flag set and a few other changes from another MR it becomes possible to build libopenmp as part of an LLVM build that does not build clang.

... Or at least last I checked a few weeks ago. Things could have changed since then.

@Meinersbur
Copy link
Member

@jprotze is referring to

if (NOT ENABLE_CHECK_TARGETS)
add_custom_target(${target}
COMMAND ${CMAKE_COMMAND} -E echo "${target} does nothing, dependencies not found.")
message(STATUS "${target} does nothing.")
return()
endif()

Why isn't this sufficient to disable tests when Clang is not present?

@jprotze
Copy link
Collaborator

jprotze commented Aug 27, 2025

My point is actually that compilation for all tests is triggered by lit run lines.
Configure only generates lit site configs. In addition the capabilities of the compiler are checked.
The cross compile case should be covered by detecting a compatible compiler. I successfully passed the tests with GCC or icc before in standalone builds of the openmp runtime. For standalone builds, LLVM_INCLUDE_TESTS would not be defined, so we would at least need to check whether the variable is set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
openmp:libomp OpenMP host runtime openmp:libomptarget OpenMP offload runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants