Create Fortran bindings module#2807
Conversation
|
Is |
Both are common although I suppose |
Done in 27b7edc. |
| @@ -1,5 +1,5 @@ | |||
| cmake_minimum_required(VERSION 3.13) | |||
| project(Enzyme) | |||
| project(Enzyme LANGUAGES C CXX Fortran) | |||
There was a problem hiding this comment.
Without adding Fortran to the languages in the project, I get the CMake error
FortranCInterface requires the Fortran language to be enabled
when building Enzyme. If I remove that from Fortran/CMakeLists.txt then I get
CMake can not determine linker language for target: EnzymeFortran
There was a problem hiding this comment.
Fixed in 0479c37 by enabling Fortran in the subdir rather than globally.
There was a problem hiding this comment.
Also added a CMake option ENZYME_FORTRAN in 827e439 that's defaulted to off like the other Fortran-related options. Turning it on builds the bindings.
Closes #2805
Thanks to @isaacaka for figuring out how to make use of activity descriptors in Fortran: bind to those that Enzyme picks up in C. To avoid users having to know how to do Fortran-C binding, we thought it would be beneficial to create a Fortran module containing these for convenience. There will likely be other things that come up that we can add to the module later in the project.
To use these descriptors in Fortran, import them with
or just
Checklist