当前位置:网站首页>Kunpeng compile and debug plug-in actual combat
Kunpeng compile and debug plug-in actual combat
2022-08-02 00:32:00 【InfoQ】
Kunpeng compiles and debugs plug-ins in practice
This content mainly introduces the Kunpeng compiling and debugging plug-in and the actual combat operation.Help everyone get started with the Kunpeng compilation plugin faster.
课程链接:https://www.hikunpeng.com/zh/developer/live/detail/1538767731381215234

1. 背景介绍
As the software evolves and changes,The same source code needs to be compiled on different platforms、部署与运行,But because the local environment is inconsistent with the remote environment,As a result, the source code cannot be run remotely after being compiled locally.Developers are more accustomed to relying on nativeIDE进行开发、调试,Based on this, developers often need to manually upload code to the remote for compilation and debugging,Remote cannot directly locate the problem,开发效率慢.In order to solve the developer due to development、编译、The separation of the debugging environment leads to a series of pain points such as low development efficiency,Kunpeng compile and debug plugin(Kunpeng Compiler Plugin)应运而生,as an integrated inIDE中的插件,One-click remote compilation and debugging,Compile and run results will be presented locallyIDE中,Greatly improve the efficiency of developers.
1.1 Features supported by the tool

2. 项目实战
2.2 gtest-cmake-example 简要介绍
gtest-cmake-exampleis a test using googlecmake设置示例.Its role is to help developmentC++and google test.
This practice uses“gtest-cmake-example”项目,Help users get familiar with the use of compiling and debugging plug-ins.该项目git地址为: https://github.com/dmonopoly/gtest-cmake-example.git
语言版本:c++
gtest版本:1.6.0
硬件要求
软件要求

操作系统要求

前提条件
已安装vscode,There is a correct compilation environmentLinuxserver or request a server through a remote laboratory.
操作步骤
步骤4 Configure the remote debugging server---Enter server information and configure

步骤5创建编译任务----输入编译命令: mkdir build;cd build;cmake .;make并创建

步骤6Start the compile task---Start remote compilation

Start the compile task---View remote compilation results:Compilation status and output information

步骤7添加测试用例---Open the Test Cases page

执行测试用例

查看调试信息

3. 实战gtest项目
在鲲鹏社区申请远程实验室,
https://www.hikunpeng.com/zh/developer/devkit
点击云测服务

点击进入远程实验室

点击立即申请
通过邮箱申请免费鲲鹏虚拟化环境(Kunpeng 920 | 8vCPU | 16GB内存 | 200GB系统盘),环境中已经预装鲲鹏开发套件 Kunpeng DevKit.

操作系统选择OpenEuler

申请成功


3.1安装finalshell
finalshell为远程ssh登录工具
finalshell下载链接
http://www.hostbuf.com/t/988.html
3.2 安装uin-vpn
下载链接:http://www.leagsoft.com/doc/article/103107.html
点击新建链接

输入邮箱中获取的信息后进行登录

再登录finalshell

3.3源码下载
1)进入“鲲鹏代码迁移工具”源码文件存放路径.
cd /opt/portadv/portadmin/sourcecode/

2)下载Megahit源码.
git clone https://github.com/voutcn/megahit.git

3)将代码进行合并.
cd megahit/ && git submodule update

4)创建构建文件夹并进入.
mkdir build && cd build

提示:这里需要手动安装cmake
5)生成Makefile文件.
cmake -DCMAKE_BUILD_TYPE=Release

6)修改megahit目录属组.
cd ../ && chown -R porting:porting *

3.4 代码迁移
登录迁移网址平台https://172.36.86.41:8084/


1)源码分析参数填充
2)启动一个源码迁移任务,任务执行成功,查看源码报告.

点击开始分析

左下角可以显示源码迁移分析进度

此处编译器版本只能选择GCC,无法选择图例中的昇腾编译器
报告生成后点击查看报告

3)点击报告源码迁移建议,查看需要迁移的文件.

4)根据系统提示的修改建议进行修改.

5)迁移后重新编译,查看编译结果.

6)运行程序,查看回显信息.

边栏推荐
- go语言标准库fmt包怎么使用
- 在不完全恢复、控制文件被创建或还原后,必须使用 RESETLOGS 打开数据库,解释 RESETLOGS.
- An Enhanced Model for Attack Detection of Industrial Cyber-Physical Systems
- PHP从txt文件中读取数据的方法
- els 方块变形
- SphereEx Miao Liyao: Database Mesh R&D Practice under Cloud Native Architecture
- GetHashCode方法与=
- 玩转NFT夏季:这份工具宝典值得收藏
- After reshipment tencent greetings to monitor if the corresponding service does not exist by sc. Exe command to add services
- els 方块边界变形处理
猜你喜欢
随机推荐
短视频seo搜索优化主要内容
When Netflix's NFTs Forget Web2 Business Security
ROS dynamic parameters
What is it like to trade for a living?
鲲鹏编译调试插件实战
电机原理动图合集
[Solution] Emqx startup under win10 reports Unable to load emulator DLL, node.db_role = EMQX_NODE__DB_ROLE = core
Redis的集群模式
Unknown CMake command "add_action_files"
面试:简单介绍你参与的一个项目
Ansible中的任务执行控制
Business test how to avoid missing?
Identify memory functions memset, memcmp, memmove, and memcpy
IP核:FIFO
146. LRU 缓存
什么是低代码(Low-Code)?低代码适用于哪些场景?
工业信息物理系统攻击检测增强模型
基于相关性变量筛选偏最小二乘回归的多维相关时间序列建模方法
业务测试如何避免漏测 ?
众筹DAO“枯萎”的缩影:曾拍下《沙丘》未出版手稿的Spice DAO解散