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 coderust
contains the Rust source codeCMakeLists.txt
is the CMake file that builds the projectcmake/rust.cmake
tells CMake how to build and link the Rust code
To build the project, run the following commands:
mkdir build
cd build
cmake ..
cmake --build .
or just click your IDE's build button.