Skip to content
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

Plan for spglib transition #66

Open
LecrisUT opened this issue Feb 3, 2025 · 3 comments
Open

Plan for spglib transition #66

LecrisUT opened this issue Feb 3, 2025 · 3 comments

Comments

@LecrisUT
Copy link

LecrisUT commented Feb 3, 2025

There are a few topics to discuss

How to provide C and C++ interface

If we can provide a spglib.h compatibility interface, then developing the Fortran equivalent would also be possible. Right now I know the link from CMake to rust is well developed, but I don't know about example of the inverse.

For compatibility purposes we also need a to provide some SpglibConfig.cmake files. This part should be relatively easy to develop using appropriate find_library and such.

Integrating CI coverage

At the minimum we would need coverage for cibuildwheel and various matrix test cases since now the rust version on the system is also a variable.

Packaging concerns

Rust has a more specific packaging guidelines, so it will be a bit more involved to maintain a rust-moyo and moyo package. One thing to note, is that even though rust tends to have static Cargo.lock dependencies, Fedora packaging does not vendor those dependencies and as such, in order to make distro packaging easier, we should track what is available there as well.

One particular issue is that if you use Cargo.lock to define the dependencies you use, you are implicitly responsible for tracking the dependent projects CVE (security issues).

@lan496
Copy link
Member

lan496 commented Feb 4, 2025

I have not tried it yet, but https://github.com/rust-lang/rust-bindgen would be used to generate C and C++ interfaces.
Personally, I want to make the Rust-side build system (currently only using cargo) as small as possible.

@LecrisUT
Copy link
Author

LecrisUT commented Feb 4, 2025

Unfortunately, bindgen does the opposite, i.e. it makes it possible for rust to link to a C/C++ library, instead of creating a header file and dynamic library.

@LecrisUT
Copy link
Author

LecrisUT commented Feb 4, 2025

I have found cbindgen and cxx, which seem to do the linking in the direction that we want.

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

No branches or pull requests

2 participants