Rate This Document
Findability
Accuracy
Completeness
Readability

Installing GCC for openEuler

  1. Download GCC for openEuler to the /home directory.
    wget https://mirror.iscas.ac.cn/kunpeng/archive/compiler/kunpeng_gcc/gcc-9.3.1-2021.03-aarch64-linux.tar.gz
  2. Decompress the package.
    mkdir -p /opt/aarch64/compiler
    cp -rf gcc-9.3.1-2021.03-aarch64-linux.tar.gz /opt/aarch64/compiler
    cd /opt/aarch64/compiler
    tar -xf gcc-9.3.1-2021.03-aarch64-linux.tar.gz
  3. Set the environment variables and add the following content to the end of the profile file.
    vi /etc/profile
    export PATH=/opt/aarch64/compiler/gcc-9.3.1-2021.03-aarch64-linux/bin:$PATH
    export INCLUDE=/opt/aarch64/compiler/gcc-9.3.1-2021.03-aarch64-linux/include:$INCLUDE
    export LD_LIBRARY_PATH=/opt/aarch64/compiler/gcc-9.3.1-2021.03-aarch64-linux/lib64:$LD_LIBRARY_PATH

    Press Esc, type :wq!, and press Enter to save the file and exit.

    Run the following command for the environment variables to take effect. After reconnecting to the server, you do not need to run the following command again. The system automatically loads the environment configuration.

    source /etc/profile
  4. After setting and loading the Kunpeng GCC environment variables, verify the Kunpeng GCC compiler version.
    gcc –v

    If the command output contains the Kunpeng GCC version information, the Kunpeng GCC compiler has been successfully installed.