package An official xmake package repository
https://xrepo.xmake.io/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
2.2 KiB
46 lines
2.2 KiB
package("suitesparse") |
|
|
|
set_homepage("https://people.engr.tamu.edu/davis/suitesparse.html") |
|
set_description("SuiteSparse is a suite of sparse matrix algorithms") |
|
|
|
add_urls("https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/refs/tags/$(version).tar.gz", |
|
"https://github.com/DrTimothyAldenDavis/SuiteSparse.git") |
|
add_versions("v5.10.1", "acb4d1045f48a237e70294b950153e48dce5b5f9ca8190e86c2b8c54ce00a7ee") |
|
|
|
add_patches("v5.10.1", path.join(os.scriptdir(), "patches", "5.10.1", "msvc.patch"), "8ac61e9acfaa864a2528a14d3a7e6e86f6e6877de2fe93fdc87876737af5bf31") |
|
|
|
add_configs("cuda", {description = "Enable CUDA support.", default = false, type = "boolean"}) |
|
add_configs("blas", {description = "Set BLAS vendor.", default = "openblas", type = "string", values = {"mkl", "openblas"}}) |
|
add_configs("graphblas", {description = "Enable GraphBLAS module.", default = false, type = "boolean"}) |
|
|
|
add_deps("metis") |
|
if is_plat("linux") then |
|
add_syslinks("m", "rt") |
|
end |
|
on_load("windows", "macosx", "linux", function (package) |
|
if package:config("cuda") then |
|
package:add("deps", "cuda", {system = true, configs = {utils = {"cublas"}}}) |
|
package:add("links", "GPUQREngine") |
|
package:add("links", "SuiteSparse_GPURuntime") |
|
end |
|
if package:config("graphblas") then |
|
package:add("links", "GraphBLAS") |
|
end |
|
package:add("deps", package:config("blas")) |
|
for _, lib in ipairs({"SPQR", "UMFPACK", "LDL", "KLU", "CXSparse", "CHOLMOD", "COLAMD", "CCOLAMD", "CAMD", "BTF", "AMD", "suitesparseconfig"}) do |
|
package:add("links", lib) |
|
end |
|
end) |
|
|
|
on_install("windows", "macosx", "linux", function (package) |
|
os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") |
|
local configs = {} |
|
configs.with_blas = package:config("blas") |
|
configs.with_cuda = package:config("cuda") |
|
configs.graphblas = package:config("graphblas") |
|
import("package.tools.xmake").install(package, configs) |
|
end) |
|
|
|
on_test(function (package) |
|
assert(package:has_cfuncs("SuiteSparse_start", {includes = "SuiteSparse_config.h"})) |
|
end)
|
|
|