rt-thread / userapps Goto Github PK
View Code? Open in Web Editor NEWuser applications for rt-smart
License: GNU General Public License v2.0
user applications for rt-smart
License: GNU General Public License v2.0
你好,我按照快速上手的linux版介绍,尝试构建riscv64版本的用户程序,执行如下命令:
python get_toolchain.py riscv64
source smart-env.sh riscv64
但是出现如下错误:
通过echo $PATH命令,可以看到我的路径是正常的:
不清楚为什么会这样报错?
如果不加sudo前缀,只使用scons,会产生如下错误:
好像是riscv工具链有点问题?
另外,快速上手中还包含了arm的示例,这部分可以正常构建出用户态应用程序。
但是userapps\prebuilt\qemu-vexpress-a9
目录下没有Linux平台的运行脚本。尽管我可以参考.bat文件自己写一个脚本,但还是希望能看到官方的示例和源码一致 :)
谢谢
系统:debian 12
xmake版本:v2.8.3+20231018,
执行命令xmake f -a aarch64
时,显示
=> install aarch64-smart-musleabi 188177 .. ok
=> download https://github.com/libsdl-org/SDL_image/archive/refs/tags/release-2.0.5.tar.gz .. ok
=> install sdl2_image 2.0.5 .. failed
具体报错情况如下:
...
mv -f .deps/IMG_WIC.Tpo .deps/IMG_WIC.Plo
mv -f .deps/showimage.Tpo .deps/showimage.Po
IMG_webp.c:42:10: fatal error: webp/decode.h: No such file or directory
42 | #include <webp/decode.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:619: IMG_webp.lo] Error 1
make: *** Waiting for unfinished jobs....
mv -f .deps/IMG_tif.Tpo .deps/IMG_tif.Plo
mv -f .deps/IMG_pcx.Tpo .deps/IMG_pcx.Plo
mv -f .deps/IMG_xv.Tpo .deps/IMG_xv.Plo
mv -f .deps/IMG_pnm.Tpo .deps/IMG_pnm.Plo
mv -f .deps/IMG.Tpo .deps/IMG.Plo
mv -f .deps/IMG_tga.Tpo .deps/IMG_tga.Plo
mv -f .deps/IMG_jpg.Tpo .deps/IMG_jpg.Plo
mv -f .deps/IMG_xpm.Tpo .deps/IMG_xpm.Plo
mv -f .deps/IMG_lbm.Tpo .deps/IMG_lbm.Plo
mv -f .deps/IMG_gif.Tpo .deps/IMG_gif.Plo
mv -f .deps/IMG_bmp.Tpo .deps/IMG_bmp.Plo
mv -f .deps/IMG_xcf.Tpo .deps/IMG_xcf.Plo
mv -f .deps/IMG_png.Tpo .deps/IMG_png.Plo
mv -f .deps/IMG_svg.Tpo .deps/IMG_svg.Plo
目前遇到这个问题,先到apps目录,再source ../env.sh,再xmake,报错
$ cd apps
mmc at hp in ~/dev/rtt/userapps/apps (main●) (dev_env)
$ source ../env.sh
mmc at hp in ~/dev/rtt/userapps/apps (main●) (dev_env)
$ xmake -j8
error: unknown rule(rt.cpp) in target(cpp)!
mmc at hp in ~/dev/rtt/userapps/apps (main●) (dev_env)
$ xmake smart-rootfs
xmake v2.8.2+20230822, A cross-platform build utility based on Lua
Copyright (C) 2015-present Ruki Wang, tboox.org, xmake.io
_
__ ___ __ __ __ _| | ______
\ \/ / | \/ |/ _ | |/ / __ \
> < | \__/ | /_| | < ___/
/_/\_\_|_| |_|\__ \|_|\_\____|
by ruki, xmake.io
👉 Manual: https://xmake.io/#/getting_started
🙏 Donate: https://xmake.io/#/sponsor
Usage: $xmake [task] [options] [target]
Build targets if no given tasks.
Actions:
service Start service for remote or distributed compilation and etc.
u, uninstall Uninstall the project binary files.
update Update and uninstall the xmake program.
c, clean Remove all binary and temporary files.
r, run Run the project target.
i, install Package and install the target binary files.
q, require Install and update required packages.
f, config Configure the project.
b, build Build targets if no given tasks.
p, package Package target.
create Create a new project.
g, global Configure the global options for xmake.
Plugins:
show Show the given project information.
check Check the project sourcecode and configuration.
repo Manage package repositories.
format Format the current project.
doxygen Generate the doxygen document.
l, lua Run the lua script.
m, macro Run the given macro.
plugin Manage plugins of xmake.
project Generate the project file.
watch Watch the project directories and run command.
Common options:
-q, --quiet Quiet operation.
-y, --yes Input yes by default if need user confirm.
--confirm=CONFIRM Input the given result if need user confirm.
- yes
- no
- def
-v, --verbose Print lots of verbose information for users.
--root Allow to run xmake as root.
-D, --diagnosis Print lots of diagnosis information (backtrace,
check info ..) only for developers.
And we can append -v to get more whole
information.
e.g. $ xmake -vD
--version Print the version number and exit.
-h, --help Print this help message and exit.
-F FILE, --file=FILE Read a given xmake.lua file.
-P PROJECT, --project=PROJECT Change to the given project directory.
Search priority:
1. The Given Command Argument
2. The Envirnoment Variable:
XMAKE_PROJECT_DIR
3. The Current Directory
Command options (build):
-b, --build Build target. This is default building mode and
optional.
-r, --rebuild Rebuild the target.
-a, --all Build all targets.
-g GROUP, --group=GROUP Build all targets of the given group. It support
path pattern matching.
e.g.
xmake -g test
xmake -g test_*
xmake --group=benchmark/*
--dry-run Dry run to build target.
-j JOBS, --jobs=JOBS Set the number of parallel compilation jobs.
(default: 8)
--linkjobs=LINKJOBS Set the number of parallel link jobs.
-w, --warning Enable the warnings output.
--files=FILES Build the given source files.
e.g.
- xmake --files=src/main.c
- xmake --files='src/*.c' [target]
- xmake --files='src/**c|excluded_file.c'
- xmake --files='src/main.c:src/test.c'
target The target name. It will build all default
targets if this parameter is not specified.
error: invalid task: smart-rootfs
后来发现是env.sh里面路径的问题
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
应当改成,测试正常工作
script_dir=$(cd `dirname $0`; pwd)
我看到文件里使用musl的交叉工具链编译源码,比如riscv64-linux-musleabi-...
我希望把RT-Thread内核以及用户程序移植到loongarch架构上,但目前loongarch架构的musl交叉工具链似乎还没有。
但是有loongarch64-linux-gnu-gcc等工具链,请问能否用这种工具链替代呢?
get_toolchain.py
下载的工具链的路径默认在此项目的相对路径下,这样就造成我这样的社区开发者开发用户app时,每次都要切换工具链路径,代码交给别人编译时也要改工具路径,这十分的麻烦。如果统一了工具链路径,至少开发者拿到一份新的代码可以做到开箱即用了
Hi,
May I ask how to built the prebuilt kernel such as prebuilt/qemu-virt64-riscv/rtthread.bin
?
I download the v5.0.1 release of RT-Thread and built a bsp/qemu-virt64-riscv/rtthread.bin
successfuly, but when I replaced the prebuilt kernel with mine and runs the demo, it complains that: [E/DBG] virtio-blk0 mount failed
.
I guess the ext4 file system driver is absent from my kernel, so I turned on CONFIG_PKG_USING_LWEXT4 and rebuild, but got the following error:
CC build/packages/lwext4-latest/src/ext4.o
In file included from /opt/rv64/10.1/riscv64-unknown-linux-musl/include/signal.h:48,
from /home/yf/Projects/rt-thread/components/libc/compilers/common/include/sys/signal.h:23,
from /home/yf/Projects/rt-thread/components/libc/compilers/common/include/sys/time.h:180,
from /home/yf/Projects/rt-thread/components/libc/compilers/common/include/sys/select.h:17,
from /opt/rv64/10.1/riscv64-unknown-linux-musl/include/sys/types.h:71,
from /home/yf/Projects/rt-thread/components/libc/compilers/common/include/sys/unistd.h:16,
from /home/yf/Projects/rt-thread/components/libc/compilers/common/include/unistd.h:14,
from packages/lwext4-latest/include/ext4_oflags.h:91,
from packages/lwext4-latest/src/ext4.c:41:
/opt/rv64/10.1/riscv64-unknown-linux-musl/include/bits/signal.h:63:15: error: expected identifier or '(' before '[' token
63 | char __unused[1024 / 8 - sizeof(sigset_t)];
| ^
scons: *** [build/packages/lwext4-latest/src/ext4.o] Error 1
scons: building terminated because of errors.
My toolchain is from https://download.rt-thread.org/rt-smart/riscv64/riscv64-linux-musleabi_for_x86_64-pc-linux-gnu_180881.tar.bz2
:
yf@a4:$ /opt/rv64/10.1/bin/riscv64-unknown-linux-musl-gcc -v
Using built-in specs.
COLLECT_GCC=/opt/rv64/10.1/bin/riscv64-unknown-linux-musl-gcc
COLLECT_LTO_WRAPPER=/opt/rv64/10.1/bin/../libexec/gcc/riscv64-unknown-linux-musl/10.1.0/lto-wrapper
Target: riscv64-unknown-linux-musl
Configured with: /builds/alliance/risc-v-toolchain/riscv-gcc/configure --target=riscv64-unknown-linux-musl --prefix=/builds/alliance/risc-v-toolchain/install-native/ --with-sysroot=/builds/alliance/risc-v-toolchain/install-native//riscv64-unknown-linux-musl --with-system-zlib --enable-shared --enable-tls --enable-languages=c,c++ --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libsanitizer --disable-nls --disable-bootstrap --src=/builds/alliance/risc-v-toolchain/riscv-gcc --disable-multilib --with-abi=lp64 --with-arch=rv64imafdc --with-tune=rocket 'CFLAGS_FOR_TARGET=-O2 -mcmodel=medany -march=rv64imafdc -mabi=lp64' 'CXXFLAGS_FOR_TARGET=-O2 -mcmodel=medany -march=rv64imafdc -mabi=lp64'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.1.0 (GCC)
build date: Jun 21 2023 16:23:45
build sha: 1e9cc6e05c1d3f67abf532747071137fa58a549d
build job: 491872
Regards,
yf
ubuntu系统,在userapps\tools目录下运行get_toolchain.py的脚本
:~/userapps/tools$ python3 get_toolchain.py riscv64
之后
:~/userapps/tools$ cd ..
:~/userapps$ ./smart-env.sh riscv64
Arch => riscv64
CC => gcc
PREFIX => riscv64-unknown-linux-musl-
EXEC_PATH => /home/auser/userapps/tools/gnu_gcc/riscv64-linux-musleabi_for_x86_64-pc-linux-gnu/bin
这里就不对吧?
之后
使用set命令检查RTT_EXEC_PATH是否设置成功 用什么具体命令呢?
再编译,总是如下错误
:~/userapps$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
CC apps/webclient/packages/webclient-v2.1.2/src/webclient.o
sh: 1: riscv64-unknown-linux-musl-gcc: not found
scons: *** [apps/webclient/packages/webclient-v2.1.2/src/webclient.o] Error 127
scons: building terminated because of errors.
请问该如何处理?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.