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?

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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.