webp-imageio icon indicating copy to clipboard operation
webp-imageio copied to clipboard

other architecture compatibility?

Open gotson opened this issue 5 years ago • 9 comments

Hello,

is this compatible with ARM32/64 ?

gotson avatar Jul 23 '20 07:07 gotson

Have not tested, I doubt it.

ediweissmann avatar Jul 23 '20 09:07 ediweissmann

What would it take to make it compatible? I didn't check in details, do you pull the compiled native libraries from somewhere else or do you build them yourself?

gotson avatar Jul 23 '20 10:07 gotson

I have been working on that and managed to get some results.

I have looked at how https://github.com/xerial/sqlite-jdbc does the cross-compilation for multiple OS and Architectures. It uses https://github.com/dockcross/dockcross mostly. That project is using make instead of cmake, so i tried to make it work using cmake, which is a bit more complex to handle especially for libwebp.

I managed to cross-compile for multiple Linux architectures. I have successfully tested the Linux Arm64 on Travis.

My Windows builds are failing however, the DLL is built, but Travis fails and i don't know why.

For Mac i could not make the cross compilation work, and even the one i compiled on my Mac after changing slightly the cmake instructions are failing on Travis.

I also changed the library loader to use the one from sqlite-jdbc, which handles better the various architectures.

From what i understand, this project uses manually built libraries for now? If that's the case, would you be open to a PR that would involve:

  • new libraries for various cpu architecture on Linux
  • a new loader, imported from the sqlite-jdbc project

libwebp doesn't seem to be updated that often, so if a new one is released i could recompile the Linux flavors.

FYI the problem i have with cross-compiling was the absence of JDK in the docker images, so cmake failed to import the JNI headers. I have added the JNI headers manually in the project (they don't change often), and added a dependency manually.

gotson avatar Jul 27 '20 09:07 gotson

I found out why my Mac libraries where failing tests. I am using Mac 10.15, and there's a special parameter to use in cmake to compile for older version (there's one in the cmake script but it doesn't work). However I can only compile down to 10.9, but I don't know about the existing dylib. On Travis i could set up some Mac vms down to 10.11 which is the lowest one they have.

I'll try to get the cross compilation working for Mac and windows.

gotson avatar Jul 28 '20 02:07 gotson

After another day of work, i managed to fix the cross-compilation using Docker for both Windows and Mac. The good news is that the Mac SDK in the docker image is 10.10, and can compile down to 10.5, which is what was set in the project CMake file.

I now have cross-build for (in bold the new ones compared to master):

  • Linux: x86, x86_64, arm, armv7, arm64, ppc64
  • Windows: x86, x86_64
  • Mac: x86_64

It would also simplify the build process of the native libs when upgrading the version of libwebp, not having to depend on multiple physical machines to compile for the various architectures.

I have also added more builds in Travis, see here: https://travis-ci.com/github/gotson/webp-imageio/builds/177412664

I would like to add some jobs for the Linux builds using other architecture, but I didn't manage to do so yet. It should be possible using multiarch/qemu-user-static.

gotson avatar Jul 28 '20 09:07 gotson

Hey @gotson is this a custom build, or is it somehow possible to pull from maven repo a version of this lib that includes an aarch64 binary as well? Got a CI running on ARM and would like to see all the tests pass there as well.

namero999 avatar Oct 15 '21 10:10 namero999

Oh, I've found your fork of the library on maven central (same username). Thanks a lot!

namero999 avatar Oct 15 '21 10:10 namero999

yes, see here

gotson avatar Oct 15 '21 10:10 gotson