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

How to install opencv aarch64 (cross-compiled) on target #24

Open
zachatttack opened this issue Oct 29, 2024 · 2 comments
Open

How to install opencv aarch64 (cross-compiled) on target #24

zachatttack opened this issue Oct 29, 2024 · 2 comments

Comments

@zachatttack
Copy link

I'm having trouble compiling with sh build-opencv-linux.sh on a raspberry pi 4 running bookworm 64-bit. So I'm cross compiling with bash build-opencv-linux-aarch64-cross-compile.sh --build-only

I've added the following lines to the bash script

export CC=/usr/bin/aarch64-linux-gnu-gcc
export CXX=/usr/bin/aarch64-linux-gnu-g++

The build completes and I see a bin and lib directory in opencv/build_opencv.

But is unclear to me how to now install my build to my target.

Instructions found here https://docs.opencv.org/4.x/d3/dd9/tutorial_crosscompile_with_multiarch.html led me to think there will be an install folder that I transfer to my raspberry pi, but the script doesn't seem to generate that .

@AIWintermuteAI
Copy link
Contributor

@rajames I see you added that fairly recently - can you weigh in?

@rajames
Copy link
Member

rajames commented Oct 30, 2024

@zachatttack I've updated the script to prepare the output files better when --build-only is passed. See the README for more information.

You can copy the directories in <path-to-script>/opencv/build_opencv/install to your target. You can place them anywhere. If for example you'd want to install them system-wide then you can do as follows:

cd <path-to-script>/opencv/build_opencv/
sudo cp -R install/bin/* /usr/local/bin/
sudo cp -R install/share/* /usr/local/share/
sudo cp -R install/lib/* /usr/local/lib/
sudo cp -R install/include/* /usr/local/include/

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