Call Rust from Fortran

August 12, 2023 ยท View on GitHub

This is an example project that shows how to call Rust from Fortran.

Project structure:

  • src contains the Fortran source code and the equivalent C source code
  • rust contains the Rust source code
  • CMakeLists.txt is the CMake file that builds the project
  • cmake/rust.cmake tells CMake how to build and link the Rust code

Build

To build the project, run the following commands:

mkdir build
cd build
cmake ..
cmake --build .

or just click your IDE's build button.

Additional Material

Call Fortran from Rust

See https://github.com/harbik/dierckx-sys