Skip to content

[Flang-rt] Forward libomp-mod dependency for non-default runtime builds #137035

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jhuber6
Copy link
Contributor

@jhuber6 jhuber6 commented Apr 23, 2025

Summary:
Currently this is required to inject the dependnecy so the object is
built when targeting OpenMP. This was only applied to the
runtime_register_default_target which only applies to
LLVM_ENABLE_RUNTIMES. The user could concievably do cross-compiling,
or just manually specify the host architecture and it would then error.

…ilds

Summary:
Currently this is required to inject the dependnecy so the object is
built when targeting OpenMP. This was only applied to the
`runtime_register_default_target` which only applies to
`LLVM_ENABLE_RUNTIMES`. The user could concievably do cross-compiling,
or just manually specify the host architecture and it would then error.
Copy link
Member

@Meinersbur Meinersbur left a comment

Choose a reason for hiding this comment

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

Cross-compiling using Flang currently is not supported. Another problem is that each LLVM_RUNTIME_TARGETS will write their own omp_mod.lib to the same location, so it was intentional that only the default target would do it. The flang tests assume the default target anyway.

@jhuber6
Copy link
Contributor Author

jhuber6 commented Apr 24, 2025

Cross-compiling using Flang currently is not supported. Another problem is that each LLVM_RUNTIME_TARGETS will write their own omp_mod.lib to the same location, so it was intentional that only the default target would do it. The flang tests assume the default target anyway.

FYI, this form doesn't always imply cross-compiling. You can do -DRUNTIMES_x86_64-unknown-linux-gnu_LLVM_ENABLE_RUNTIMES=flang-rt. However, it will add the handling for CMAKE_CXX_COMPILER_TARGET which might add the --target= flag, but I think that's handled in flang currently.

@Meinersbur
Copy link
Member

Can it wait for after #137828 ? It will introduce different .mod locations per target, so they would not overwrite each other anymore.

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.

2 participants