-
Notifications
You must be signed in to change notification settings - Fork 546
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
Targetting linux-arm - and Linux in general. #365
Comments
It should, but you will need to compile the unmanaged library yourself |
Hijacking this bug to discuss a possible approach for Linux. It is unlikely that we will be able to get NuGet to properly support all the ways to distribute the native payloads. I think that we should go ahead and create We would then require users of Skiasharp to install the separate payload on their systems. |
@migueldeicaza I don't quite understand why it's not viable to statically link everything except glibc and libfontconfig. We had some success with this approach in our package with x64 binaries (I've compiled it against glibc 2.14), it works quite well across the Linux distros. The only downside is that some distros like Alpine are using different C library, but there are compatibility layers available. |
The answer is that the devil is in the details, and without a full infrastructure to test every part of the stack, and to test on every distribution, we might end up with just slightly broken code in some places which is very hard to debug and rectify. We have been down this path in the Linux world many years ago, and we rather err on the side of safety and find a safe way of plugging the payload in a native way there. |
As I mentioned on #18 before, I was able after lots of hackery (really A LOT) with @mattleibow to build it using a cross compiler and linking by hand lots of .a to finally get SkiaSharp native built. I just tried now to build again (lost the "docs" we had) and doomed again. The |
@galvesribeiro The new version no longer uses gyp, but gn instead. You can check out what I am doing here: https://github.com/mono/SkiaSharp/blob/master/cake/BuildExternals.cake#L715 What I really now do is just build Linux as Google specifies as a static archive, and then I create a dynamic library that links out everything except what SkiaSharp uses - ie: just the public C API is preserved. |
@mattleibow yeah, I noticed that... Still, it is ignoring the compiler and arch parameters we pass to it. There are a bunch of hardcoded params there. For example, the compiler params are not forwarded to the dependencies (including skia) and they try to compile for the host arch, not the target one. After change a lot of files, the closest I got was:
|
Hmm. I really need to get an arm linxu device. Note the I will try and get an ARM Linux device for testing as soon as possible. |
Actually, you don't need an ARM device. You can build on x86/x64 linux using a cross compiler toolchain and you will have that effect. My device can't build it (even if it could would take months!) so I have to crosscompile. I can give you my toolchain if you want to. Ping me on Gitter and I can send the .tar.gz. |
Just asking this question in multiple places: Right now I have a x64 build for Linux that was compiled on Ubuntu 14.04. I am thinking of adding a few more to help the average dev use SkiaSharp without having to build their own. What other distros or CPUs would be helpful? Leave a comment on this issue and track progress: #453 |
@mattleibow if you get it to build with the dependencies embedded(static linked), you can build for armv6 (no FPU) and armv7+ (with FPU). That way you would attend a wide range of ARM devices without depend on the specific distro. |
@galvesribeiro What should the host be for the arm builds? Can I use Ubuntu 14.04 or is there a better one? |
Yeah, you can use Ubuntu 16.04 as a build host. What matters is have a toolchain to crosscompile capable of generate 2 builds, one for armv6 (for legacy and very embedded devices) and other for armv7+ which cover the majority of Android devices nowadays and PI2+ and its variants. |
To make life easier for everyone, I moved code around and added a new target to the GN files. Now, the native |
Closing this issue as the Linux topic is getting a bit duplicated.
|
Hi,
I was reading the issue about
System.Drawing
for dotnet core, and someone suggested to use SkiaSharp for it.So I have looked at SkiaSharp for a possible usage in my code, on a Raspberry Pi.
Does SkiaSharp run on
linux-arm
target ? I am writing apps onnetstandard2.0
running on RaspberryPi.The text was updated successfully, but these errors were encountered: