-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat: c++ bindings #41
Conversation
f429c0a
to
49a8011
Compare
49a8011
to
829fc70
Compare
I have ported most of resolvo to C++ and I can share if you think there is any value to it. I am currently struggling with DisplayUnsat though. Just a heads up. |
Definitely, that would be amazing to see! I also know that the mamba-team is looking into this! cc @JohanMabille @jjerphan |
Please check your email. I have sent what I have so far. I was planning to contact you when it would have been fully completed. |
Amazing! |
@jerily That's amazing! Great work! But I have to wonder, wouldn't you be able to use the bindings we just merged? I would very much like to consolidate efforts instead of fragmenting. I feel like it would be more beneficial for the larger community to all focus our efforts on a single code base than to have multiple implementations. That is exactly why I created these bindings in the first place. If you are missing things from our bindings, or if they are not accessible enough, I would be more than happy to figure out how we can make it better for your use case too! :) |
Thanks a lot! I started this port because there was nothing like it a few months back. I will have to check out the C++ bindings and if they suit my needs, yes, I will use them. I must say though that everything I build these days (in open source I mean) it's C/C++ so not sure where rust fits into that picture. That said, I'm not looking to compete with resolvo. I'm glad it exists and I hope it prospers further. I just want to build the tool I am working on in way that makes sense to me. I just shared the code in case someone finds it valuable. That's all :) |
@jerily Makes sense! You should be able to use our bindings using something akin to (from the top of my head): include(FetchContent)
FetchContent_Declare(
Resolvo
GIT_REPOSITORY https://github.com/mamba-org/resolvo.git
GIT_TAG resolvo_cpp-v0.1.0)
FetchContent_MakeAvailable(Resolvo) You should then have a The only downside of this approach is that you need to have Rust installed on your system. I am also creating a conda package that has prebuilt binaries and doesn't require any Rust. (Not sure how familiar you are using that). Should be online in a few hours! If you try this out, please share your thoughts! I would be very happy to facilitate making the bindings easier to use. |
Thanks! I will check it out this week. At work at the moment - Java & Python :) |
I have tried out the C++ bindings. Here are few notes:
|
Figured out where the nice graph is. I am good! |
@jerily great! If you have suggestions for the API or if you have examples you can share Id love to hear it! |
Just getting started. A quick one though is the for loop in display_merged_solvables. It needs to be:
|
Would you be able to open a PR? |
Just got back from theater. I'm on it now. |
Hi @jerily, would you be interested in publishing your C++ port of resolvo on GitHub? :) |
Hi @jjerphan , yes, sure. Please note that DisplayUnsat is not finished and I turned to using C++ bindings myself. I can either place it on github now as it stands or finish it and then publish it by end of July. Please let me know what works for you best. |
I would encourage you to publish it on GitHub, we might have been able to contribute to it to help you if we have time. 🙂 |
Here it is: https://github.com/jerily/resolvo-cpp I should be able to resume work on it after July 20. |
Renamed the project to avoid clash with resolvo to satdepsolver-cpp: https://github.com/jerily/satdepsolver-cpp Please let me know if that's ok. |
Builds on #40
This PR adds preliminary C++ bindings. There is still stuff missing with regards to documentation and a proper CMake install but the functionality is there. A test that shows how to use the bindings can be found here: https://github.com/baszalmstra/resolvo/blob/feat/cpp_bindings/cpp/tests/solve.cpp#L165
My C++ is quite rusty (pun intended) so feedback is definitely welcome!
I added a
pixi.toml
to quickly get started with the code. Simply run:to build and run the C++ tests.