Skip to content

Lam/jlib#226

Open
lamorton wants to merge 8 commits into
D3DEnergetic:masterfrom
lamorton:lam/jlib
Open

Lam/jlib#226
lamorton wants to merge 8 commits into
D3DEnergetic:masterfrom
lamorton:lam/jlib

Conversation

@lamorton

Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant