# Get started This chapter shows how to build and execute a simple C program using the LLVM compiler. The program is built using the Hexagon software development tools and executed on the Hexagon simulator. The Hexagon software development tools are assumed to be already installed on your computer. The installation includes the tools required for assembling and linking a compiled program. Note The commands shown in this chapter are for illustration only. For detailed information on building programs, see [Use the compilers](https://docs.qualcomm.com/doc/80-N3040-23/topic/use-the-compilers.html). ## Create source file Create the following C source file: #include int main() { printf(“Hello world\n”); return(0); } Copy to clipboard Save the file as `hello.c`. ## Compile program Compile the program with the following command: hexagon-clang hello.c -o hello Copy to clipboard This command translates the C source file `hello.c` into the executable file `hello`. ## Execute program To execute the program, use the following command: hexagon-sim hello Copy to clipboard The program outputs its message to the terminal: Hello world Copy to clipboard Following the program output is the simulator-generated message `Done!` and some execution statistics: Done! T0: Insns=5648 Tcycles=7931 T1: Insns=0 Tcycles=0 T2: Insns=0 Tcycles=0 Total: Insns=5648 Pcycles=47587 Simulator speed=0.314599 Mips Ratio to Real Time (600 MHz) = ~1/226 (elapsed time = 0.017953s) Copy to clipboard The statistics show the number of instructions and cycles executed on each Hexagon processor thread. You have now compiled and executed a C program using the LLVM compiler. For more information on using the compiler, see [Use the compilers](https://docs.qualcomm.com/doc/80-N3040-23/topic/use-the-compilers.html). Last Published: Oct 06, 2026 [Previous Topic C language and compiler references](https://docs.qualcomm.com/bundle/publicresource/80-N3040-23/topics/functional-overview.md) [Next Topic Use the compilers](https://docs.qualcomm.com/bundle/publicresource/80-N3040-23/topics/use-the-compilers.md)