1
头图

0. Basic environment

Category: Notebook Model: Great Wall of China NF14C
Hardware platform: Feiteng processor (ArmV8 instruction set)
System: Galaxy Kirin OS V10 SP1 (2203)

Key words:
Xinchuang, Kylin system, linux, c++, c, kernel Feiteng, arm

1. Demand background

For low-level and high-performance computing, C/C++ has irreplaceable performance advantages and the ability to fully control hardware. Therefore, although the GO language and Java language are now popular, the research and development of C and C++ is still indispensable, especially such as artificial intelligence algorithm packages.

2. Basic preparations

2.1 JDK installation

JDK installation is because Clion and Eclipse are used, open the terminal and enter

 sudo apt-get install openjdk-11-jdk -y

2.2 C++ compilation dependency installation

 sudo apt-get install llvm gcc g++ cmake git vim -y

3. Use clion for C++/C language development (personal preference, used to jetbrains series)

Open https://www.jetbrains.com.cn/en-us/clion/download/other.html ,
图片.png
Download the binary version corresponding to Clion according to your needs, https://download.jetbrains.com.cn/cpp/CLion-2022.1.3.tar.gz?_gl=1 14g9b34 _ga MTA0NTY4MjM1Ny4xNjU2MjUyODcw _ga_9J976DJZ68*MTY1NjI1Mjg2OS4xLjAuMTY1NjI1Mjg4
Unzip to the corresponding folder, the folder path cannot contain Chinese.
图片.png
图片.png
图片.png

https://jetbra.in/s ja-jetbrains activation tool supporting activation code address (for study and research only, please purchase the official genuine version), download the latest tool and activation code above. Activation can refer to: https://segmentfault.com/a/1190000041769901
Tool download, it seems that sometimes the website where the tool is located can't get through, the address of my NAS can be used
http://gofile.me/4i7bC/TppnI17yM

 HLLIQN9GJ8-eyJsaWNlbnNlSWQiOiJITExJUU45R0o4IiwibGljZW5zZWVOYW1lIjoiZnV6emVzIGFsbHkiLCJhc3NpZ25lZU5hbWUiOiIiLCJhc3NpZ25lZUVtYWlsIjoiIiwibGljZW5zZVJlc3RyaWN0aW9uIjoiIiwiY2hlY2tDb25jdXJyZW50VXNlIjpmYWxzZSwicHJvZHVjdHMiOlt7ImNvZGUiOiJQU0kiLCJmYWxsYmFja0RhdGUiOiIyMDIzLTA3LTAxIiwicGFpZFVwVG8iOiIyMDI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IKysZ1CWK3zATg9BeCUPAV1pQy8ToXOq+RSYen6winZ2OO93eyHv2Iw5kbn1dqfBw1BuTE29V2FJKicJSu8iEOpfoafwJISXmz1wnnWL3V/0NxTulfWsXugOoLfv0ZIBP1xH9kmf22jjQ2JiHhQZP7ZDsreRrOeIQ/c4yR8IQvMLfC0WKQqrHu5ZzXTH4NO3CwGWSlTY74kE91zXB5mwWAx1jig+UXYc2w4RkVhy0//lOmVya/PEepuuTTI4+UJwC7qbVlh5zfhj8oTNUXgN0AOc+Q0/WFPl1aw5VV/VrO8FCoB15lFVlpKaQ1Yh+DVU8ke+rt9Th0BCHXe0uZOEmH0nOnH/0onD

图片.png
Replace the existing vmoptions64 content with the vmoptions content under the ja-jetbrains tool, and add the -javaagent line to specify the location of ja-netfilter.jar

 -Xms128m
-Xmx1024m
-XX:ReservedCodeCacheSize=512m
-XX:+IgnoreUnrecognizedVMOptions
-XX:+UseG1GC
-XX:SoftRefLRUPolicyMSPerMB=50
-XX:CICompilerCount=2
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-ea
-Dsun.io.useCanonCaches=false
-Djdk.http.auth.tunneling.disabledSchemes=""
-Djdk.attach.allowAttachSelf=true
-Djdk.module.illegalAccess.silent=true
-Dkotlinx.coroutines.debug=off
-XX:ErrorFile=$USER_HOME/java_error_in_idea_%p.log
-XX:HeapDumpPath=$USER_HOME/java_error_in_idea.hprof

--add-opens=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED
--add-opens=java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED

-javaagent:/home/long/clion-2022.1.3/jetbra/ja-netfilter.jar=jetbrains

图片.png
图片.png
Then use the latest activation code obtained on the website to activate

图片.png
Activation successful, exit
图片.png

4. Use eclipse for c++/C language development

Eclipse can be downloaded through the application market (you can also download the aarch version of the installer through the official website, and select it directly in it)
图片.png
After startup, click the help menu to enter the plugin market
图片.png
Search for the C++ integrated environment plug-in CDT, click to install (or download the latest plug-in directly from the official website https://www.eclipse.org/cdt/downloads.php )
图片.png
After the installation is complete, restart to take effect.

5. Use Qt Creator for C++/C language development

Qt creator can be downloaded and installed through the application market
图片.png
Install qmake under the application market (you have to enter all to see it)
图片.png
The effect after opening
图片.png

In addition, you need to install the qt sdk
https://download.qt.io/archive/qt
图片.png
https://download.qt.io/archive/qt/6.3/6.3.1/single/
图片.png
Unzip to a custom folder to open qt creator, click Tools | Options menu
图片.png
My qmake location is as follows (cmake does not need to be configured, it has been automatically detected)
图片.png
The kits are configured
图片.png
图片.png

6. Examples

6.1 Eclipse

Open eclipse, click New Project, find C++, as shown below.
图片.png
图片.png
图片.png
图片.png

6.2 Clion and configuration

图片.png
The built-in cmake cannot work under arm Feiteng, you need to configure toolchains in the setting.
图片.png
After configuration, the effect is as follows
图片.png
Save, the IDE will rebuild the project index, please wait patiently. The effect of compilation and operation is as follows
图片.png

6.3 qt creator (not perfect, I haven't engaged in QT for a long time, welcome QT developers to comment and add)

New Project
图片.png
图片.png
图片.png
图片.png
图片.png
图片.png
图片.png

Kylin system column:
https://segmentfault.com/blog/kylinos
Article published in SegmentFault
Contact email: 1179611323@qq.com
Group: 662512340
Release log:
20220702 first release


码上世界
79 声望290 粉丝

码农极客,2004年接触Linux世界。爱技术的IT的男