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

Add c bindings + Updated camke builds #166

Merged
merged 20 commits into from
Mar 7, 2024
Merged

Add c bindings + Updated camke builds #166

merged 20 commits into from
Mar 7, 2024

Conversation

cmmarslender
Copy link
Contributor

@cmmarslender cmmarslender commented Mar 7, 2024

The initial goal here was to make c wrappers for create_discriminant, prove and verify_n_wesolowski that mirrors the python bindings, but returns c types. This then enables me to call these from go bindings (which don't support c++ types, only c). I created those wrappers, then needed to (optionally) build the shared and static libraries for all our supported platforms, via cmake.

Well, this then required the cmake file to support windows. Once we had the windows support in cmake, it made sense to apply the same patterns from other repos (such as chiapos) to simplify the setup.py to use cmake for windows as well, instead of the split logic for windows/not-windows that previously existed.

So this PR does two things:

  1. Adds the c wrappers for the 3 functions I need to bind to go
  2. Changes the wheel process to also build wheels via cmake

Testing

  1. The wheels build and the CI tests pass
  2. Downloaded the windows wheels from the new builds and before, and the contents are the same. Expected .dlls are in both versions
  3. Installed latest chia from source on windows, pip uninstall chiavdf, and installed the version from this branch. Node was able to sync new blocks.

For now, the c libraries just exist as artifacts on the new workflow. May update this later to package into something a bit easier to consume downstream, but that can be in a follow on PR

@cmmarslender cmmarslender changed the title Add c bindings for create_discriminant, prove, and verify_n_wesolowski Add c bindings + Updated camke builds Mar 7, 2024
@cmmarslender cmmarslender marked this pull request as ready for review March 7, 2024 21:18
Copy link
Member

@hoffmang9 hoffmang9 left a comment

Choose a reason for hiding this comment

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

lgtm

@cmmarslender cmmarslender merged commit 2e9bc3e into main Mar 7, 2024
51 checks passed
@cmmarslender cmmarslender deleted the c-bindings branch March 7, 2024 21:26
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