-
Notifications
You must be signed in to change notification settings - Fork 10.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
[openmp][testing] disable check targets if not building with clang #71866
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To check: so the only reason this was true was due to testing?
Don't hold me to that. Yes with just this patch you can configure and build, but in addition I have -DLIBOMP_OMPD_GDB_SUPPORT=OFF
-DLIBOMP_USE_QUAD_PRECISION=False
-DOPENMP_ENABLE_LIBOMPTARGET=OFF but I don't remember why. But irrespective of whether this patch is sufficient, it's definitely necessary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look right. Basically, libomp
can be built with any compatible compiler, while libomptarget
requires in-tree clang. We can test libomp
w/o need of clang but indeed we need clang
to test libomptarget
. This changes can affect both.
Can you suggest an alternative patch then? Isn't it clearly a bug that I absolutely can't build
I don't see how this affectst actually anything at all since people wanting to build/test |
if (NOT TARGET "clang") | ||
message(STATUS "Cannot find 'clang'.") | ||
message(WARNING "The check targets will not be available!") | ||
set(ENABLE_CHECK_TARGETS FALSE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set(ENABLE_CHECK_TARGETS FALSE) | |
set(ENABLE_CHECK_TARGETS FALSE) | |
set(OPENMP_ENABLE_LIBOMPTARGET OFF) |
@shiltian would you accept someting like this (with an amended warning)?
@@ -65,6 +65,11 @@ else() | |||
else() | |||
set(OPENMP_FILECHECK_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/FileCheck) | |||
endif() | |||
if (NOT TARGET "clang") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (NOT TARGET "clang") | |
find_program(OPENMP_CLANG_EXECUTABLE "clang") | |
if (NOT TARGET "clang" AND NOT OPENMP_CLANG_EXECUTABLE) |
If |
the problem is the tests aren't factored in such a way that that's possible right? When you don't have a clang target available, the actual CMake error comes from the
So fiddling with |
I should note that in putting together this PR I did discover that this combination of flags is a workaroud
but I don't like it because this ends up building |
I see your point. The current implementation is wrong and quite unfortunate. The correct fix would be first to remove the unconditional |
Actually I'm wrong - it's not |
@shiltian is there a reason no exported target is created during standalone build?
I tried removing the |
AFAIK, the issue only exists on macOS. I didn't see that on either Windows or Linux. In standalone build, we don't need to export |
Sorry I meant to ask is there reason it's not exported.
Which issue do you mean?
You don't need but I would like it - as I mentioned, it's useful for other projects that might want to use |
https://reviews.llvm.org/D149617
That's two separate things. This "export" is to export to LLVM. When OpenMP is built standalone, there is no "LLVM" to export to, which I think will cause CMake error. When OpenMP is not built standalone, which means it is built in-tree, there will be a LLVM out there to accept targets. In your case, you worked around some build issues by forcing |
Currently you can't build the openmp project (i.e.,
-DLLVM_ENABLE_PROJECTS=mlir;openmp
) without also building clang. This fixes that and enables building the various openmp libs (such aslibomp
) by projects that have no need of clang.