Automated Fortran--C++ Bindings for Large-Scale Scientific Applications
This addresses the need for easier integration of modern software libraries into large-scale scientific applications written in Fortran, though it is incremental as it builds on existing binding techniques.
The paper tackles the problem of providing C and C++ library features to Fortran codes by introducing a tool that automatically generates native Fortran 2003 interfaces, demonstrating minimal performance impact in timing measurements with a mock numerical library.
Although many active scientific codes use modern Fortran, most contemporary scientific software "libraries" are implemented in C and C++. Providing their numerical, algorithmic, or data management features to Fortran codes requires writing and maintaining substantial amounts of glue code. This article introduces a tool that automatically generates native Fortran 2003 interfaces to C and C++ libraries. The tool supports C++ features that have no direct Fortran analog, such as templated functions and exceptions. A set of simple examples demonstrate the utility and scope of the tool, and timing measurements with a mock numerical library illustrate the minimal performance impact of the generated wrapper code.