-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[offload] Standalone build fixes #118173
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
[offload] Standalone build fixes #118173
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8d221f6
[offload] Include CheckCXXCompilerFlag in CMake
mgorny 369c35f
[offload] [test] Add "omp" test dependency only when present
mgorny 447dc19
[offload] Define OPENMP_TEST*_FLAGS in standalone builds
mgorny 3ad5b3b
[offload] Define LIBOMPTARGET_OPENMP_*_FOLDER in standalone builds
mgorny b71f0f4
[offload] Fix path to llvm-offload-device-info in standalone build
mgorny 8088712
[offload] [test] Add missing dependency on llvm-offload-device-info
mgorny dcdf3fb
[offload] Move additional plugin dependencies to add_target_library
mgorny 931cf3c
[cmake] Use DetectTestCompiler from openmp directory
mgorny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,9 @@ if (OPENMP_STANDALONE_BUILD) | |
# Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR. | ||
set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}") | ||
|
||
# Used by llvm_add_tool() and tests. | ||
set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}) | ||
|
||
# Group test settings. | ||
set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING | ||
"C compiler to use for testing OpenMP runtime libraries.") | ||
|
@@ -129,6 +132,7 @@ include(LibomptargetGetDependencies) | |
# Set up testing infrastructure. | ||
include(OpenMPTesting) | ||
|
||
include(CheckCXXCompilerFlag) | ||
check_cxx_compiler_flag(-Werror=global-constructors OFFLOAD_HAVE_WERROR_CTOR) | ||
|
||
# LLVM source tree is required at build time for libomptarget | ||
|
@@ -286,6 +290,26 @@ if(OPENMP_STANDALONE_BUILD) | |
${LLVM_LIBRARY_DIRS} | ||
REQUIRED | ||
) | ||
|
||
find_path ( | ||
LIBOMP_INCLUDE_DIR | ||
NAMES | ||
omp.h | ||
HINTS | ||
${COMPILER_RESOURCE_DIR}/include | ||
${CMAKE_INSTALL_PREFIX}/include | ||
) | ||
|
||
get_filename_component(LIBOMP_LIBRARY_DIR ${LIBOMP_STANDALONE} DIRECTORY) | ||
|
||
set(OPENMP_TEST_FLAGS "" CACHE STRING | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are basically pulling in things from |
||
"Extra compiler flags to send to the test compiler.") | ||
set(OPENMP_TEST_OPENMP_FLAGS ${OPENMP_TEST_COMPILER_OPENMP_FLAGS} CACHE STRING | ||
"OpenMP compiler flag to use for testing OpenMP runtime libraries.") | ||
set(LIBOMPTARGET_OPENMP_HEADER_FOLDER "${LIBOMP_INCLUDE_DIR}" CACHE STRING | ||
"Path to folder containing omp.h") | ||
set(LIBOMPTARGET_OPENMP_HOST_RTL_FOLDER "${LIBOMP_LIBRARY_DIR}" CACHE STRING | ||
"Path to folder containing libomp.so, and libLLVMSupport.so with profiling enabled") | ||
endif() | ||
|
||
macro(pythonize_bool var) | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The fact that
offload
is still depending onlibomp
is a disaster…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.
I will forever maintain that only the plugins should've been moved. Maybe it's not too late to do that instead.