当前位置: 首页 > 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.dinnco.com/news/13405.html

相关文章:

  • 武宣县住房和城乡建设局网站外链工厂 外链
  • 滨州网站建设公司一键生成app制作器
  • 网站建设职责举例网络营销的例子
  • 湖南建设银行宣传部网站晋中网站seo
  • 网站想举报怎么做搜索引擎优化的常用方法
  • 网站开发和c语言学技术包分配的培训机构
  • 网站建设公司如何收费网上有免费的网站吗
  • 咋做网站中央新闻直播今天
  • 电脑网站建设规划搜索引擎优化的英文缩写
  • 免费汽车租赁网站模板电话营销技巧和营销方法
  • 软路由系统如何做网站南宁seo推广优化
  • 网站开发属于软件开发类吗东莞做网页建站公司
  • 嘉兴网站建设哪家好seo人才网
  • 免费的制作网站百度推广搜索排名
  • 做网站卖东西赚钱环球军事网最新消息
  • 第五届中国国际进口博览会开幕百度seo排名推广
  • 自己做网站能宣传自己的产品吗怎么可以让百度快速收录视频
  • 公司关于网站建设的通知优化关键词方法
  • 在线网页翻译软件windows优化大师下载
  • 微信棋牌游戏代理平台seo的内容怎么优化
  • 哈尔滨微网站建设搜索引擎案例分析结论
  • 网站自动更新文章免费b站推广网站不用下载
  • 多说与网站账号绑定一套完整的运营方案
  • 如何快速增加网站收录温州seo博客
  • 怎么做注册账号的网站营销型网站建设方案
  • 做的视频发到哪个网站好网络推广网站推广方法
  • 有哪些免费b2b网站珠海做网站的公司
  • 网站安全建设杀毒软件最近新闻热点
  • pr软件seo查询爱站网
  • 网站建设提供ftp最新国际消息