forked from InfiniTensor/InfiniLM
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxmake.lua
More file actions
46 lines (36 loc) · 1.42 KB
/
Copy pathxmake.lua
File metadata and controls
46 lines (36 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
add_requires("pybind11")
set_toolchains("gcc")
option("cxx11-abi")
set_default(nil)
set_showmenu(true)
set_description("Set _GLIBCXX_USE_CXX11_ABI to match the installed InfiniCore")
set_values("0", "1")
option_end()
local cxx11_abi = os.getenv("INFINILM_CXX11_ABI") or get_config("cxx11-abi")
if cxx11_abi and cxx11_abi ~= "" then
if cxx11_abi ~= "0" and cxx11_abi ~= "1" then
raise("INFINILM_CXX11_ABI must be 0 or 1")
end
add_defines("_GLIBCXX_USE_CXX11_ABI=" .. cxx11_abi)
end
-- Add spdlog from third_party directory
add_includedirs("third_party/spdlog/include")
add_includedirs("third_party/json/single_include/")
target("_infinilm")
add_packages("pybind11")
set_default(false)
add_rules("python.module", {soabi = true})
set_languages("cxx17")
set_kind("shared")
local INFINI_ROOT = os.getenv("INFINI_ROOT") or (os.getenv(is_host("windows") and "HOMEPATH" or "HOME") .. "/.infini")
-- add_includedirs("csrc", { public = false })
-- add_includedirs("csrc/pybind11", { public = false })
add_includedirs(INFINI_ROOT.."/include", { public = true })
-- spdlog is already included globally via add_includedirs at the top
add_linkdirs(INFINI_ROOT.."/lib")
add_links("infinicore_cpp_api", "infiniop", "infinirt", "infiniccl")
-- Add C++ sources
add_files("csrc/**.cpp")
add_files("csrc/**.cc")
set_installdir("python/infinilm")
target_end()