Rate This Document
Findability
Accuracy
Completeness
Readability

Configuring the Compilation Environment

Installing Dependencies

  1. Mount the OS image.
    1
    mount YOUR_OS.iso /media -o loop
    

    Replace YOUR_OS.iso with the actual iso package name.

  2. Back up the repo file and clear the /etc/yum.repos.d/ directory.
    1
    2
     /etc/yum.repos.d-bakcp -r /etc/yum.repos.d
    rm /etc/yum.repos.d/*
    

    Ensure that all repo files have been backed up. Enter y on the rm deletion page to delete the files.

  3. Configure a local Yum source.
    1. Open the /etc/yum.repos.d/Local.repo file.
      1
      vi /etc/yum.repos.d/Local.repo
      
    2. Press i to enter the insert mode and add the following content to the file:
      1
      2
      3
      4
      5
      [Local]
      name=Local
      baseurl=file:///media/
      enabled=1
      gpgcheck=0
      
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  4. Make the Yum source configuration take effect.
    1
    2
    yum clean all
    yum makecache
    
  5. Use the Yum source to install GCC related software.
    1
    yum -y install gcc gcc-c++ gcc-gfortran.aarch64 libgcc.aarch64 make cmake libtool autoconf automake ant wget git vim
    

Installing OpenJDK

  1. Download and decompress the installation package to a directory (for example, /opt/tools/installed).
    1
    2
    3
    4
    wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u252-b09/OpenJDK8U-jdk_aarch64_linux_hotspot_8u252b09.tar.gz
    tar -zxf OpenJDK8U-jdk_aarch64_linux_hotspot_8u252b09.tar.gz
    mkdir -p /opt/tools/installed/
    mv jdk8u252-b09 /opt/tools/installed/
    
  2. Configure Java environment variables.
    1. Edit the /etc/profile file.
      1
      vi /etc/profile
      
    2. Press i to enter the insert mode and add the following content to the end of the file:
      1
      2
      export JAVA_HOME=/opt/tools/installed/jdk8u252-b09
      export PATH=$JAVA_HOME/bin:$PATH
      
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  3. Make the environment variables take effect.
    1
    source /etc/profile
    
  4. Check whether OpenJDK is successfully installed.
    1
    java -version
    

    If the OpenJDK version is displayed in the command output, the installation is successful.

    1
    2
    3
    openjdk version "1.8.0_252"
    OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_252-b09)
    OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.252-b09, mixed mode)