Skip to content

[offload] - Add omp as a dependency for clang-bootstrap-deps #90793

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

Merged
merged 1 commit into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions llvm/runtimes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,13 @@ if(runtimes)
# We need to add the runtimes as a dependency because compiler-rt can be
# built as part of runtimes and we need the profile runtime for PGO
add_dependencies(clang-bootstrap-deps runtimes)
# The bootstrap build will attempt to configure the offload runtime
# before the openmp project which will error out due to failing to
# find libomp.so. We must add omp as a dependency before runtimes
# are configured.
if("openmp" IN_LIST LLVM_ENABLE_PROJECTS AND "offload" IN_LIST LLVM_ENABLE_RUNTIMES)
add_dependencies(clang-bootstrap-deps omp)
endif()
endif()

if(LLVM_INCLUDE_TESTS)
Expand Down
13 changes: 8 additions & 5 deletions offload/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,6 @@ if(OPENMP_STANDALONE_BUILD)
${LLVM_LIBRARY_DIRS}
REQUIRED
)
# Check LIBOMP_HAVE_VERSION_SCRIPT_FLAG
include(LLVMCheckCompilerLinkerFlag)
if(NOT APPLE)
llvm_check_compiler_linker_flag(C "-Wl,--version-script=${CMAKE_CURRENT_LIST_DIR}/../openmp/runtime/src/exports_test_so.txt" LIBOMP_HAVE_VERSION_SCRIPT_FLAG)
endif()

macro(pythonize_bool var)
if (${var})
Expand All @@ -282,6 +277,14 @@ if(OPENMP_STANDALONE_BUILD)
endmacro()
endif()

if(OPENMP_STANDALONE_BUILD OR TARGET omp)
# Check LIBOMP_HAVE_VERSION_SCRIPT_FLAG
include(LLVMCheckCompilerLinkerFlag)
if(NOT APPLE)
llvm_check_compiler_linker_flag(C "-Wl,--version-script=${CMAKE_CURRENT_LIST_DIR}/../openmp/runtime/src/exports_test_so.txt" LIBOMP_HAVE_VERSION_SCRIPT_FLAG)
endif()
endif()

# OMPT support for libomptarget
# Follow host OMPT support and check if host support has been requested.
# LIBOMP_HAVE_OMPT_SUPPORT indicates whether host OMPT support has been implemented.
Expand Down
Loading