moerjielovecookie

Sawen_Blog

一个普通工科牲的博客网站
x
github
follow
email

OK3568 Development Environment Configuration - Ubuntu - 22.04

The official materials for OK3568 and the Ubuntu 22.04 virtual machine image are as follows:
File shared via cloud storage: OK3568-Data-Development Virtual Machine

1 System Image Compilation#

Download the source code from the cloud storage, and after extracting, you will get OK3568_Linux_fs.tar. Extract OK3568_Linux_fs.tar and dl.tar.bz2, then move dl to OK3568_Linux_fs/buildroot to speed up the compilation of the system image.
The tutorial for compiling the system image is as follows:
04_Related Code Compilation

2 Cross-Compile and Install Software#

The path for the cross-compiler is OK3568_Linux_fs/prebuilts/gcc/linux-x86/aarch64/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-, configure the environment variable in ~/.bashrc as export PATH="/home/forlinx/3568/OK3568_Linux_fs/prebuilts/gcc/linux-x86/aarch64/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin:$PATH".

2.1 ffmpeg-2.4.14#

First, run the configure script in the source code folder.

./configure \
--prefix=/usr/local \
--cross-prefix=aarch64-none-linux-gnu- \
--arch=aarch64 \
--target-os=linux \
--enable-cross-compile \
--disable-static \
--enable-shared \
--pkg-config-flags="--static"
  • --prefix=/usr/local: Specifies the installation path of FFmpeg on the target machine.
  • --cross-prefix=aarch64-none-linux-gnu-: The most critical parameter, it tells the configure script to use aarch64-none-linux-gnu- as the prefix for all compilers and tools.
  • --arch=aarch64: Specifies the target CPU architecture.
  • --target-os=linux: Specifies the target operating system as Linux.
  • --enable-cross-compile: Explicitly enables cross-compilation mode.
  • --disable-static: Compiles only dynamic libraries (.so files), which usually reduces the size of the final files.
  • --enable-shared: Compiles dynamic link libraries.
  • --pkg-config-flags="--static": Prevents pkg-config from trying to find dynamic libraries on the host machine during cross-compilation.
    After successful configuration, execute make and sudo make install, and the compiled library files, header files, and executables will be installed in the /usr/local directory.

2.2 log4cplus-2.0.7#

The configure command is as follows:

./configure --host=aarch64-none-linux-gnu --prefix=/usr/local
  • --host=aarch64-none-linux-gnu: This is the most important parameter, ensuring that the make command will call the correct cross-compiler.
  • --prefix=/usr/local: This parameter specifies the installation path of log4cplus on the target machine. If not specified, the default is also /usr/local.

2.3 zeromq-4.0.8#

The configure command is as follows:

./configure --host=aarch64-none-linux-gnu --prefix=/usr/local --enable-shared --disable-static
  • --host=aarch64-none-linux-gnu: The most critical parameter, it tells the configure script that you are cross-compiling for the aarch64 architecture.
  • --prefix=/usr/local: Specifies the installation path of ZeroMQ on the target machine.
  • --enable-shared: Compiles dynamic link libraries (.so files).
  • --disable-static: Does not compile static libraries (.a files) to reduce the size of the final files.
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.