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
e6b6fba5
Commit
e6b6fba5
authored
Mar 05, 2026
by
PanZezhong
Committed by
wooway777
Mar 05, 2026
Browse files
issue/1033 add fpic ldflag for infinirt and fix python link
parent
06362c94
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
9 deletions
+6
-9
xmake.lua
xmake.lua
+1
-0
xmake/nvidia.lua
xmake/nvidia.lua
+5
-9
No files found.
xmake.lua
View file @
e6b6fba5
...
@@ -336,6 +336,7 @@ target("infinirt")
...
@@ -336,6 +336,7 @@ target("infinirt")
if
not
is_plat
(
"windows"
)
then
if
not
is_plat
(
"windows"
)
then
add_cxflags
(
"-fPIC"
)
add_cxflags
(
"-fPIC"
)
add_cxxflags
(
"-fPIC"
)
add_cxxflags
(
"-fPIC"
)
add_ldflags
(
"-fPIC"
,
{
force
=
true
})
end
end
set_installdir
(
os.getenv
(
"INFINI_ROOT"
)
or
(
os.getenv
(
is_host
(
"windows"
)
and
"HOMEPATH"
or
"HOME"
)
..
"/.infini"
))
set_installdir
(
os.getenv
(
"INFINI_ROOT"
)
or
(
os.getenv
(
is_host
(
"windows"
)
and
"HOMEPATH"
or
"HOME"
)
..
"/.infini"
))
add_files
(
"src/infinirt/*.cc"
)
add_files
(
"src/infinirt/*.cc"
)
...
...
xmake/nvidia.lua
View file @
e6b6fba5
...
@@ -147,14 +147,10 @@ target("flash-attn-nvidia")
...
@@ -147,14 +147,10 @@ target("flash-attn-nvidia")
before_build
(
function
(
target
)
before_build
(
function
(
target
)
if
FLASH_ATTN_ROOT
~=
nil
then
if
FLASH_ATTN_ROOT
~=
nil
then
local
outdata
=
os
.
iorunv
(
"python"
,
{
"-c"
,
"import torch, os; print(os.path.dirname(torch.__file__))"
}):
trim
()
local
TORCH_DIR
=
os
.
iorunv
(
"python"
,
{
"-c"
,
"import torch, os; print(os.path.dirname(torch.__file__))"
}):
trim
()
local
TORCH_DIR
=
outdata
local
PYTHON_INCLUDE
=
os
.
iorunv
(
"python"
,
{
"-c"
,
"import sysconfig; print(sysconfig.get_paths()['include'])"
}):
trim
()
local
PYTHON_LIB_DIR
=
os
.
iorunv
(
"python"
,
{
"-c"
,
"import sysconfig; print(sysconfig.get_config_var('LIBDIR'))"
}):
trim
()
local
outdata
=
os
.
iorunv
(
"python"
,
{
"-c"
,
"import sysconfig; print(sysconfig.get_paths()['include'])"
}):
trim
()
local
LIB_PYTHON
=
os
.
iorunv
(
"python"
,
{
"-c"
,
"import sysconfig, os; print(sysconfig.get_config_var('LDLIBRARY'))"
}):
trim
()
local
PYTHON_INCLUDE
=
outdata
local
outdata
=
os
.
iorunv
(
"python"
,
{
"-c"
,
"import sysconfig; print(sysconfig.get_config_var('LIBDIR'))"
}):
trim
()
local
PYTHON_LIB_DIR
=
outdata
-- Include dirs
-- Include dirs
target
:
add
(
"includedirs"
,
FLASH_ATTN_ROOT
..
"/csrc/flash_attn/src"
,
{
public
=
false
})
target
:
add
(
"includedirs"
,
FLASH_ATTN_ROOT
..
"/csrc/flash_attn/src"
,
{
public
=
false
})
target
:
add
(
"includedirs"
,
TORCH_DIR
..
"/include/torch/csrc/api/include"
,
{
public
=
false
})
target
:
add
(
"includedirs"
,
TORCH_DIR
..
"/include/torch/csrc/api/include"
,
{
public
=
false
})
...
@@ -165,7 +161,7 @@ target("flash-attn-nvidia")
...
@@ -165,7 +161,7 @@ target("flash-attn-nvidia")
-- Link libraries
-- Link libraries
target
:
add
(
"linkdirs"
,
TORCH_DIR
..
"/lib"
,
PYTHON_LIB_DIR
)
target
:
add
(
"linkdirs"
,
TORCH_DIR
..
"/lib"
,
PYTHON_LIB_DIR
)
target
:
add
(
"links"
,
"torch"
,
"torch_cuda"
,
"torch_cpu"
,
"c10"
,
"c10_cuda"
,
"torch_python"
,
"python3"
)
target
:
add
(
"links"
,
"torch"
,
"torch_cuda"
,
"torch_cpu"
,
"c10"
,
"c10_cuda"
,
"torch_python"
,
LIB_PYTHON
)
end
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