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

Mac OS support #1

Open
knoguchi opened this issue Apr 2, 2017 · 2 comments
Open

Mac OS support #1

knoguchi opened this issue Apr 2, 2017 · 2 comments

Comments

@knoguchi
Copy link

knoguchi commented Apr 2, 2017

I would like to add Mac OS support, and create multi arch jar. I thought I could run jnaerator and generate the binding but this seems to be the hardest part. jnaerator often crashes with NPE or generate incomplete code. Would you tell me where to start? thanks

@knoguchi
Copy link
Author

knoguchi commented Apr 3, 2017

I got it working with a bit of patch, and manually copied dynamic libraries to src/main/resources/lib/darwin-x86_64 directory. FYI, the generated JNA sources work for both Linux and Darwin native libs. To make sure, I generated them on both OS, and compared. They match exactly.

https://github.com/knoguchi/jjq/blob/mac/src/main/java/com/github/bskaggs/jjq/NativeLoader.java#L54-L57

Besides, would you consider loading native libs from the system so that you wouldn't have to bundle the native libs.

@bskaggs
Copy link
Owner

bskaggs commented Apr 6, 2017

Thanks for looking in to this! 👍

My only experience with jnaerator is this project, so I can't help very much to your specific problem.

Yes, I'm in favor having a configuration option of loading native libraries if they already exist on OS, or a build profile for maven that doesn't package in the native libraries and assumes they exist already on the host; unfortunately, my primary case for jjq is hjq (https://github.com/bskaggs/hjq) where I can't rely on optional libraries being installed (or easily instalable) on Hadoop clusters.

If you make your change a pull request, I'll happily and thankfully merge it in.

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