## Environment Requirements
## Hardware
- Linux server
- Windows workstation \(Host computer\)
- Hi3516DV300 IoT Camera development board
- USB cable and network cable \(The Windows workbench is connected to Hi3516DV300 development board through the USB cable and network cable.\)
[Figure 1](#fa54d47112b684c65b3dbf1779413545a) shows the hardware connections.
**Figure 1** Hardware connections

## Software
**Table 1** Platforms required for Hi3516DV300 development board
## Build Tools for Linux
The following table lists the obtaining channels and common tools required for Linux.
**Table 2** Development tools and obtaining channels for the Linux server
Generates ninja compilation scripts. | http://tools.harmonyos.com/mirrors/gn/1523/linux/gn-linux-1523.tar | |
Runs ninja compilation scripts. | http://tools.harmonyos.com/mirrors/ninja/1.9.0/linux/ninja-linux-1.9.0.tar | |
http://tools.harmonyos.com/mirrors/clang/9.0.0-33042/linux/llvm-linux-9.0.0-33042.tar | ||
Connects to the Linux server(choose one). | Public internet (for example, https://www.putty.org/) |
## Development Tools for Windows
**Table 3** Development tools and obtaining channels for the Windows workstation
https://code.visualstudio.com/ | ||
Suppports code compilation, burning, debugging, and C++ languages. NOTE: HUAWEI DevEco Device Tool is a one-stop integrated development tool provided by OpenHarmony for smart device developers. It supports customization of OpenHarmony components based on demands, and functions such as code editing, compilation, burning, and debugging. It also supports C and C++ languages, and is deployed on Visual Studio Code as a plug-in. | https://partnerdevicetest.devccsrnd.hwcloudtest.cn:3092/cn/ide |
## Installing the Basic Compilation Environment
## connecting to the Linux server
Using PuTTY on Windows to log into Linux server
1. Open [puTTY](https://www.putty.org/), enter the IP address of the Linux server, and click **Open**.
**Figure 2** PuTTY configuration page

2. Select **Yes** in the dialog displaying a security alert.
**Figure 3** PuTTY Security Alert dialog

3. Enter the account and password.
**Figure 4** Login page

4. The login is successful.
**Figure 5** Successful login page

## h2 Change Linux shell to bash.
Run the following command on the terminal to check whether the shell is bash:
```
ls -l /bin/sh
```
如果为显示为/bin/sh -\> bash则为正常,否则请按以下方式修改:
**方法一**
在终端运行如下命令,然后选择 no。
```
sudo dpkg-reconfigure dash
```
**方法二**
Delete sh and run sh again.
```
rm -rf /bin/sh
sudo ln -s /bin/bash /bin/sh
```
## Installing the Python environment
1. Open the terminal of the Linux compilation server.
2. Run the **python3 --version** command to check the Python version. Python 3.7 or later is required. Otherwise, perform the following steps \(Python 3.8 is used as an example\):
- If the Ubuntu version is 18, run the sudo apt-get install python3.8 command.
- If the Ubuntu version is 16, download the installation package and install Python.
1. Run the following command to install the python dependency:
Run sudo apt-get install gcc to install gcc.
Install g++ and run sudo apt-get install g++.
Run the sudo apt-get install make command to install make.
Run the sudo apt-get install zlib\* command to install zlib.
Install libffi and run "sudo apt-get install libffi-dev".
2. Obtaining the python3.8.5 Installation Package
3. Run the **tar -xvzf Python-3.8.5.tgz** command.
4. Run the **cd Python-3.8.5** command.
5. Run the **sudo ./configure** command.
6. Run the **make** command.
7. Run the **sudo make install** command.
- Run the sudo apt-get install python3-setuptools python3-pip -y command to install the Python package management tool. \(The root/sudo permission is required for the installation.\) Upgrade pip3 and run "sudo pip3 install --upgrade pip".
Alternatively, install the Python package management tool as instructed by the official website. Download "curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py" and run python get-pip.py.
3. Install **setuptools** by running the **pip3 install setuptools** command.
4. Install GUI menuconfig by running the **sudo pip3 install kconfiglib** command. The Kconfiglib 13.2.0+ version is recommended. \(The root/sudo permission is required.\)
You can also perform the following steps to install Kconfiglib 13.2.0+:
1. Download the .whl file \(for example, kconfiglib-13.2.0-py2.py3-none-any.whl\).
Download path: https://pypi.org/project/kconfiglib\#files
1. Install the .whl file by running the **sudo pip3 install kconfiglib-xxx.whl** command \(for example, **sudo pip3 install kconfiglib-13.2.0-py2.py3-none-any.whl**\). \(The root/sudo permission is required.\)
2. If an error of **subprocess.CalledProcessError: Command '\('lsb\_release', '-a'\)' returned non-zero exit status 1.** occurs, run the **find / -name lsb\_release** command, for example, **rm -rf /usr/bin/lsb\_release** to locate **sb\_release** and release it.
## Installing **gn**
1. Open a Linux terminal.
2. Download [gn](https://chrome-infra-packages.appspot.com/dl/gn/gn/linux-amd64/+/latest).
3. Decompress the tool package to the **\~/gn** directory on the Linux server.
4. Set environment variables by running the **vim /etc/profile** command and add new variables by running the **export PATH=\~/gn:$PATH** command.
5. Validate environment variables by running the **source /etc/profile** command.
## Installing **ninjah**
1. Open a Linux terminal.
2. Download [ninja](https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-linux.zip).
3. Decompress the tool package to the **\~/ninja** directory on the Linux server.
4. Set environment variables by running the **vim /etc/profile** command and add new variables by running the **PATH=\~/ninja:$PATH** command.
5. Validate environment variables by running the **source /etc/profile** command.
## Installing the LLVM tool chain
1. Open a Linux terminal.
2. Download [http://tools.harmonyos.com/mirrors/clang/9.0.0-33042/linux/llvm-linux-9.0.0-33042.tar](http://tools.harmonyos.com/mirrors/clang/9.0.0-33042/linux/llvm-linux-9.0.0-33042.tar).
3. Decompress the tool package to the **\~/llvm** directory on the Linux server.
4. Set environment variables by adding **export PATH=\~/bin:$PATH** to the **vim /etc/profile** profile.
5. Validate environment variables by running the **source /etc/profile** command.
## Installing File Packing Tools
1. Open a Linux terminal.
2. Run the **mkfs.vfat** command. If the command is not found, run the **sudo apt-get install dosfstools** command.
3. Run the **mcopy** command. If the command is not found, run the **sudo apt-get install mtools** command.