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

Are preset maven artifacts portable? #1424

Open
benshiffman opened this issue Oct 13, 2023 · 7 comments
Open

Are preset maven artifacts portable? #1424

benshiffman opened this issue Oct 13, 2023 · 7 comments

Comments

@benshiffman
Copy link

I just followed the directions on the "Create New Presets" page and successfully wrapped a native library of my own. My question is, how portable is the artifact that appears in my .m2/repositories folder? Ideally, I would like to have the wrapped lib as a standalone package that others on my team (provided they are on the same platform, windows-x86_64) can access without having to go through the javacpp install/build procedures themselves. Is this as simple as sharing the jar file?

As a somewhat-related follow-up, what is the difference between the (libname) and (libname)-platform artifacts?

Thanks!

@saudet
Copy link
Member

saudet commented Oct 13, 2023

Yes, just sharing the JAR files should work, as long as you bundle all the dependencies in those JAR files.

The platform artifacts on https://github.com/bytedeco/javacpp-presets/wiki/Reducing-the-Number-of-Dependencies

@benshiffman
Copy link
Author

Do you mean bundling the contents of (lib)/target? I read through reducing the number of dependencies and that all makes sense. It seems though that by file size alone that the binaries are not contained in (lib).jar, (lib)-platform.jar, nor (lib)-windows-x86_64.jar. Under the (lib)/target/native folder I do see that the jni binaries are being copied, but the original static and dynamic libraries don't seem to be connected.

@saudet
Copy link
Member

saudet commented Oct 14, 2023

You'll need to add those in the @Platform annotation as per https://github.com/bytedeco/javacpp/wiki/Mapping-Recipes

@benshiffman
Copy link
Author

Yup, I've included and linked all the headers and libs that I need following that.

@benshiffman
Copy link
Author

I've been able to call native functions from a project using this as a dependency without a problem, just looking for a way to get these onto other devs' systems without going through the build process again.

@saudet
Copy link
Member

saudet commented Oct 14, 2023

Please follow the instructions at https://github.com/bytedeco/javacpp-presets/wiki/Debugging-UnsatisfiedLinkError-on-Windows

@benshiffman
Copy link
Author

Hadn't stumbled across that before--dependencywalker was very helpful. Seems like the (lib)-(platform).jar contains all that is needed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants