Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ python scripts/install.py [XMAKE_CONFIG_FLAGS]
xmake f --nv-gpu=true --cuda=$CUDA_HOME -cv

# QY
# 需要指定环境变量QY_ROOT来确认库所在位置,比如说export QY_ROOT=/usr/local/XX
xmake f --qy-gpu=true --cuda=$CUDA_HOME -cv

# 寒武纪
Expand Down
16 changes: 10 additions & 6 deletions xmake/qy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ end
return container_path
end

add_includedirs("/usr/local/denglin/sdk/include", "../include")
add_linkdirs("/usr/local/denglin/sdk/lib")
local QY_ROOT = os.getenv("QY_ROOT") or os.getenv("QY_HOME") or os.getenv("QY_PATH")
if QY_ROOT ~= nil then
add_includedirs(QY_ROOT .. "sdk/include")
add_linkdirs(QY_ROOT .. "/sdk/lib")
end

add_links("curt", "cublas", "cudnn")
set_languages("cxx17")
add_cxxflags("-std=c++17") -- 显式设置 C++17
Expand All @@ -52,7 +56,7 @@ rule("qy.cuda")
local qy_objfiles = {}

on_load(function (target)
target:add("includedirs", "/usr/local/denglin/sdk/include")
target:add("includedirs", QY_ROOT .. "/sdk/include")
end)

after_load(function (target)
Expand All @@ -72,8 +76,8 @@ rule("qy.cuda")
import("core.project.config")
import("core.base.option")

local dlcc = "/usr/local/denglin/sdk/bin/dlcc"
local sdk_path = "/usr/local/denglin/sdk"
local dlcc = QY_ROOT .. "/sdk/bin/dlcc"
local sdk_path = QY_ROOT .. "/sdk"
local arch = "dlgput64"


Expand Down Expand Up @@ -204,7 +208,7 @@ target("flash-attn-qy")

if FLASH_ATTN_ROOT and FLASH_ATTN_ROOT ~= "" then
before_build(function (target)
target:add("includedirs", "/usr/local/denglin/sdk/include", {public = true})
target:add("includedirs", QY_ROOT .. "/sdk/include", {public = true})
local TORCH_DIR = os.iorunv("python", {"-c", "import torch, os; print(os.path.dirname(torch.__file__))"}):trim()
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()
Expand Down
Loading