---
title: 使用毕昇编译器
description: "执行以下命令编译运行C程序，其中“command line flags”为编译选项，具体可参考毕昇编译器选项说明章节。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengdevps/compilation/ug-bisheng/kunpengbisheng_06_0006.html
sourcePath: /source/zh/kunpengdevps/compilation/ug-bisheng/kunpengbisheng_06_0006.html
indexId: 31cb8f62f8e655bca402989c044e0ea112d7b5647a845d15d2f92dbdcbb5b85f74
---
# 使用毕昇编译器

#### 编译运行C/C++程序

执行以下命令编译运行C程序，其中“command line flags”为编译选项，具体可参考毕昇编译器选项说明章节。

```
clang  [command line flags]  hello.c  -o  hello.o 
./hello.o
```

执行以下命令编译运行C++程序，其中“command line flags”为编译选项，具体可参考毕昇编译器选项说明章节。

```
clang++  [command line flags]  hello.cpp  -o  hello.o 
./hello.o
```


#### 编译运行Fortran程序

执行以下命令编译运行Fortran程序，其中“command line flags”为编译选项，具体可参考毕昇编译器选项说明章节。

```
flang  [command line flags]  hello.f90  -o  hello.o 
./hello.o
```


#### 指定链接器

毕昇编译器指定的链接器是LLVM的lld，若不指定它则使用默认的ld。其中“command line flags”为编译选项，具体可参考毕昇编译器选项说明章节。

```
clang  [command line flags]  -fuse-ld=lld  hello.c  -o  hello.o 
./hello.o
```
