DNASequence/xmake.lua

53 lines
1.4 KiB
Lua
Raw Normal View History

2024-09-18 06:54:03 +00:00
add_rules("mode.debug","mode.release")
2024-09-18 07:27:36 +00:00
set_languages("c++23")
2024-09-21 14:32:34 +00:00
add_requires("pybind11")
2024-09-19 02:52:17 +00:00
if is_mode("release")then
set_optimize("aggressive") --这里使用了激进的优化,可能会导致浮点数计算不准确,考虑到本项目没有浮点计算,酌情考虑开启
2024-09-19 03:02:37 +00:00
-- set_optimize("fastest") --上面和下面的二选一,--表示注释
2024-09-19 02:52:17 +00:00
if is_plat("windows")then
2024-09-20 02:39:14 +00:00
-- 矢量化加速似乎没用
2024-09-19 02:52:17 +00:00
-- add_cxxflags("/arch:AVX512")
elseif is_plat("linux") or is_plat("mingw") or is_plat("clang")then
2024-09-20 02:39:14 +00:00
-- 矢量化加速似乎没用
2024-09-19 02:52:17 +00:00
-- add_cxxflags("-march=native")
end
end
2024-09-19 02:02:41 +00:00
2024-09-19 15:47:23 +00:00
if is_plat("windows")then
2024-09-20 03:44:13 +00:00
add_cxxflags("/openmp:llvm")
2024-09-19 15:47:23 +00:00
elseif is_plat("linux") or is_plat("mingw") or is_plat("clang")then
2024-09-20 01:33:45 +00:00
add_cxxflags("-fopenmp")
add_ldflags("-fopenmp")
2024-09-19 15:47:23 +00:00
end
2024-09-19 02:43:18 +00:00
add_includedirs("src/tools")
set_rundir("./")
2024-09-21 14:32:34 +00:00
target("dna_pybind")
add_defines("DNA_IS_PYBIND")
add_packages("pybind11")
set_kind("shared")
2024-09-21 15:44:31 +00:00
if is_plat("windows")then
set_filename("dna.pyd")
2024-09-21 15:46:13 +00:00
else
2024-09-21 15:52:30 +00:00
set_basename("dna")
2024-09-21 15:44:31 +00:00
end
2024-09-21 14:32:34 +00:00
add_files("src/main.cpp")
2024-09-21 15:28:41 +00:00
add_shflags("-fopenmp")
2024-09-21 14:32:34 +00:00
after_build(
function (target)
print(target:targetdir())
os.cp("*.py*",target:targetdir())
2024-09-21 15:55:35 +00:00
if is_plat("windows") then
os.cp("./dll/*.dll",target:targetdir())
end
2024-09-21 14:32:34 +00:00
end
)
2024-09-18 06:54:03 +00:00
target("dna")
2024-09-21 14:32:34 +00:00
set_kind("binary")
2024-09-18 07:27:36 +00:00
add_files("src/main.cpp")