Rate This Document
Findability
Accuracy
Completeness
Readability

Installing BiSheng Compiler

This section describes how to install Bisheng Compiler. Perform the following operations as the root user.

Bisheng Compiler has been integrated into the openEuler software repository. In the openEuler OS, you can install Bisheng Compiler by using the Yum repository. In the non-openEuler OS, you can install Bisheng Compiler by using the software package.

Installation by Using the Software Package

  1. Obtain the software package.

    Contact Huawei technical support to obtain BiSheng Compiler.

    Software package name: BiShengCompiler-4.1.0-aarch64-linux.tar.gz

    Directory structure of the software package:

    BiShengCompiler-4.1.0-aarch64-linux

    -- bin

    -- include

    -- lib

    -- libexec

    -- share

  2. Verify the integrity of the software package.

    To prevent software packages from being tampered with during transmission or storage, download their digital signature files for integrity check while downloading the software packages.

    After downloading software packages, verify their PGP digital signatures by following the instructions provided in OpenPGP Signature Verification Guide. If the software package fails the verification, do not use the software package, and contact Huawei technical support.

    Before you use a software package for installation or upgrade, verify its digital signature to ensure that the software package has not been tampered with.

  3. Set the installation directory.
    1. Create a Bisheng Compiler installation directory, for example, /opt/compiler.
    1
    mkdir -p /opt/compiler
    

    2. Copy the Bisheng Compiler package to the installation directory.

    1
    cp BiShengCompiler-4.1.0-aarch64-linux.tar.gz /opt/compiler
    
  4. Decompress the package.
    1
    2
    cd /opt/compiler
    tar -zxvf BiShengCompiler-4.1.0-aarch64-linux.tar.gz
    

    After decompression, the BiShengCompiler-4.1.0-aarch64-linux directory is generated in the current directory.

    The operations described in this section are performed by the root user. To allow all common users to perform the operations, run the following command to change the permission on the decompressed folder to 755:

    chmod -R 755 ${PATH_TO_BISHENG}/BiShengCompiler-x.x.x-aarch64-linux

  5. Configure the environment variables for Bisheng Compiler.
    1
    2
    export PATH=/opt/compiler/BiShengCompiler-4.1.0-aarch64-linux/bin:$PATH 
    export LD_LIBRARY_PATH=/opt/compiler/BiShengCompiler-4.1.0-aarch64-linux/lib:/opt/compiler/BiShengCompiler-4.1.0-aarch64-linux/lib/aarch64-unknown-linux-gnu:$LD_LIBRARY_PATH
    

    The /opt/compiler directory is an example. Set the installation directory as required.

  6. (Optional) Clear the hash table in the current window.
    If an LLVM compiler of another version is available in the system, run the following command immediately after installing Bisheng Compiler:
    1
    hash -r
    

    This prevents the Clang command from being captured by the hash table. If the Clang command is captured by the hash table, Bisheng Compiler or the open-source LLVM compiler cannot be used.

  7. Check whether the installation is successful.
    After the installation is complete, verify the Bisheng Compiler version.
    1
    clang -v
    

    If the Bisheng Compiler version information is displayed in the command output, the installation is successful.

Installation by Using the Yum Repository

  1. Add a repository in the AArch environment.

    The openEuler repository website may be updated. You can visit oepkgs to obtain the latest repository website.

    1
    dnf config-manager --add-repo https://repo.oepkgs.net/openeuler/rpm/openEuler-20.03-LTS-SP1/extras/aarch64/
    
  2. Update the repository index.
    1
    dnf update
    
  3. Install the BiShengCompiler software package.
    1
    dnf install BiShengCompiler-4.1.0
    
  4. (Optional) Clear the hash table in the current window.
    If an LLVM compiler of another version is available in the system, run the following command immediately after installing Bisheng Compiler:
    1
    hash -r
    

    This prevents the Clang command from being captured by the hash table. If the Clang command is captured by the hash table, Bisheng Compiler or the open-source LLVM compiler cannot be used.

  5. Check whether the installation is successful.
    After the installation is complete, verify the Bisheng Compiler version.
    1
    clang -v
    

    If the Bisheng Compiler version information is displayed in the command output, the installation is successful.