2865 views|1 replies

39

Posts

1

Resources
The OP
 

Bear Pai Hongmeng Development Board Review - [Building the Compilation Environment] [Copy link]

This post was last edited by Unseen on 2021-6-3 00:27

Last time we explained the hardware composition of the Bear Pi development board. What everyone wants to do most is to learn how to use the Bear Pi development board to light up the lamp.

Lighting a lamp is a basic task. First of all, we need to lay a good foundation. So if we want to light a lamp, we must first configure the compilation environment. Without good soil, how can it sprout healthily?

Refer to the official guidance document of BearPie. Compiling under Windows system still requires the use of Linux environment. Fortunately, Windows 10 also supports Linux environment very well (refer to wsl2 mode). We only need to configure a few parameters to seamlessly connect to Linux environment under Windows and happily use dual systems for development.

,

First, we install VSCode, an open source editor officially produced by Microsoft. Press ctrl+j to call out the command line tool and refer to the official development documentation.

Knowing that we need to install the above-mentioned development tools in the Linux environment, we will install and use them one by one.

ps (In actual use, I found that I could not download the above gcc compiler, which might be a network environment problem, so I used the LVMM from the official website)

We use the command line tool and type the command wsl to connect to the Linux environment

When the environment prompt PS in front of your command line symbol changes to the familiar $ sign in Linux, it means that you have entered the Linux environment.

By default, you can type the command to check whether each tool has been installed by default and the corresponding version number:

First check the python3 installation, as shown below:

  • $ python3 --version

After installing python3, use

  • python3 -m pip install scons

Install and update the Python package management tool (pip3)

  • sudo apt-get install python3-setuptools python3-pip -y
  • sudo pip3 install --upgrade pip

To install the Scons tool (if you use the official lvmm+hb, you do not need to install this item)

After the installation is complete, remember to check whether the installation is correct.

  • scons -v

Next you need to download the compilation tool

1. Download gn tool

2. Download the ninja tool

3. Download LLVM tools

Create respective directories and unzip them

  • mkdir ~/gn
  • tar -xvf gn-linux-x86-1717.tar.gz -C ~/gn
  • tar -xvf ninja.1.9.0.tar -C ~/
  • tar -zxvf llvm.tar.gz -C ~/

Setting Environment Variables

  • vim ~/.bashrc
  • export PATH=~/gn:$PATH
  • export PATH=~/ninja:$PATH
  • export PATH=~/llvm/bin:$PATH

Effective environment variables

  • source ~/.bashrc

Install hb using python3

  • python3 -m pip install --user ohos-build

Edit the environment variables and enable

  • vim ~/.bashrc
  • export PATH=~/.local/bin:$PATH
  • source ~/.bashrc

Execute: hb -h. If the following information is displayed, the installation is successful.

This post is from Programming Basics

Latest reply

Thanks for sharing. See Python again. This guy can be seen everywhere.   Details Published on 2021-6-3 23:17
 

7422

Posts

2

Resources
2
 

Thanks for sharing. See Python again. This guy can be seen everywhere.

This post is from Programming Basics
 
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list