This is an archive of the discontinued LLVM Phabricator instance.

[openmp] Tighten flang detection in offloading test
ClosedPublic

Authored by elmcdonough on Aug 29 2023, 9:35 PM.

Details

Summary

This patch ensures that the locally built version of flang when building in-tree. find_program sometimes used the wrong executable if a different copy of flang was installed.

Diff Detail

Event Timeline

elmcdonough created this revision.Aug 29 2023, 9:35 PM
Herald added a project: Restricted Project. · View Herald Transcript
elmcdonough requested review of this revision.Aug 29 2023, 9:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2023, 9:35 PM

didn't the docs say something about specifying a flang compiler via cmake? Is that still a thing?

didn't the docs say something about specifying a flang compiler via cmake? Is that still a thing?

If you're building out of tree, you can specify where flang by setting OPENMP_TEST_Fortran_COMPILER manually. The first version of this patch attempted to check if flang was present by reading the LLVM_ENABLE_PROJECTS value, but that didn't work as intended. That value was always blank when the tests were being built.

didn't the docs say something about specifying a flang compiler via cmake? Is that still a thing?

If you're building out of tree, you can specify where flang by setting OPENMP_TEST_Fortran_COMPILER manually. The first version of this patch attempted to check if flang was present by reading the LLVM_ENABLE_PROJECTS value, but that didn't work as intended. That value was always blank when the tests were being built.

But will this not overwrite that flag and render it useless? I am confused.

didn't the docs say something about specifying a flang compiler via cmake? Is that still a thing?

If you're building out of tree, you can specify where flang by setting OPENMP_TEST_Fortran_COMPILER manually. The first version of this patch attempted to check if flang was present by reading the LLVM_ENABLE_PROJECTS value, but that didn't work as intended. That value was always blank when the tests were being built.

But will this not overwrite that flag and render it useless? I am confused.

This only applies if the project is built in-tree. A compiler can be specified in a standalone build.

jdoerfert accepted this revision.Sep 1 2023, 11:11 AM

I c. Thx, LG

This revision is now accepted and ready to land.Sep 1 2023, 11:11 AM
This revision was landed with ongoing or failed builds.Sep 1 2023, 11:59 AM
This revision was automatically updated to reflect the committed changes.