# possibility of using f2py for interoperability with Fortran

Although interoperability with Fortran could be realised by using LibraryLink (e.g., Linking FORTRAN with Librarylink), the approach is not so straight forward, in particular for those not familiar with C (such as me).

In comparison with LibraryLink, the numpy tool f2py provides a much easier way to generate Python modules from Fortran code given the users have basic knowledge of Fortran. In fact, the intermediate step of f2py also involves C code, which is similar as the LibraryLink approach.

As such, I'm wondering if it's possible for Mathematica to directly use f2py-generated files to create Mathematica functions?

• The answer to this question is very likely: No. You should have a look at LTemplate. This requires only rather basic C++ knowledge. – Henrik Schumacher Aug 20 '17 at 5:17
• Thanks, @HenrikSchumacher ! The link is very helpful. – sunt05 Aug 20 '17 at 5:28