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

Rust interface #129

Merged
merged 43 commits into from
Oct 25, 2023
Merged

Rust interface #129

merged 43 commits into from
Oct 25, 2023

Conversation

scemama
Copy link
Member

@scemama scemama commented Oct 24, 2023

In the rust directory I have put everything to build the Rust interface. I have uploaded it to Crates.io, so that when you do cargo add trexio, you get trexio in your current working project:
https://crates.io/crates/trexio
This package assumes that the C TREXIO library is installed on the system. I will also need to build a Rust crate that installs the TREXIO C library to make it fully functional.

To simplify building interfaces, I added to trexio.h the JSON config that produced it as a static const char* variable. It avoids needing the trexio C source when building the interface.

@q-posev
Copy link
Member

q-posev commented Oct 24, 2023

Amazing, thanks! Could you add installation instructions to the README?

I am a bit concerned about adding this huge string with trex.json contents. How can we make sure there are no overflows? Is there no way around it?

I see that Rust interface is released as 2.4.1 but there is no corresponding release of the TREXIO C API. I think it's important to keep them aligned.

If you want, I can add Rust testing to the CI.

@scemama
Copy link
Member Author

scemama commented Oct 24, 2023

OK, now the rust interface installs HDF5 and compiles trexio. We can merge :-)

ocaml/trexio/trexio.opam Outdated Show resolved Hide resolved
configure.ac Show resolved Hide resolved
README.md Show resolved Hide resolved
@q-posev
Copy link
Member

q-posev commented Oct 25, 2023

Cool, thanks! So you want to keep the TREXIO JSON string in the C header for now?

@scemama
Copy link
Member Author

scemama commented Oct 25, 2023 via email

Copy link
Member

@q-posev q-posev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, I can add CI test for Rust in a separate PR

@q-posev q-posev merged commit 2d3080a into master Oct 25, 2023
3 checks passed
@scemama scemama deleted the rust branch January 11, 2024 13:51
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.

2 participants