Julia autodiff result exporting to Fortran

Hi all,

I am working on an optimization problem in Fortran and I need a gradient of a function. Fortran does not have a good autodiff library so I am thinking of writing the Fortran function in Julia, using Julia autodiff to generate the gradient and exporting the autodiff result back to Fortran to be used. Has anyone done something like this before? And willing to share your experience?

Thanks!

1 Like

This might work, but is there a good reason not to do the optimization in Julia as well? This would likely be a bunch easier.

I’d love to. Unfortunately, it’s part of a huge Fortran library/system which will be tough to be re-written in Julia, at least in the short term.