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
7c5aa160
Commit
7c5aa160
authored
Jan 26, 2026
by
wooway777
Browse files
issue/985 - adjust cxflags and cxxflags for lua scripts
parent
81e5fe94
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
49 additions
and
11 deletions
+49
-11
xmake.lua
xmake.lua
+6
-4
xmake/ascend.lua
xmake/ascend.lua
+3
-0
xmake/bang.lua
xmake/bang.lua
+3
-0
xmake/cpu.lua
xmake/cpu.lua
+5
-3
xmake/hygon.lua
xmake/hygon.lua
+4
-1
xmake/iluvatar.lua
xmake/iluvatar.lua
+4
-1
xmake/kunlun.lua
xmake/kunlun.lua
+3
-0
xmake/metax.lua
xmake/metax.lua
+11
-1
xmake/moore.lua
xmake/moore.lua
+3
-0
xmake/nvidia.lua
xmake/nvidia.lua
+3
-0
xmake/qy.lua
xmake/qy.lua
+3
-0
xmake/test.lua
xmake/test.lua
+1
-1
No files found.
xmake.lua
View file @
7c5aa160
...
...
@@ -19,7 +19,7 @@ end
if
is_plat
(
"windows"
)
then
set_runtimes
(
"MD"
)
add_ldflags
(
"/utf-8"
,
{
force
=
true
})
add_cxflags
(
"/utf-8"
,
{
force
=
true
})
add_cx
x
flags
(
"/utf-8"
,
{
force
=
true
})
end
-- CPU
...
...
@@ -224,14 +224,15 @@ target("infini-utils")
set_warnings
(
"all"
,
"error"
)
if
is_plat
(
"windows"
)
then
add_cxflags
(
"/wd4068"
)
add_cx
x
flags
(
"/wd4068"
)
if
has_config
(
"omp"
)
then
add_cxflags
(
"/openmp"
)
add_cx
x
flags
(
"/openmp"
)
end
else
add_cxflags
(
"-fPIC"
,
"-Wno-unknown-pragmas"
)
add_cxxflags
(
"-fPIC"
,
"-Wno-unknown-pragmas"
)
if
has_config
(
"omp"
)
then
add_cxflags
(
"-fopenmp"
)
add_cx
x
flags
(
"-fopenmp"
)
add_ldflags
(
"-fopenmp"
,
{
force
=
true
})
end
end
...
...
@@ -276,6 +277,7 @@ target("infinirt")
set_languages
(
"cxx17"
)
if
not
is_plat
(
"windows"
)
then
add_cxflags
(
"-fPIC"
)
add_cxxflags
(
"-fPIC"
)
end
set_installdir
(
os.getenv
(
"INFINI_ROOT"
)
or
(
os.getenv
(
is_host
(
"windows"
)
and
"HOMEPATH"
or
"HOME"
)
..
"/.infini"
))
add_files
(
"src/infinirt/*.cc"
)
...
...
xmake/ascend.lua
View file @
7c5aa160
...
...
@@ -44,6 +44,7 @@ target("infiniop-ascend")
on_install
(
function
(
target
)
end
)
add_cxflags
(
"-lstdc++ -fPIC"
)
add_cxxflags
(
"-lstdc++ -fPIC"
)
set_warnings
(
"all"
,
"error"
)
set_languages
(
"cxx17"
)
...
...
@@ -62,6 +63,7 @@ target("infinirt-ascend")
-- Add files
add_files
(
"$(projectdir)/src/infinirt/ascend/*.cc"
)
add_cxflags
(
"-lstdc++ -Wall -Werror -fPIC"
)
add_cxxflags
(
"-lstdc++ -Wall -Werror -fPIC"
)
target_end
()
target
(
"infiniccl-ascend"
)
...
...
@@ -76,5 +78,6 @@ target("infiniccl-ascend")
add_links
(
"libhccl.so"
)
add_files
(
"../src/infiniccl/ascend/*.cc"
)
add_cxflags
(
"-lstdc++ -fPIC"
)
add_cxxflags
(
"-lstdc++ -fPIC"
)
end
target_end
()
xmake/bang.lua
View file @
7c5aa160
...
...
@@ -41,6 +41,7 @@ target("infiniop-cambricon")
on_install
(
function
(
target
)
end
)
add_cxflags
(
"-lstdc++ -fPIC"
)
add_cxxflags
(
"-lstdc++ -fPIC"
)
set_warnings
(
"all"
,
"error"
)
set_languages
(
"cxx17"
)
...
...
@@ -59,6 +60,7 @@ target("infinirt-cambricon")
-- Add include dirs
add_files
(
"../src/infinirt/bang/*.cc"
)
add_cxflags
(
"-lstdc++ -Wall -Werror -fPIC"
)
add_cxxflags
(
"-lstdc++ -Wall -Werror -fPIC"
)
target_end
()
target
(
"infiniccl-cambricon"
)
...
...
@@ -89,6 +91,7 @@ target("infiniccl-cambricon")
add_files
(
"../src/infiniccl/cambricon/*.cc"
)
add_cxflags
(
"-fPIC"
)
add_cxxflags
(
"-fPIC"
)
add_ldflags
(
"-fPIC"
)
else
print
(
"[Warning] CNCL is currently only supported on Linux"
)
...
...
xmake/cpu.lua
View file @
7c5aa160
...
...
@@ -6,14 +6,15 @@ target("infiniop-cpu")
set_warnings
(
"all"
,
"error"
)
if
is_plat
(
"windows"
)
then
add_cxflags
(
"/wd4068"
)
add_cx
x
flags
(
"/wd4068"
)
if
has_config
(
"omp"
)
then
add_cxflags
(
"/openmp"
)
add_cx
x
flags
(
"/openmp"
)
end
else
add_cxflags
(
"-fPIC"
,
"-Wno-unknown-pragmas"
)
add_cxxflags
(
"-fPIC"
,
"-Wno-unknown-pragmas"
)
if
has_config
(
"omp"
)
then
add_cxflags
(
"-fopenmp"
)
add_cx
x
flags
(
"-fopenmp"
)
add_ldflags
(
"-fopenmp"
)
end
end
...
...
@@ -32,6 +33,7 @@ target("infinirt-cpu")
if
not
is_plat
(
"windows"
)
then
add_cxflags
(
"-fPIC"
)
add_cxxflags
(
"-fPIC"
)
end
set_languages
(
"cxx17"
)
...
...
xmake/hygon.lua
View file @
7c5aa160
...
...
@@ -60,6 +60,7 @@ target("infiniop-hygon")
add_cuflags
(
"-fPIC"
,
"-std=c++17"
,
{
force
=
true
})
add_culdflags
(
"-fPIC"
)
add_cxflags
(
"-fPIC"
)
add_cxxflags
(
"-fPIC"
)
-- 添加海光DCU特定的编译标志
add_cuflags
(
"-arch=gfx906"
,
"-arch=gfx926"
,
"-arch=gfx928"
,
"-arch=gfx936"
)
...
...
@@ -76,7 +77,7 @@ target("infiniop-hygon")
add_files
(
"../src/infiniop/ops/swiglu/nvidia/*.cu"
)
if
has_config
(
"ninetoothed"
)
then
add_files
(
"../build/ninetoothed/*.c"
,
{
cxflags
=
{
"-Wno-return-type"
}})
add_files
(
"../build/ninetoothed/*.c"
,
{
cx
x
flags
=
{
"-Wno-return-type"
}})
end
target_end
()
...
...
@@ -105,6 +106,7 @@ target("infinirt-hygon")
add_cuflags
(
"-fPIC"
,
"-std=c++17"
,
{
force
=
true
})
add_culdflags
(
"-fPIC"
)
add_cxflags
(
"-fPIC"
)
add_cxxflags
(
"-fPIC"
)
-- 添加海光DCU特定的编译标志
add_cuflags
(
"-arch=gfx906"
,
"-arch=gfx926"
,
"-arch=gfx928"
,
"-arch=gfx936"
)
...
...
@@ -138,6 +140,7 @@ target("infiniccl-hygon")
add_cuflags
(
"-fPIC"
,
"-std=c++17"
,
{
force
=
true
})
add_culdflags
(
"-fPIC"
)
add_cxflags
(
"-fPIC"
)
add_cxxflags
(
"-fPIC"
)
-- 添加海光DCU特定的编译标志
add_cuflags
(
"-arch=gfx906"
,
"-arch=gfx926"
,
"-arch=gfx928"
,
"-arch=gfx936"
)
...
...
xmake/iluvatar.lua
View file @
7c5aa160
...
...
@@ -49,6 +49,7 @@ target("infiniop-iluvatar")
end
add_culdflags
(
"-fPIC"
)
add_cxflags
(
"-fPIC"
)
add_cxxflags
(
"-fPIC"
)
-- set_languages("cxx17") 天数似乎不能用这个配置
add_files
(
"../src/infiniop/devices/nvidia/*.cu"
,
"../src/infiniop/ops/*/nvidia/*.cu"
)
...
...
@@ -57,7 +58,7 @@ target("infiniop-iluvatar")
add_files
(
"../src/infiniop/ops/dequantize_awq/iluvatar/*.cu"
)
if
has_config
(
"ninetoothed"
)
then
add_files
(
"../build/ninetoothed/*.c"
,
{
cxflags
=
{
"-Wno-return-type"
}})
add_files
(
"../build/ninetoothed/*.c"
,
{
cx
x
flags
=
{
"-Wno-return-type"
}})
end
target_end
()
...
...
@@ -76,6 +77,7 @@ target("infinirt-iluvatar")
add_cuflags
(
"-fPIC"
,
"-x"
,
"ivcore"
,
"-std=c++17"
,
{
force
=
true
})
add_culdflags
(
"-fPIC"
)
add_cxflags
(
"-fPIC"
)
add_cxxflags
(
"-fPIC"
)
-- set_languages("cxx17") 天数似乎不能用这个配置
add_files
(
"../src/infinirt/cuda/*.cu"
)
...
...
@@ -97,6 +99,7 @@ target("infiniccl-iluvatar")
add_cuflags
(
"-fPIC"
,
"-x"
,
"ivcore"
,
"-std=c++17"
,
{
force
=
true
})
add_culdflags
(
"-fPIC"
)
add_cxflags
(
"-fPIC"
)
add_cxxflags
(
"-fPIC"
)
local
nccl_root
=
os.getenv
(
"NCCL_ROOT"
)
if
nccl_root
then
...
...
xmake/kunlun.lua
View file @
7c5aa160
...
...
@@ -75,6 +75,7 @@ target("infiniop-kunlun")
on_install
(
function
(
target
)
end
)
add_cxflags
(
"-lstdc++ -fPIC -Wno-error=unused-function"
)
add_cxxflags
(
"-lstdc++ -fPIC -Wno-error=unused-function"
)
set_warnings
(
"all"
,
"error"
)
set_languages
(
"cxx17"
)
...
...
@@ -102,6 +103,7 @@ target("infinirt-kunlun")
-- Add include dirs
add_files
(
"$(projectdir)/src/infinirt/kunlun/*.cc"
)
add_cxflags
(
"-lstdc++ -Wall -Werror -fPIC"
)
add_cxxflags
(
"-lstdc++ -Wall -Werror -fPIC"
)
target_end
()
target
(
"infiniccl-kunlun"
)
...
...
@@ -117,5 +119,6 @@ target("infiniccl-kunlun")
add_links
(
"bkcl"
)
add_files
(
"$(projectdir)/src/infiniccl/kunlun/*.cc"
)
add_cxflags
(
"-lstdc++ -fPIC"
)
add_cxxflags
(
"-lstdc++ -fPIC"
)
end
target_end
()
xmake/metax.lua
View file @
7c5aa160
...
...
@@ -48,11 +48,19 @@ target("infiniop-metax")
set_languages
(
"cxx17"
)
set_warnings
(
"all"
,
"error"
)
add_cxflags
(
"-lstdc++"
,
"-fPIC"
,
"-Wno-defaulted-function-deleted"
,
"-Wno-strict-aliasing"
,
{
force
=
true
})
add_cxxflags
(
"-lstdc++"
,
"-fPIC"
,
"-Wno-defaulted-function-deleted"
,
"-Wno-strict-aliasing"
,
{
force
=
true
})
add_files
(
"../src/infiniop/devices/metax/*.cc"
,
"../src/infiniop/ops/*/metax/*.cc"
)
add_files
(
"../src/infiniop/ops/*/metax/*.maca"
,
{
rule
=
"maca"
})
if
has_config
(
"ninetoothed"
)
then
add_files
(
"../build/ninetoothed/*.c"
,
{
cxflags
=
{
"-include stdlib.h"
,
"-Wno-return-type"
}})
add_files
(
"../build/ninetoothed/*.c"
,
{
cxflags
=
{
"-include stdlib.h"
,
"-Wno-return-type"
,
"-Wno-implicit-function-declaration"
,
"-Wno-builtin-declaration-mismatch"
}
})
end
target_end
()
...
...
@@ -63,6 +71,7 @@ target("infinirt-metax")
add_deps
(
"infini-utils"
)
set_warnings
(
"all"
,
"error"
)
add_cxflags
(
"-lstdc++ -fPIC"
)
add_cxxflags
(
"-lstdc++ -fPIC"
)
add_files
(
"../src/infinirt/metax/*.cc"
)
target_end
()
...
...
@@ -73,6 +82,7 @@ target("infiniccl-metax")
set_warnings
(
"all"
,
"error"
)
if
not
is_plat
(
"windows"
)
then
add_cxflags
(
"-fPIC"
)
add_cxxflags
(
"-fPIC"
)
end
if
has_config
(
"ccl"
)
then
if
has_config
(
"use-mc"
)
then
...
...
xmake/moore.lua
View file @
7c5aa160
...
...
@@ -42,6 +42,7 @@ target("infiniop-moore")
set_languages
(
"cxx17"
)
set_warnings
(
"all"
,
"error"
)
add_cxflags
(
"-lstdc++"
,
"-fPIC"
,
"-Wno-comment"
)
add_cxxflags
(
"-lstdc++"
,
"-fPIC"
,
"-Wno-comment"
)
add_files
(
"../src/infiniop/devices/moore/*.cc"
)
add_files
(
"../src/infiniop/ops/*/moore/*.mu"
,
{
rule
=
"mu"
})
...
...
@@ -56,6 +57,7 @@ target("infinirt-moore")
add_deps
(
"infini-utils"
)
set_warnings
(
"all"
,
"error"
)
add_cxflags
(
"-lstdc++"
,
"-fPIC"
)
add_cxxflags
(
"-lstdc++"
,
"-fPIC"
)
add_files
(
"../src/infinirt/moore/*.cc"
)
target_end
()
...
...
@@ -66,6 +68,7 @@ target("infiniccl-moore")
set_warnings
(
"all"
,
"error"
)
if
not
is_plat
(
"windows"
)
then
add_cxflags
(
"-fPIC"
)
add_cxxflags
(
"-fPIC"
)
end
if
has_config
(
"ccl"
)
then
add_links
(
"libmccl.so"
)
...
...
xmake/nvidia.lua
View file @
7c5aa160
...
...
@@ -48,6 +48,7 @@ target("infiniop-nvidia")
add_cuflags
(
"-Xcompiler=-fPIC"
)
add_cuflags
(
"--extended-lambda"
)
add_culdflags
(
"-Xcompiler=-fPIC"
)
add_cxflags
(
"-fPIC"
)
add_cxxflags
(
"-fPIC"
)
add_cflags
(
"-fPIC"
)
add_cuflags
(
"--expt-relaxed-constexpr"
)
...
...
@@ -93,6 +94,7 @@ target("infinirt-nvidia")
add_cuflags
(
"-Xcompiler=-fPIC"
)
add_culdflags
(
"-Xcompiler=-fPIC"
)
add_cxflags
(
"-fPIC"
)
add_cxxflags
(
"-fPIC"
)
end
set_languages
(
"cxx17"
)
...
...
@@ -112,6 +114,7 @@ target("infiniccl-nvidia")
add_cuflags
(
"-Xcompiler=-fPIC"
)
add_culdflags
(
"-Xcompiler=-fPIC"
)
add_cxflags
(
"-fPIC"
)
add_cxxflags
(
"-fPIC"
)
local
nccl_root
=
os.getenv
(
"NCCL_ROOT"
)
if
nccl_root
then
...
...
xmake/qy.lua
View file @
7c5aa160
...
...
@@ -88,6 +88,7 @@ target("infiniop-qy")
add_cuflags
(
"-Xcompiler=-fPIC"
)
add_cuflags
(
"--extended-lambda"
)
add_culdflags
(
"-Xcompiler=-fPIC"
)
add_cxflags
(
"-fPIC"
)
add_cxxflags
(
"-fPIC"
)
add_cuflags
(
"--expt-relaxed-constexpr"
)
if
CUDNN_ROOT
~=
nil
then
...
...
@@ -117,6 +118,7 @@ target("infinirt-qy")
add_cuflags
(
"-Xcompiler=-fPIC"
)
add_culdflags
(
"-Xcompiler=-fPIC"
)
add_cxflags
(
"-fPIC"
)
add_cxxflags
(
"-fPIC"
)
end
set_languages
(
"cxx17"
)
...
...
@@ -133,6 +135,7 @@ target("infiniccl-qy")
add_cuflags
(
"-Xcompiler=-fPIC"
)
add_culdflags
(
"-Xcompiler=-fPIC"
)
add_cxflags
(
"-fPIC"
)
add_cxxflags
(
"-fPIC"
)
local
nccl_root
=
os.getenv
(
"NCCL_ROOT"
)
if
nccl_root
then
...
...
xmake/test.lua
View file @
7c5aa160
...
...
@@ -24,7 +24,7 @@ target("infiniop-test")
add_links
(
"infiniop"
,
"infinirt"
)
if
has_config
(
"omp"
)
then
add_cxflags
(
"-fopenmp"
)
add_cx
x
flags
(
"-fopenmp"
)
add_ldflags
(
"-fopenmp"
)
end
...
...
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