8

Is there a tool to automatically generate Fortan bindings from C library header, using intrinsic iso_c_bindings module from Fortran 2003 standard?

I am not interested in translating C to Fortran, but only generating bindings.

M. S. B.
  • 28,968
  • 2
  • 46
  • 73
Jakub Narębski
  • 309,089
  • 65
  • 217
  • 230

2 Answers2

3

An automatic tool was used to get the gtk-fortran bindings. It is a Python script cfwrapper.py. You might be able to adapt it to for your needs, although for my small problems I finally chose to make the bindings by hand.

1

Another project to consider is h2m: https://github.com/dan-nagle/h2m

However, at this time, on macOS, I cannot successfully compile h2m.

zbeekman
  • 648
  • 7
  • 15