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

Linux ARM64 (Native bindings for Linux ARM64) #1644

Open
DJSures opened this issue Jan 25, 2024 · 6 comments
Open

Linux ARM64 (Native bindings for Linux ARM64) #1644

DJSures opened this issue Jan 25, 2024 · 6 comments

Comments

@DJSures
Copy link

DJSures commented Jan 25, 2024

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?

@sajmons
Copy link

sajmons commented Feb 19, 2024

Thumbs up for ARM64 NuGet package for Raspberry Pi!

@DJSures
Copy link
Author

DJSures commented Feb 20, 2024

Did you build it yourself or do you want me to post the one I built?

@sajmons
Copy link

sajmons commented Feb 20, 2024

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.

@andywcoder
Copy link

Did you build it yourself or do you want me to post the one I built?

Can you please post the one you built?

@DJSures
Copy link
Author

DJSures commented Apr 4, 2024

Here you go
libOpenCvSharpExtern.zip

@andywcoder
Copy link

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.

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

No branches or pull requests

3 participants