BiSheng Compiler
BiSheng compiler is a high-performance, high-reliability, and easy-to-expand compiler developed by Huawei. BiSheng compiler has introduced multiple compilation technologies and supports programming languages C, C++, and Fortran.
Constraints
- BiSheng compiler can be used only with HCE 2.0 of the x86 architecture.
- The native Clang-compiled languages of HCE cannot work with the Clang-compiled languages of the BiSheng compiler. If you have installed the native Clang-compiled language package and need to use it, do not install the BiSheng compiler anymore.
If you have installed the BiSheng compiler but want to use the native Clang-compiled language, run rpm -e bisheng-compiler to delete the BiSheng compiler, and then open a new terminal to use the native Clang-compiled language.
Installing BiSheng Compiler
- Confirm that the repository is configured correctly.
Check whether the parameters in the /etc/yum.repos.d/hce.repo file are configured correctly. The correct configuration is as follows:
[base] name=HCE $releasever base baseurl=https://repo.huaweicloud.com/hce/$releasever/os/$basearch/ enabled=1 gpgcheck=1 gpgkey=https://repo.huaweicloud.com/hce/$releasever/os/RPM-GPG-KEY-HCE-2 [updates] name=HCE $releasever updates baseurl=https://repo.huaweicloud.com/hce/$releasever/updates/$basearch/ ......
- Run yum install bisheng-compiler to install BiSheng compiler.
- Run source /usr/local/bisheng-compiler/env.sh to import environment variables.
If you have opened a new terminal, import the environment variables into the new terminal.
- Check whether BiSheng compiler has been installed.
Run clang –v to view the version number. If the command output contains the BiSheng compiler version, the BiSheng compiler has been successfully installed.
Using BiSheng Compiler
- Compile and run C and C++ programs.
clang [command line flags] hello.c -o hello.o ./hello.o clang++ [command line flags] hello.cpp -o hello.o ./hello.o
- Compile and run Fortran programs.
flang [command line flags] hello.f90 -o hello.o ./hello.o
- Specify a linker.
Specify the LLVM lld for BiSheng compiler. If you do not specify the LLVM lld, the default linker ld will be used.
clang [command line flags] -fuse-ld=lld hello.c -o hello.o ./hello.o
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot