This is my first pass at making Python & Julia interfaces to subroutines in fidasim.f90 module libfida. I modified the make instructions to produce a .so shared object for the Fortran wrappers in cx_helper.f90. This file uses C bindings to avoid Fortran name-mangling & standardize the numeric kinds. The wrappers also to manage hidden global variables (ex: atomic tables) to allow the subroutines to function autonomously. This approach does not require modifications to fidasim.f90. However, it might be more convenient in the future to bring the C bindings directly into fidasim.f90.
Julia uses ccall to easily call the shared library. I'm using the CFFI (C foreign function interface) library in Python. There's a lot of boilerplate involved.
This is my first pass at making Python & Julia interfaces to subroutines in
fidasim.f90
modulelibfida
. I modified themake
instructions to produce a.so
shared object for the Fortran wrappers incx_helper.f90.
This file uses C bindings to avoid Fortran name-mangling & standardize the numerickinds
. The wrappers also to manage hidden global variables (ex: atomic tables) to allow the subroutines to function autonomously. This approach does not require modifications tofidasim.f90.
However, it might be more convenient in the future to bring the C bindings directly intofidasim.f90
.Julia uses
ccall
to easily call the shared library. I'm using theCFFI
(C foreign function interface) library in Python. There's a lot of boilerplate involved.