当前位置: 首页 > news >正文

建设企业网站价钱深圳推广优化公司

建设企业网站价钱,深圳推广优化公司,住建网站需多少钱,专做批发的网站背景 之前wiki 14、【OS】【Nuttx】Nsh中运行第一个程序 都是用 make 构建,准备切换 cmake 进行构建,方便后续扩展开发 Nuttx cmake 适配 nuttx项目路径下输入 make distclean,清除之前工程配置 adminpcadminpc:~/nuttx_pdt/nuttx$ make …

背景

之前wiki
14、【OS】【Nuttx】Nsh中运行第一个程序
都是用 make 构建,准备切换 cmake 进行构建,方便后续扩展开发

Nuttx cmake 适配

nuttx项目路径下输入 make distclean,清除之前工程配置

adminpc@adminpc:~/nuttx_pdt/nuttx$ make distclean

接着输入 cmake 构建命令,发现没找到 python3-kconfiglib, 该库用于解析和操作 Linux 内核配置系统(Kconfig),可以让用户通过 python 实现和 Kconfig 文件的交互

adminpc@adminpc:~/nuttx_pdt/nuttx$ cmake -S . -B build -DBOARD_CONFIG=sim:myapp
CMake Error at CMakeLists.txt:88 (message):Kconfig environment depends on kconfiglib, Please install:$ sudo apt install python3-kconfiglib-- Configuring incomplete, errors occurred!

安装,发现已经安装过,但还是显示找不到该库

adminpc@adminpc:~/nuttx_pdt/nuttx$ sudo apt install python3-kconfiglib
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-kconfiglib is already the newest version (14.1.0-3).
0 upgraded, 0 newly installed, 0 to remove and 258 not upgraded.

查看报错原因,发现和 olddefconfig 脚本找不到有关

在这里插入图片描述
输入命令 dpkg -L python3-kconfiglib,查看 kconfiglib 库的位置,可以找到该脚本

adminpc@adminpc:~/nuttx_pdt/nuttx$ dpkg -L python3-kconfiglib

在这里插入图片描述
查看该文件权限,发现没有可执行权限,很明显这个 olddefconfig.py 就是个库文件,不是用来做可执行文件的,所以得在外面做一层封装
在这里插入图片描述
查看 nuttx_kconfig.cmake 脚本,可发现把 olddefconfig 和 setconfig 作为了可执行脚本进行使用
在这里插入图片描述

将这俩 py 文件封装成可执行的 shell 脚本,在 bash 中输入如下命令,将在 /usr/local/bin 目录下,生成两个可执行脚本,这俩可执行脚本指向 kconfiglib 库

sudo tee /usr/local/bin/olddefconfig >/dev/null <<EOL
#!/bin/sh
exec python3 /usr/lib/python3/dist-packages/olddefconfig.py "\$@"
EOL
sudo chmod +x /usr/local/bin/olddefconfig
sudo tee /usr/local/bin/setconfig >/dev/null <<EOL
#!/bin/sh
exec python3 /usr/lib/python3/dist-packages/setconfig.py "\$@"
EOL
sudo chmod +x /usr/local/bin/setconfig

另外,为了防止 find_program 找不到该可执行文件,可直接指定路径

find_program(KCONFIGLIB /usr/local/bin/olddefconfig)

Nuttx app cmake 适配

这里基于之前wiki已经配置好的工程,不熟悉的可参考
15、【OS】【Nuttx】OS裁剪,运行指定程序,周期打印当前任务

在 nuttx-app 路径下添加 myapp 路径
在这里插入图片描述
myapp路径下新建CMakeLists.txt文件,输入内容,并修改 Kconfig,添加 cmake 配置
在这里插入图片描述

// CMakeLists.txt
if(CONFIG_MYAPP)nuttx_add_application(NAME${CONFIG_MYAPP_PROGNAME}SRCSmyapp_main.cSTACKSIZE${CONFIG_MYAPP_STACKSIZE}PRIORITY${CONFIG_MYAPP_PRIORITY})
endif()
# Kconfig
config MYAPPbool "My Application"default nhelpThis is a description of your applicationif MYAPPconfig MYAPP_PROGNAMEstring "Program name"default "myapp"---help---This is the name of the program that will be used when the NSH ELFprogram is installed.config MYAPP_PRIORITYint "myapp task priority"default 100config MYAPP_STACKSIZEint "myapp stack size"default DEFAULT_TASK_STACKSIZEendif

执行 cmake 构建

配置 cmake 工程

adminpc@adminpc:~/nuttx_pdt/nuttx$ cmake -S . -B build -DBOARD_CONFIG=sim:myapp
-- Initializing NuttXSelect HOST_LINUX=ySelect HOST_X86_64=y
--   CMake:  3.28.3
--   Board:  sim
--   Config: myapp
--   Appdir: /home/adminpc/nuttx_pdt/nuttx-apps
-- The C compiler identification is GNU 13.3.0
-- The CXX compiler identification is GNU 13.3.0
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (2.2s)
-- Generating done (0.3s)
-- Build files have been written to: /home/adminpc/nuttx_pdt/nuttx/build

执行cmake构建

cmake --build build/

构建成功
在这里插入图片描述
build目录下出现熟悉的身影
在这里插入图片描述
可以正常执行
在这里插入图片描述

http://www.shuangfujiaoyu.com/news/27709.html

相关文章:

  • 做农宿的网站如何自己开发软件app
  • 西安建设网站的公司简介seo有哪些经典的案例
  • 网站开发工资淄博信息流优化师
  • 用java做信息发布网站好看的网站模板
  • 商店网站在线设计seo快速建站
  • 甘肃网站建设方案服务至上黄冈地区免费网站推广平台
  • 北京企业网站建设飞沐阿里云官网首页
  • 网站建设徐州百度网络网站网站优化公司开始上班了
  • 网站为什么做版心限制seo优化报价公司
  • 网站开发商标属于哪一类图们网络推广
  • 数据网站怎么做测试谷歌安装器
  • 大数据比赛网站建设国际新闻军事最新消息
  • 德阳做网站网络营销的培训课程
  • 招聘网站排行榜恶意点击竞价是用的什么软件
  • 手机网站封装用户体验互联网营销师国家职业技能标准
  • 南昌加盟网站建设百度惠生活怎么优化排名
  • seo推广话术百度seo快速排名
  • 棋牌游戏网站怎么做的佛山seo
  • 购物网站css模板软文代写接单平台
  • 潍坊高端网站建设网络营销个人感悟小结
  • 网站建设的知识深圳推广平台深圳网络推广
  • 网站日均ip过万怎么做全网营销的公司
  • 上海兼职做网站学生网页制作成品
  • 区块链做网站都有哪些内容呢网络营销推广方法和手段
  • 如何不备案做购物网站seo蜘蛛屯
  • 虫部落是谁做的网站百度网页打不开
  • 医院网站做品牌推广需要哪些百度推广天津总代理
  • 咨询网站 模板宣传推广的十种方式
  • 优秀个人网站互联网广告推广是做什么的
  • 网上做家教那个网站好seo 工具