1e41f4b71Sopenharmony_ci# Installing the Compilation Tools 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci 4e41f4b71Sopenharmony_ciFor details about the functions of the OpenHarmony compilation and building module, see [Compilation and Building Guide](../subsystems/subsys-build-all.md). 5e41f4b71Sopenharmony_ci 6e41f4b71Sopenharmony_ciPerform the following steps on Ubuntu. 7e41f4b71Sopenharmony_ci 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ci## hb Installation 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ci>  **NOTE** 12e41f4b71Sopenharmony_ci> 13e41f4b71Sopenharmony_ci> For details about how to install the proxy, see [Configuring the Proxy](quickstart-pkg-common-proxy.md). 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci1. Run the following command to install hb and update it to the latest version: 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ci ```shell 18e41f4b71Sopenharmony_ci python3 -m pip install --user build/hb 19e41f4b71Sopenharmony_ci ``` 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ci2. Set an environment variable. 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ci ```shell 24e41f4b71Sopenharmony_ci vim ~/.bashrc 25e41f4b71Sopenharmony_ci ``` 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci Copy the following command to the last line of the .bashrc file, save the file, and exit. 28e41f4b71Sopenharmony_ci 29e41f4b71Sopenharmony_ci ```shell 30e41f4b71Sopenharmony_ci export PATH=~/.local/bin:$PATH 31e41f4b71Sopenharmony_ci ``` 32e41f4b71Sopenharmony_ci 33e41f4b71Sopenharmony_ci Update the environment variable. 34e41f4b71Sopenharmony_ci 35e41f4b71Sopenharmony_ci ```shell 36e41f4b71Sopenharmony_ci source ~/.bashrc 37e41f4b71Sopenharmony_ci ``` 38e41f4b71Sopenharmony_ci 39e41f4b71Sopenharmony_ci3. Run the **hb help** command in the source code directory. If the following information is displayed, the installation is successful: 40e41f4b71Sopenharmony_ci 41e41f4b71Sopenharmony_ci  42e41f4b71Sopenharmony_ci 43e41f4b71Sopenharmony_ci>  **NOTICE** 44e41f4b71Sopenharmony_ci> - To uninstall hb, run the following command: 45e41f4b71Sopenharmony_ci> 46e41f4b71Sopenharmony_ci> ```shell 47e41f4b71Sopenharmony_ci> python3 -m pip uninstall ohos-build 48e41f4b71Sopenharmony_ci> ``` 49e41f4b71Sopenharmony_ci> 50e41f4b71Sopenharmony_ci> - If any issue occurs during the hb installation, see [FAQs](quickstart-pkg-common-hberr.md). 51e41f4b71Sopenharmony_ci 52e41f4b71Sopenharmony_ci 53e41f4b71Sopenharmony_ci## Installing LLVM (Only Required for OpenHarmony_v1.x) 54e41f4b71Sopenharmony_ci 55e41f4b71Sopenharmony_ci>  **NOTICE** 56e41f4b71Sopenharmony_ci> 57e41f4b71Sopenharmony_ci> When downloading source code under the OpenHarmony_v1.x branches or tags, perform the procedure described in this section to install LLVM 9.0.0. 58e41f4b71Sopenharmony_ci> 59e41f4b71Sopenharmony_ci> When downloading source code under the Master or non-OpenHarmony_v1.x branches or tags, skip this section. hb will automatically download the latest version of LLVM. 60e41f4b71Sopenharmony_ci 61e41f4b71Sopenharmony_ci1. Start the Linux server. 62e41f4b71Sopenharmony_ci 63e41f4b71Sopenharmony_ci2. [Download LLVM](https://repo.huaweicloud.com/harmonyos/compiler/clang/9.0.0-36191/linux/llvm-linux-9.0.0-36191.tar). 64e41f4b71Sopenharmony_ci 65e41f4b71Sopenharmony_ci3. Decompress the LLVM installation package to **~/llvm**. 66e41f4b71Sopenharmony_ci 67e41f4b71Sopenharmony_ci ```shell 68e41f4b71Sopenharmony_ci tar -zxvf llvm.tar -C ~/ 69e41f4b71Sopenharmony_ci ``` 70e41f4b71Sopenharmony_ci 71e41f4b71Sopenharmony_ci4. Set an environment variable. 72e41f4b71Sopenharmony_ci 73e41f4b71Sopenharmony_ci ```shell 74e41f4b71Sopenharmony_ci vim ~/.bashrc 75e41f4b71Sopenharmony_ci ``` 76e41f4b71Sopenharmony_ci 77e41f4b71Sopenharmony_ci Copy the following command to the last line of the .bashrc file, save the file, and exit. 78e41f4b71Sopenharmony_ci 79e41f4b71Sopenharmony_ci 80e41f4b71Sopenharmony_ci ```shell 81e41f4b71Sopenharmony_ci export PATH=~/llvm/bin:$PATH 82e41f4b71Sopenharmony_ci ``` 83e41f4b71Sopenharmony_ci 84e41f4b71Sopenharmony_ci5. Validate the environment variable. 85e41f4b71Sopenharmony_ci 86e41f4b71Sopenharmony_ci ```shell 87e41f4b71Sopenharmony_ci source ~/.bashrc 88e41f4b71Sopenharmony_ci ``` 89