ecmwf-ifs / field_api

Apache License 2.0
3 stars 8 forks source link

CMake: Export OpenACC symbols via INTERFACE target linking #56

Closed mlange05 closed 2 months ago

mlange05 commented 2 months ago

Note: This is an alternative implementation to #54 that solves the same problem.

Recap of the problem: Due to FIELD API exporting the OpenACC target via PUBLIC, we cannot select upstream for which component to enable OpenACC offload and for which to disable it.

In this implementation we downgrade this to exporting OpenACC via INTERFACE so that all header paths are propagated, but OpenACC can still be selected by the user component. This, in turn requires the internal tests to now explicitly link against OpenACC and set the -cuda flag, if enabled (thanks to @awnawab for the fixes; I copied them from #54 ).

@dareg Could you please confirm that this is backward compatible with the MF build system?

Edit: Tested and confirmed working with H24 regression testing.