November 2023

Journal

Automated Fortran–C++ Bindings for Large-Scale Scientific Applications

By:
Johnson, Seth R; Prokopenko, Andrey V; Evans, Katherine J
Journal Name:
Computing in Science & Engineering
Page Number:
84-94
Volume:
22
Issue Number:
5
Publication Date:
November 9, 2023
View DOI Listing:
https://doi.org/10.1109/MCSE.2019.2924204

Abstract

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 paper 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 demonstrates 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.