-
Notifications
You must be signed in to change notification settings - Fork 14.5k
[Offload] Remove unnecessary omp CMake target dependencies #149060
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
[Offload] Remove unnecessary omp CMake target dependencies #149060
Conversation
ac4d5f0
to
bc38c06
Compare
@llvm/pr-subscribers-offload Author: Kenneth Benzie (Benie) (kbenzie) ChangesIn my quest to build This patch removes dependencies on the Full diff: https://github.com/llvm/llvm-project/pull/149060.diff 3 Files Affected:
diff --git a/offload/libomptarget/CMakeLists.txt b/offload/libomptarget/CMakeLists.txt
index 93e684e53bf17..f37e984504167 100644
--- a/offload/libomptarget/CMakeLists.txt
+++ b/offload/libomptarget/CMakeLists.txt
@@ -1,11 +1,5 @@
message(STATUS "Building offloading runtime library libomptarget.")
-if(LIBOMP_STANDALONE)
- set(LIBOMP ${LIBOMP_STANDALONE})
-else()
- set(LIBOMP omp)
-endif()
-
add_llvm_library(omptarget
SHARED
@@ -33,10 +27,6 @@ add_llvm_library(omptarget
Support
Object
- LINK_LIBS
- PUBLIC
- ${LIBOMP}
-
NO_INSTALL_RPATH
BUILDTREE_ONLY
)
diff --git a/offload/tools/deviceinfo/CMakeLists.txt b/offload/tools/deviceinfo/CMakeLists.txt
index 3787c12f940a6..6edc4f057c8c9 100644
--- a/offload/tools/deviceinfo/CMakeLists.txt
+++ b/offload/tools/deviceinfo/CMakeLists.txt
@@ -8,6 +8,5 @@ target_include_directories(llvm-offload-device-info PRIVATE
${LIBOMPTARGET_INCLUDE_DIR}
)
target_link_libraries(llvm-offload-device-info PRIVATE
- omp
omptarget
)
diff --git a/offload/tools/kernelreplay/CMakeLists.txt b/offload/tools/kernelreplay/CMakeLists.txt
index 690edd6d5a68e..931b1947fffb4 100644
--- a/offload/tools/kernelreplay/CMakeLists.txt
+++ b/offload/tools/kernelreplay/CMakeLists.txt
@@ -9,6 +9,5 @@ target_include_directories(llvm-omp-kernel-replay PRIVATE
)
target_link_libraries(llvm-omp-kernel-replay PRIVATE
LLVMSupport
- omp
omptarget
)
|
In my quest to build `liboffload` with ASAN enabled I've been looking into decoupling `offload` and `openmp` project entablement. When removing `openmp` from `LLVM_ENABLE_PROJECTS` it resulted in failure to link against the `omp` target. As an experiment I disabled that dependency and the build appears to work as expected. This patch removes dependencies on the `omp` target from `libomptarget`/`llvm-offload-device-info`/`llvm-omp-kernel-replay` targets.
bc38c06
to
b330783
Compare
IIRC there are indeed some function calls from |
Yeah, there are a few but I forget which ones. Did this really build and pass the tests? |
The build works with and without Would |
Yes, there's some |
Is #136729 related to that? I'm wondering if it would it be possible to move the implementations of these libomp entry points into libomptarget and have libomp be implemented in terms of libomptarget rather than this circular dependency situation? |
Yes, it's related but only moves out the OpenMP device library. What we should do is re-write |
It works because a program always links |
Those |
Okay, thanks for the info. I'll close this. |
In my quest to build
liboffload
with ASAN enabled I've been looking into decouplingoffload
andopenmp
project entablement. When removingopenmp
fromLLVM_ENABLE_PROJECTS
it resulted in failure to link against theomp
target. As an experiment I disabled that dependency and the build appears to work as expected.This patch removes dependencies on the
omp
target fromlibomptarget
/llvm-offload-device-info
/llvm-omp-kernel-replay
targets.