Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jerrrrry
infinicore
Commits
7d3ca92d
Commit
7d3ca92d
authored
Jul 30, 2025
by
zhangyue
Browse files
适配p800软件栈
parent
a23c4d13
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
16 deletions
+25
-16
xmake/kunlun.lua
xmake/kunlun.lua
+25
-16
No files found.
xmake/kunlun.lua
View file @
7d3ca92d
add_defines
(
"ENABLE_KUNLUN_API"
)
add_defines
(
"ENABLE_KUNLUN_API"
)
local
KUNLUN_HOME
=
os.getenv
(
"KUNLUN_HOME"
)
local
KUNLUN_HOME
=
os.getenv
(
"KUNLUN_HOME"
)
local
XTDK_DIR
=
path
.
join
(
KUNLUN_HOME
,
"XTDK"
)
local
XRE_DIR
=
path
.
join
(
KUNLUN_HOME
,
"xre"
)
local
XTDK_DIR
=
path
.
join
(
KUNLUN_HOME
,
"xtdk"
)
local
XDNN_DIR
=
path
.
join
(
KUNLUN_HOME
,
"xhpc"
,
"xdnn"
)
-- Add include dirs
-- Add include dirs
add_includedirs
(
path
.
join
(
KUNLUN_HOME
,
"include"
),
{
public
=
true
})
add_includedirs
(
path
.
join
(
XRE_DIR
,
"include"
),
{
public
=
true
})
add_linkdirs
(
path
.
join
(
KUNLUN_HOME
,
"lib64"
))
add_includedirs
(
path
.
join
(
XTDK_DIR
,
"include"
),
{
public
=
true
})
add_includedirs
(
path
.
join
(
XDNN_DIR
,
"include"
),
{
public
=
true
})
add_linkdirs
(
path
.
join
(
XRE_DIR
,
"so"
))
add_linkdirs
(
path
.
join
(
XDNN_DIR
,
"so"
))
add_links
(
"xpurt"
)
add_links
(
"xpurt"
)
add_links
(
"xpuapi"
)
add_links
(
"xpuapi"
)
...
@@ -18,7 +24,8 @@ rule("xpu")
...
@@ -18,7 +24,8 @@ rule("xpu")
on_build_file
(
function
(
target
,
sourcefile
)
on_build_file
(
function
(
target
,
sourcefile
)
local
objectfile
=
target
:
objectfile
(
sourcefile
)
local
objectfile
=
target
:
objectfile
(
sourcefile
)
local
basename
=
objectfile
:
gsub
(
"%.o$"
,
""
)
print
(
"Compiling:"
,
sourcefile
,
"->"
,
objectfile
)
-- local basename = objectfile:gsub("%.o$", "")
os
.
mkdir
(
path
.
directory
(
objectfile
))
os
.
mkdir
(
path
.
directory
(
objectfile
))
local
cc
=
path
.
join
(
XTDK_DIR
,
"bin/clang++"
)
local
cc
=
path
.
join
(
XTDK_DIR
,
"bin/clang++"
)
local
includedirs
=
table.concat
(
target
:
get
(
"includedirs"
),
" "
)
local
includedirs
=
table.concat
(
target
:
get
(
"includedirs"
),
" "
)
...
@@ -27,20 +34,20 @@ rule("xpu")
...
@@ -27,20 +34,20 @@ rule("xpu")
[
"arm64"
]
=
"aarch64-linux-gnu"
[
"arm64"
]
=
"aarch64-linux-gnu"
}
}
local
args
=
{
local
args
=
{
"--sysroot=/"
,
--
"--sysroot=/",
"--target="
..
arch_map
[
os
.
arch
()],
"--target="
..
arch_map
[
os
.
arch
()],
"-fPIC"
,
"-fPIC"
,
"-pie"
,
--
"-pie",
"--xpu-arch=xpu
2
"
,
"--xpu-arch=xpu
3
"
,
"--basename"
,
basename
,
--
"--basename", basename,
"-std=c++1
1
"
,
"-std=c++1
7
"
,
"-O2"
,
"-O2"
,
"-fno-builtin"
,
"-fno-builtin"
,
"-g"
,
--
"-g",
"-c"
,
sourcefile
,
"-c"
,
sourcefile
,
"-v"
"-o"
,
objectfile
-- "-v"
}
}
for
_
,
includedir
in
ipairs
(
target
:
get
(
"includedirs"
))
do
for
_
,
includedir
in
ipairs
(
target
:
get
(
"includedirs"
))
do
...
@@ -48,10 +55,12 @@ rule("xpu")
...
@@ -48,10 +55,12 @@ rule("xpu")
end
end
-- print(args)
-- print(args)
os
.
execv
(
cc
,
args
)
local
ok
,
code
=
os
.
execv
(
cc
,
args
)
assert
(
ok
==
0
,
"Compile failed: "
..
sourcefile
)
table.insert
(
target
:
objectfiles
(),
objectfile
)
table.insert
(
target
:
objectfiles
(),
objectfile
)
table.insert
(
target
:
objectfiles
(),
basename
..
".device.bin.o"
)
--
table.insert(target:objectfiles(), basename .. ".device.bin.o")
print
(
target
:
objectfiles
())
--
print(target:objectfiles())
end
)
end
)
rule_end
()
rule_end
()
...
@@ -62,7 +71,7 @@ target("infiniop-kunlun")
...
@@ -62,7 +71,7 @@ target("infiniop-kunlun")
add_deps
(
"infini-utils"
)
add_deps
(
"infini-utils"
)
on_install
(
function
(
target
)
end
)
on_install
(
function
(
target
)
end
)
add_cxflags
(
"-lstdc++ -fPIC"
)
add_cxflags
(
"-lstdc++ -fPIC
-Wno-error=unused-function
"
)
set_warnings
(
"all"
,
"error"
)
set_warnings
(
"all"
,
"error"
)
set_languages
(
"cxx17"
)
set_languages
(
"cxx17"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment