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