-
Notifications
You must be signed in to change notification settings - Fork 751
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
Wrapper for LibRaw #1211
Wrapper for LibRaw #1211
Conversation
Could you try to build it from source at least on Windows? We'll need to do that because it's using C++ and Visual Studio's runtime might very well break with the next release. |
I added build from source for Windows and Linux. There will be one more commit with MacOS (hopefully will work similar to Linux) |
Building on macosx-arm64 is flaky. In maven build the platform is incorrectly detected as macosx-x86_6. Passing flag '-Djavacpp.platform=macosx-arm64' to mvn is not sufficient (results in link errors). To build you need top use two separate commands: ./cppbuild.sh install libraw mvn -Djavacpp.platform=macosx-arm64 -Djavacpp.cppbuild.skip=true install -projects .,libraw
The macOS build kind of works. Looks that JavaCPP (?) detects platform incorrectly on arm64. Passing flag |
Thanks! Let's add a .github/workflows/libraw.yml to get this tested. For macosx-arm64, we need to cross compile. |
Noticed that if I use JDK 18 I can build on macosx-arch64 without errors, but later when trying to use I am getting an error:
I will check |
The setup in |
I'm not talking about the whole presets for libffi, just the part to cross compile. We typically need to set environment variables like |
I added CC/CXX and a couple of other tweaks. Locally everything builds. In workflow, there is still some issue with maxosc-arch64: attempts to link x86_64. Linux, Windows, and macosx-x86_64 build up to creation of platform. In local testing, using the sample code, I can decode images with Windows and macosx-x86_64 versions. macosx-x86_64 still has |
For OpenMP, we need to "preload" the libraries, something like In any case, your version numbers are not matching. You have "0.20.2" in some places and "3.4.2" in other places. You'll need to fix that first to be able to start testing builds with GitHub Actions. |
preload = "gomp@.1" did not resolve the issue with
How this can be added in presets so the automated build is using this too? |
If you want to link statically with LibRaw, then we'll need to link using "link" instead of "preload", but it's a better idea to use dynamic/shared libraries anyway. |
I am not clear what you mean in your comment. Without "-fopenmp" code builds but fails at runtime. Whatever "-fopenmp" does it makes the produced binaries useful in practice. Maybe there is another way, but it is not clear why we should not use "-fopenmp". Can you comment? |
You shouldn't need to compile the JNI source code with |
Works correctly in runtime tests using javacv-examples project LibRaw-Demo
I modified Linux cppbuild - it now works at runtime. I also added some examples of using LibRaw from Java and Scala to javacpp-examples on branch libraw_pr_examples: https://github.com/bytedeco/javacv-examples/tree/libraw_pr_example/LibRaw-demo They can be used to test the build. At this point only macosx-arm64 fails at runtime as indicated above (#1211 (comment)). I tried different JVMs, setup similar to Linux, and coupe of other things. I do not see from the error what fails and how to fix it. Are there similar issues with other wrappers on macosx-arm64? Is this a JNI problem? |
Please set the "org.bytedeco.javacpp.logger.debug" system property to "true" to get more information on the console. |
# Conflicts: # pom.xml
If you're fine without support for macosx-arm64, we can merge this. Sounds good? |
Sounds good. Hopefully macosx-arm64 could be eventually added too. |
Wrapper for the LibRaw library. Current setup is for Windows 64, relies on the binary distribution of the LibRaw.
Help appreciated with adding support for MacOS and Linux.