-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[Libomp] Place generated OpenMP headers into build resource directory #88007
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,12 +10,19 @@ | |
|
||
include(ExtendPath) | ||
|
||
# The generated headers will be placed in clang's resource directory if present. | ||
if(${OPENMP_STANDALONE_BUILD}) | ||
set(LIBOMP_HEADERS_INTDIR ${CMAKE_CURRENT_BINARY_DIR}) | ||
else() | ||
set(LIBOMP_HEADERS_INTDIR ${LLVM_BINARY_DIR}/${LIBOMP_HEADERS_INSTALL_PATH}) | ||
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. Is 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. LLVM is always built, I don't think it's possible to turn it off. Everything goes through 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. Is it 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. Done to match 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. oh "intermediate" |
||
endif() | ||
|
||
# Configure omp.h, kmp_config.h and omp-tools.h if necessary | ||
configure_file(${LIBOMP_INC_DIR}/omp.h.var omp.h @ONLY) | ||
configure_file(${LIBOMP_INC_DIR}/ompx.h.var ompx.h @ONLY) | ||
configure_file(kmp_config.h.cmake kmp_config.h @ONLY) | ||
configure_file(${LIBOMP_INC_DIR}/omp.h.var ${LIBOMP_HEADERS_INTDIR}/omp.h @ONLY) | ||
configure_file(${LIBOMP_INC_DIR}/ompx.h.var ${LIBOMP_HEADERS_INTDIR}/ompx.h @ONLY) | ||
configure_file(kmp_config.h.cmake ${LIBOMP_HEADERS_INTDIR}/kmp_config.h @ONLY) | ||
if(${LIBOMP_OMPT_SUPPORT}) | ||
configure_file(${LIBOMP_INC_DIR}/omp-tools.h.var omp-tools.h @ONLY) | ||
configure_file(${LIBOMP_INC_DIR}/omp-tools.h.var ${LIBOMP_HEADERS_INTDIR}/omp-tools.h @ONLY) | ||
endif() | ||
|
||
# Generate message catalog files: kmp_i18n_id.inc and kmp_i18n_default.inc | ||
|
@@ -419,15 +426,15 @@ else() | |
endif() | ||
install( | ||
FILES | ||
${CMAKE_CURRENT_BINARY_DIR}/omp.h | ||
${CMAKE_CURRENT_BINARY_DIR}/ompx.h | ||
${LIBOMP_HEADERS_INTDIR}/omp.h | ||
${LIBOMP_HEADERS_INTDIR}/ompx.h | ||
DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH} | ||
) | ||
if(${LIBOMP_OMPT_SUPPORT}) | ||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/omp-tools.h DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH}) | ||
install(FILES ${LIBOMP_HEADERS_INTDIR}/omp-tools.h DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH}) | ||
# install under legacy name ompt.h | ||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/omp-tools.h DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH} RENAME ompt.h) | ||
set(LIBOMP_OMP_TOOLS_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE) | ||
install(FILES ${LIBOMP_HEADERS_INTDIR}/omp-tools.h DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH} RENAME ompt.h) | ||
set(LIBOMP_OMP_TOOLS_INCLUDE_DIR ${LIBOMP_HEADERS_INTDIR} PARENT_SCOPE) | ||
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. FYI this is only required if the build is standalone now. The regular build will always have these included via the resource dir now. |
||
endif() | ||
if(${BUILD_FORTRAN_MODULES}) | ||
set (destination ${LIBOMP_HEADERS_INSTALL_PATH}) | ||
|
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.
Are these changes required to make this work?
Uh oh!
There was an error while loading. Please reload this page.
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.
Yes, this now installed
omp.h
in a place where the tests will sometimes find it. In that case we need these extra definitions to make it work.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.
Alternatively we could just delete this
stdint.h
altogether, because this only happens because it's using this one instead. But I assume that we override the regularstdint.h
to reduce the number of live definitions in tests or something.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 header is useful when invoking front end directly such that we don't need to pass things like
-internal-isystem
which usually are added by compiler driver.