A tutorial on cross-compiling OPENCV--AARCH64-LINUX-GNU-based cross compiler

Source: Internet
Author: User

1, access to opencv-3.3.1 source

Address: Https://pan.baidu.com/s/1U-UZcZ2fFI_ihJD-_jRcFg

Password: 2YFJ

2. Unzip the source package

Command: Unzip Opencv-3.3.1.zip

3. Create a new folder under the OpenCV source directory

Command: mkdir Build

4. Install software cmake and Cmake-gui

Command: Apt-get install CMake Cmake-qt-gui

Note: The root user needs to be run.

5, open the CMake interface program in the source directory of OpenCV

Command: Cmake-gui

6. Setting the CMake interface

(1) Set the source address to:

/home/bme308/opencvsrc/opencv-3.3.1

(2) Set the build address to:

/home/bme308/opencvsrc/opencv-3.3.1

(3) Adding add Entry:

Name=cmake_ar;

Type=filepath;

Value=/usr/local/arm/ext-toolchain/bin/aarch64-linux-gnu-ar

(4) Click Configure, select Specify Toolchain for cross-compiling.

Click Next to set specify the Toolchain file as:

/home/bme308/opencvsrc/opencv-3.3.1/platforms/linux/aarch64-gnu.toolchain.cmake

Click Finish.

Attention:

①.cmake_install_prefix represents the installation directory, the default is:

/home/bme308/opencvsrc/opencv-3.3.1/build/install

When you execute the Make install command, the library files and header files are placed in this folder, and you can change the path according to your own situation.

②. You need to select With_gtk_2_x.

③. When you want to get a dynamic library, check build_shared_libs:

When you want to get a static library, cancel Build_shared_libs:

(5) Click Configure again, and then click Generate.

7. Compiling and installing

Close Cmake-gui, go to the Build folder: CD build, then do make, probably wait 30 minutes after the compilation is complete, then do install.

The results of this article are finally compiled in the following link:

Address: HTTPS://PAN.BAIDU.COM/S/1SIJF1XQROEVQ4A9KAUKKCW

Password: YHQB

Description

(1) Install_so: Generated dynamic library

(2) Install_a: generated static library

PostScript: Welcome all the way to the great God criticism and correction!

2018.04.13

A tutorial on cross-compiling OPENCV--AARCH64-LINUX-GNU-based cross compiler

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.