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

Remove need for libokapi.a and okapi.h when building go libraries #405

Merged
merged 4 commits into from
May 11, 2022

Conversation

fundthmcalculus
Copy link
Contributor

@fundthmcalculus fundthmcalculus commented May 10, 2022

closes #404 - and can throw a library not found error. LOL.
On windows, we use syscall.LoadDLL and no CGO required at all. On MacOS and Linux, we use dlopen to find the function pointer which is called from a bit of CGO in the header. This doesn't eliminate the CGO requirement, but eliminates the need to install the okapi.h and libokapi.a files

@fundthmcalculus fundthmcalculus requested a review from sethjback May 10, 2022 21:08
@fundthmcalculus fundthmcalculus enabled auto-merge (squash) May 10, 2022 21:11
@github-actions
Copy link
Contributor

github-actions bot commented May 10, 2022

Golang Test Report

  3 files    3 suites   0s ⏱️
15 tests 14 ✔️ 0 💤 1
29 runs  28 ✔️ 0 💤 1

For more details on these failures, see this check.

Results for commit 20e3afc.

♻️ This comment has been updated with latest results.

@tmarkovski
Copy link
Contributor

Awesome. Can we ensure some support for arm64, too, while we're at the point of reworking this?

@fundthmcalculus
Copy link
Contributor Author

I'll verify again, but arm64 was already supported. :) I've run this on a raspberry pi.

@fundthmcalculus
Copy link
Contributor Author

Built and tested on my M1 macbook air, confirms functionality.

@fundthmcalculus fundthmcalculus changed the title go support dll loading, no more CGO! :) Remove need for libokapi.a and okapi.h when building go libraries May 11, 2022
@fundthmcalculus fundthmcalculus merged commit c8848cb into main May 11, 2022
@fundthmcalculus fundthmcalculus deleted the okapi-404-go-dynamic-link branch May 11, 2022 23:28
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.

Remove need for libokapi.a and okapi.h when building go libraries
2 participants