-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] API changes for Julia bindings #1016
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me this looks fine. There are no breaking changes, and .h file serves its purpose for Julia bindings. Later we can get back to a discussion how to improve it.
Any opinion on this @simonpintarelli, @mtaillefumier ? |
No major objections especially if the header file generated automatically. |
The docstrings are now duplicated in the header and in |
Good catch @simonpintarelli ! However, I would still use sirius_api.cpp as a source of truth for the documentation and a bare header file only for Julia bindings. @abussy will it be possible to cleanup .h file from the doc. comments? |
My script to generate Julia bindings makes use of the docstrings. I am also not sure I could get the data from |
This PR brings some changes to the API, in order to facilitate the creation of Julia bindings for SIRIUS in a future SIRIUS.jl package. Apart from the additions of new functions to sirius_api.cpp (necessary for the DFTK integration), the main addition consists of a header file for the API: sirius_c_headers.h. It turns out that having a header file drastically simplifies the process of creating Julia bindings for a C/C++ library. As things stand, this header file is generated by a script (generate_c_headers.py), in the same spirit as the Fortran API. As a result, it is not used for compilation, but only as source material for the automatic generation of Julia bindings.
This PR brings some changes to the API, in order to facilitate the creation of Julia bindings for SIRIUS in a future
SIRIUS.jl
package.Apart from the additions of new functions to
sirius_api.cpp
(necessary for theDFTK
integration), the main addition consists of a header file for the API:sirius_c_headers.h
. It turns out that having a header file drastically simplifies the process of creating Julia bindings for a C/C++ library.As things stand, this header file is generated by a script (
generate_c_headers.py
), in the same spirit as the Fortran API. As a result, it is not used for compilation, but only as source material for the automatic generation of Julia bindings.The above point is why this PR is marked as WIP. I believe we might want to have a discussion as to whether we follow this direction, or if we decide to have a proper header file that we also use for compilation.