-
-
Notifications
You must be signed in to change notification settings - Fork 810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
自定义工具链使用报错-工具链提示已存在到时检测存在 bug #5761
Comments
Title: Customized tool chain usage error - tool chain prompts that it already exists and then detects the existence of a bug |
目前仅支持 已知编译器的自定义,比如 gcc/clang 系。。其他未知编译器 不支持自定义 如果 topscc 是 gcc/clang 系的用法,可以设置 |
Currently only customization of known compilers is supported, such as the gcc/clang system. . Other unknown compilers do not support customization If topscc is a gcc/clang system usage, you can set |
请问设置那个参数 |
set_toolset |
Please set that parameter |
Xmake 版本
2.9.3
操作系统版本和架构
Linux pse-044 5.15.0-101-generic #111-Ubuntu SMP Tue Mar 5 20:16:58 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
描述问题
无法找到自定义的 toolchain 实现 topscc 这一个使用 shell 对 clang 的包装,该文件是存在的
工具链定义如下:
-- define toolchain
toolchain("venus_topcc")
-- mark as standalone toolchain
set_kind("standalone")
-- set cross toolchains
set_sdkdir("/ops/tops/")
set_bindir("/ops/tops/bin")
-- set toolset
set_toolset("cc", "topscc")
set_toolset("cxx", "topscc")
set_toolset("ld", "clang++", "clang")
set_toolset("sh", "clang++", "clang")
set_toolset("ar", "ar")
set_toolset("ex", "ar")
set_toolset("strip", "strip")
set_toolset("mm", "clang")
set_toolset("mxx", "clang", "clang++")
set_toolset("as", "clang")
add_defines("MYCLANG")
-- check toolchain
on_check(function(toolchain)
return import("lib.detect.find_tool")("clang")
end)
-- on load
on_load(function(toolchain)
-- get march
local march = is_arch("x86_64", "x64") and "-m64" or "-m32"
end)
-- https://xmake.io/#/zh-cn/manual/custom_toolchain
编译命令报错如下
xmake build -wv gcu_sample_elementwise_add
checking for topscc ... /opt/tops/bin/topscc
checking for the c++ compiler (cxx) ... topscc
error: cannot find known tool script for /opt/tops/bin/topscc
warning: we cannot get tool(cxx) in toolchain(venus_topcc) with linux/x86_64, because it has been not checked yet!
warning: we cannot load toolchain(venus_topcc), because it has been not checked yet!
期待的结果
能够使用自己的工具链,编译
工程配置
target("gcu_sample_elementwise_add")
set_kind("binary")
if is_mode("debug") then
add_defines("DEBUG")
end
set_toolchains("venus_topcc")
add_cxxflags("-Werror -Wall -arch gcu300")
-- -ltopsrt_static -lefrt_static -ltops_comgr_static -lrtcu_static -lz -lelf -ldl -lrt -lpthread
add_includedirs("./Common/")
add_links("topsrt_static","efrt_static","tops_comgr_static","rtcu_static","z","elf","dl","rt","pthread")
add_files("./Samples/2_Concepts_and_Techniques/simpleElemwiseAdd/simpleElemwiseAdd.cpp")
附加信息和错误日志
hecking for topscc ... /opt/tops/bin/topscc
checking for the c++ compiler (cxx) ... topscc
error: cannot find known tool script for /opt/tops/bin/topscc
warning: we cannot get tool(cxx) in toolchain(venus_topcc) with linux/x86_64, because it has been not checked yet!
warning: we cannot load toolchain(venus_topcc), because it has been not checked yet!
The text was updated successfully, but these errors were encountered: