1# Installing the Compilation Tools
2
3
4For details about the functions of the OpenHarmony compilation and building module, see [Compilation and Building Guide](../subsystems/subsys-build-all.md).
5
6Perform the following steps on Ubuntu.
7
8
9## hb Installation
10
11> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
12>
13> For details about how to install the proxy, see [Configuring the Proxy](quickstart-pkg-common-proxy.md).
14
151. Run the following command to install hb and update it to the latest version:
16
17   ```shell
18   python3 -m pip install --user build/hb
19   ```
20
212. Set an environment variable.
22
23   ```shell
24   vim ~/.bashrc
25   ```
26
27     Copy the following command to the last line of the .bashrc file, save the file, and exit.
28
29   ```shell
30   export PATH=~/.local/bin:$PATH
31   ```
32
33     Update the environment variable.
34
35   ```shell
36   source ~/.bashrc
37   ```
38
393. Run the **hb help** command in the source code directory. If the following information is displayed, the installation is successful:
40
41   ![hb_help](figures/hb_help.png)
42
43> ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE**
44> - To uninstall hb, run the following command:
45>
46>   ```shell
47>   python3 -m pip uninstall ohos-build
48>   ```
49>
50> - If any issue occurs during the hb installation, see [FAQs](quickstart-pkg-common-hberr.md).
51
52
53## Installing LLVM (Only Required for OpenHarmony_v1.x)
54
55> ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE**
56>
57> 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.
58>
59> 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.
60
611. Start the Linux server.
62
632. [Download LLVM](https://repo.huaweicloud.com/harmonyos/compiler/clang/9.0.0-36191/linux/llvm-linux-9.0.0-36191.tar).
64
653. Decompress the LLVM installation package to **~/llvm**.
66
67   ```shell
68   tar -zxvf llvm.tar -C ~/
69   ```
70
714. Set an environment variable.
72
73   ```shell
74   vim ~/.bashrc
75   ```
76
77   Copy the following command to the last line of the .bashrc file, save the file, and exit.
78
79
80   ```shell
81   export PATH=~/llvm/bin:$PATH
82   ```
83
845. Validate the environment variable.
85
86   ```shell
87   source ~/.bashrc
88   ```
89