Add implicit interfaces for function hooks in Fortran module#2809
Conversation
|
Huh, looks like ifx doesn't like externals with leading underscores. I hadn't tested this with that compiler yet (just flang). |
d249dc7 to
3c11497
Compare
Fixed in 237ebc6 by prepending with |
Co-authored-by: Valentin Churavy <v.churavy@gmail.com>
|
Hm ifx still doesn't seem happy. I should have some time to debug later in the week. |
|
Currently we test Fortran integration with LLVM 15, we eventually need to update that. I just wanted to use an Enzyme build with LLVM 21 and ran into |
|
To debug the current failure: So the additional indirection is hiding things. |
|
So the issue only exists at at |
|
I was playing around with: and variations thereof, but nothing seems to stick. Adding does work but is kinda silly. The options I see is:
|
Alas. My debugging today has also not really revealed any ways forward with ifx. I'll work on setting up a flang CI so that we can test the bindings under that compiler (works fine for me so far) and I guess we can return to ifx later. |
|
I think the conclusion from Monday was to go with |
Reverted in 57855fa. |
So ifx still doesn't like this at O0 |
Okay that passes. @vchuravy How about we revert back to the neater |
Pushed this proposal in recent commits. Eventually we want the docs to live on the webpage but a README should be sufficient at this stage. |
Closes #2808.
Merges into #2807.As mentioned in the issue, it turns out that the interfacing to the special Enzyme function hooks can be done using implicit interfaces in Fortran. That is, you can get away without providing an explicit
interfaceblock like is done in the examples so long as you declarefor example.
Checklist
enzymemodulesquareexampleHooking up in the
allocatableArraySimpleexample will require fixing #2820.