Skip to content

[runtimes] Fix OpenMP dependencies #85977

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
Mar 21, 2024
Merged

[runtimes] Fix OpenMP dependencies #85977

merged 1 commit into from
Mar 21, 2024

Conversation

uweigand
Copy link
Member

When building the OpenMP runtime with libomptarget support, the runtimes configure step needs to have a dependency on various tools, in particular opt, so that cmake configure checks yield the correct results.

This did not work correctly, as the dependencies were only added if the OPENMP_ENABLE_LIBOMPTARGET was set - but that variable is only set by the openmp/CMakeLists.txt file, which isn't even parsed during the initial cmake run (in fact, it is only parsed when executing the runtimes configure step itself, but then it is too late).

Fixed by just adding those dependencies always.

In addition, the list of dependencies collected in ${extra_deps}, including those required for OpenMP, was only actually used when configuring runtimes for the default set of targets - when the user specifies a non-default LLVM_RUNTIME_TARGETS, those extra dependencies were ignored (with the exception of ${hdrgen_deps}).

Fixed by passing the full ${extra_deps} in this case as well.

Fixes: #85933

When building the OpenMP runtime with libomptarget support, the
runtimes configure step needs to have a dependency on various
tools, in particular opt, so that cmake configure checks yield
the correct results.

This did not work correctly, as the dependencies were only added
if the OPENMP_ENABLE_LIBOMPTARGET was set - but that variable is
only set by the openmp/CMakeLists.txt file, which isn't even
parsed during the initial cmake run (in fact, it is only parsed
when executing the runtimes configure step itself, but then it
is too late).

Fixed by just adding those dependencies always.

In addition, the list of dependencies collected in ${extra_deps},
including those required for OpenMP, was only actually used when
configuring runtimes for the default set of targets - when the
user specifies a non-default LLVM_RUNTIME_TARGETS, those extra
dependencies were ignored (with the exception of ${hdrgen_deps}).

Fixed by passing the full ${extra_deps} in this case as well.

Fixes: llvm#85933
@uweigand uweigand requested a review from jhuber6 March 20, 2024 17:42
Copy link
Contributor

@jhuber6 jhuber6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@uweigand uweigand merged commit e8cf175 into llvm:main Mar 21, 2024
@uweigand uweigand deleted the openmp-deps branch March 21, 2024 11:05
chencha3 pushed a commit to chencha3/llvm-project that referenced this pull request Mar 23, 2024
When building the OpenMP runtime with libomptarget support, the runtimes
configure step needs to have a dependency on various tools, in
particular opt, so that cmake configure checks yield the correct
results.

This did not work correctly, as the dependencies were only added if the
OPENMP_ENABLE_LIBOMPTARGET was set - but that variable is only set by
the openmp/CMakeLists.txt file, which isn't even parsed during the
initial cmake run (in fact, it is only parsed when executing the
runtimes configure step itself, but then it is too late).

Fixed by just adding those dependencies always.

In addition, the list of dependencies collected in ${extra_deps},
including those required for OpenMP, was only actually used when
configuring runtimes for the default set of targets - when the user
specifies a non-default LLVM_RUNTIME_TARGETS, those extra dependencies
were ignored (with the exception of ${hdrgen_deps}).

Fixed by passing the full ${extra_deps} in this case as well.

Fixes: llvm#85933
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[OpenMP] Dependency on "opt" during runtimes-configure may be missing
2 participants