opencvsharp
opencvsharp copied to clipboard
Linux ARM64 (Native bindings for Linux ARM64)
Summary of your issue
OpenCVSharp is fantastic; kudos to all your hard work! My cross-platform experience is unfortunately limited because there are no Linux ARM64 native bindings. I'm surprised to see 32-bit ARM NuGet packages (OpenCvSharp4.runtime. Linux-arm) in 2024. Many of the OpenCVSharp user issues in this repo are because of the lack of ARM64 bindings. All Raspberry Pi and ARM SBC Linux's have favored 64bit for the last few years. You will be hard-pressed to find a 32-bit OS these days.
Environment
- Raspberry Pi Zero 2 (BCM2710) is 64 bit
- Raspberry Pi 3 (BCM2710) is 64 bit
- Raspberry Pi 4 (BCM2711) is 64 bit
- And, of course, Raspberry Pi 5 is 64-bit
What did you do when you faced the problem?
I started Sherlock'n the interwebs to find a libOpenCvSharpExtern.so: ELF 64-bit LSB shared object, ARM aarch64 compatible with OpenCVSharp4 (not SDCB's Mini, because /dev/videoX is essential)
Until there's a build for Linux ARM64, I'll have to build it myself - but I'd prefer a shared Nuget that solves the many user issues in this repo.
Example code:
Build it yourself RN: https://docs.opencv.org/4.x/d7/d9f/tutorial_linux_install.html
Output:
sad face emoji
What did you intend to be?
Like all children, an astronaut, cowboy, firefighter, or robot. I made a few million robots possible, so I kind of achieved my goal! What did you intend to be?
Thumbs up for ARM64 NuGet package for Raspberry Pi!
Did you build it yourself or do you want me to post the one I built?
No, I didn't build it myself, I yust wanna see it build as NuGet package so that can be easily included for linux-arm64 Raspberry Pi projects.
Did you build it yourself or do you want me to post the one I built?
Can you please post the one you built?
Here you go libOpenCvSharpExtern.zip
Thanks for the library. Unfortunately it is dynamic linked unlike the static linked library in the nuget package OpenCvSharp4.runtime.linux-arm.
I built the OpenCV 4.9.0 binaries which took half a day on my Raspberry Pi 4. After that ldd /libOpenCvSharpExtern.so
still displays a missing reference:
/lib/aarch64-linux-gnu/libstdc++.so.6: version 'GLIBCXX_3.4.32' not found
Running strings /lib/aarch64-linux-gnu/libstdc++.so.6 | grep GLIBCXX
prints
...
GLIBCXX_3.4.27
GLIBCXX_3.4.28
GLIBCXX_3.4.29
GLIBCXX_3.4.30
So I'm trying to update libstdc++.so.6 which apparently is part of GCC. After building the GCC 13.2 binaries for a couple of hours it stopped with an error about an symbol lookup error: /lib/aarch64-linux-gnu/libicuuc.so.72: undefined symbol: _ZSt15__once_callable, version GLIBCXX_3.4.11
.
During all the building I rewrote the C# app in Python, which is much easier to run on Linux. I really like C# and .NET, but things like that are just a hassle I don't need.