Rate This Document
Findability
Accuracy
Completeness
Readability

Installing Basic Libraries

Installing GCC

  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
    cp -r /etc/yum.repos.d /etc/yum.repos.d-bak
    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 the 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.aarch64 gcc-c++.aarch64 gcc-gfortran.aarch64 libgcc.aarch64
    

Modifying GCC (to Solve the -fsigned-char Problem)

  1. Search for the directory where GCC is located. Generally, the directory is /usr/bin/gcc.
    1
    command -v gcc
    
  2. Rename the original GCC file, for example, to gcc-impl.
    1
    mv /usr/bin/gcc /usr/bin/gcc-impl
    
  3. Configure the GCC file.
    1. Create a GCC file.
      1
      vi /usr/bin/gcc
      
    2. Press i to enter the insert mode and add the following content to the file:
      1
      2
      #! /bin/sh
      /usr/bin/gcc-impl -fsigned-char "$@"
      
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  4. Add the execute permission for the GCC file.
    1
    chmod +x /usr/bin/gcc
    
  5. Check whether the GCC is available.
    1
    gcc --version
    
    • CentOS: The installation is successful if information similar to the following is displayed:

    • openEuler: The installation is successful if information similar to the following is displayed:

Modifying G++ (to Solve the -fsigned-char Problem)

  1. Search for the directory where G++ is located. Generally, the directory is /usr/bin/g++.
    1
    command -v g++
    
  2. Change the original G++ file name, for example, to g++-impl.
    1
    mv /usr/bin/g++ /usr/bin/g++-impl
    
  3. Configure the G++ file.
    1. Create a G++ file.
      1
      vi /usr/bin/g++
      
    2. Press i to enter the insert mode and add the following content to the file:
      1
      2
      #! /bin/sh
      /usr/bin/g++-impl -fsigned-char "$@"
      
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  4. Add the execute permission for the G++ file.
    1
    chmod +x /usr/bin/g++
    
  5. Check whether G++ is available.
    1
    g++ --version
    
    • CentOS: The installation is successful if information similar to the following is displayed:

    • openEuler: The installation is successful if information similar to the following is displayed:

Installing Dependencies

Use the Yum source to install dependencies.

yum install -y wget unzip vim