-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
llvm-openmp: match FindOpenMP.cmake output, add MSVC support #22353
Conversation
This comment has been minimized.
This comment has been minimized.
2c41c7a
to
73268e7
Compare
This comment has been minimized.
This comment has been minimized.
73268e7
to
bb43094
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The wrong runtime library gets picked up in test_package for some reason. Don't feel like debugging it.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
4947129
to
35fdf5e
Compare
This comment has been minimized.
This comment has been minimized.
Conan v1 pipeline ✔️All green in build 10 (
Conan v2 pipeline ✔️
All green in build 11 (
|
… support" This reverts commit a4e1f4f.
Reverting this in #22353, as there are further questions before accepting this PR as it is. The expectation when a recipe uses OpenMP is to use whatever is already supported by the compiler. So for gcc, this would be For users that use either gcc or LLVM-clang, or any other compiler that already has OpenMP, I would expect that OpenMP can be used without much hassle, is this not the case? I cannot find much evidence of success stories causing GCC to use LLVM’s libomp’s headers and libraries at build time. I understand what libomp.so may be ABI compatible with gcc’s libgomp.so, and this be runtime compatible in some scenarios - but even in that case there were issues in the past (see: https://lists.llvm.org/pipermail/llvm-dev/2015-May/085052.html ) Furthermore, other repository maintainers have explicitly avoided making the LLVM omp.h headers visible to gcc:
For gcc, the
For Visual Studio/msvc, using With no indication that this is already available for production code. Additionally, it would seem to be the case that The libomp runtime is already shipped by visual studio, is it not usable? Why would one need to use a newer runtime, does it not work? The most useful case would be for apple-clang, where OpenMP isn’t officially supported, and there is no system runtime, so making it available would solve this for users that have such a need - with the understanding that it is also experimental. Additionally, I’m not sure completely overriding CMake’s built in There’s also loss of functionality in the file provided in this PR:
So while providing a Conan package with the runtime ( The motivation this PR description would be insufficient, in the sense that what is happening in this recipe, is not representative of the most common case: to have OpenMP directives in a public header, causing compiler flags to propagate. I doubt this is the most common case - what could happen however is that when libraries are built statically, one must propagate the relevant runtime as a system library (I see some recipes propagating To summarise the concerns - we are outside of the comfort zone and it feels like are propagating this requirement (on this recipe) across conan center, is experimenting a tad too much: gcc:
clang:
msvc:
all:
overriding FindOpenMP.cmake:
Otherwise across conan center:
|
With MSVC added, this PR adds compatibility with all compilers used on CCI, which allows this package to be used anywhere OpenMP is required without adding a bunch of OpenMP-specific build flags to package_info every time (e.g. https://github.com/conan-io/conan-center-index/blob/master/recipes/lightgbm/all/conanfile.py#L123-L133).
The compatibility with
FindOpenMP.cmake
ensures thatfind_package(OpenMP)
with specified components and minimum version work as expected. Exports the same info about OpenMP version and flags as the official version does, but does so without compilation checks since the OpenMP spec version for llvm-openmp has been fixed and hardcoded since v9. The compilation checks were quite fragile when used with libs=False as well.Also:
test_package
failed to load the correct runtime for some reason.