This guide provides instructions for building the Rapid OCR Onnx library on the Kylin (arm64) operating system (e.g., Kylin V10 SP1 on Phytium D2000/8 CPU).
Compilation Requirements
- gcc: > 7
- g++: > 7
- cmake: > 3.17
Environment Setup
1. Configure Kylin Software Sources
If the Kylin repository is missing, add the appropriate source to /etc/apt/sources.list. For example, for V10:
deb http://archive.kylinos.cn/kylin/KYLIN-ALL 10.0 main restricted universe multiverse
2. Install GCC and G++
You can download .deb packages for offline installation using apt:
# Download only
sudo apt install --download-only gcc
sudo apt install --download-only g++
# Packages are cached in /var/cache/apt/packages
cd /var/cache/apt/packages
# Install the downloaded packages
sudo dpkg -i *.deb
3. Install CMake (Manual Installation)
Since apt may provide an outdated version (e.g., 3.16), download the tar.gz for Linux aarch64 from the official CMake website.
# Extract to a directory, e.g., /home/some/soft/cmake
tar -xzvf cmake-3.29.2-linux-aarch64.tar.gz -C /home/some/soft/
# Add to PATH in ~/.bashrc
export PATH=$PATH:/home/some/soft/cmake/bin
source ~/.bashrc
4. Configure JVM (Required for JNI)
Download the aarch64 JDK from Oracle. You must set JAVA_HOME to build JNI components.
# Extract to a directory, e.g., /home/some/soft/jdk
export JAVA_HOME=/home/some/soft/jdk
export PATH=$PATH:$JAVA_HOME/bin
source ~/.bashrc