Skip to content

Commit

Permalink
suitesparse: able to set graphblas option with string
Browse files Browse the repository at this point in the history
  • Loading branch information
Chi-EEE committed Jan 22, 2024
1 parent 13198bf commit 42815c6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 4 additions & 3 deletions packages/s/suitesparse/port/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ add_rules("mode.debug", "mode.release")
option("with_cuda", {default = false, showmenu = true, description = "Build with CUDA support."})
option("with_blas", {default = "mkl", showmenu = true, description = "Choose BLAS vendor.", values={"mkl", "openblas"}})
option("complex", {default = false, showmenu = true, description = "Build with complex number support."})
option("graphblas", {default = false, showmenu = true, description = "Build GraphBLAS module."})
option("graphblas", {default = "none", showmenu = true, description = "Set GraphBLAS module.", values={"none", "shared", "static"}})

-- set dependencies
add_requires("metis")
Expand Down Expand Up @@ -160,9 +160,10 @@ target("SPQR")
end
target_end()

if has_config("graphblas") then
local graphblas_kind = get_config("graphblas")
if graphblas_kind ~= "none" then
target("GraphBLAS")
set_kind("$(kind)")
set_kind(graphblas_kind)
add_files("GraphBLAS/Source/*.c", "GraphBLAS/Source/Generated/*.c")
add_includedirs("GraphBLAS/Include", "GraphBLAS/Source", "GraphBLAS/Source/Template", "GraphBLAS/Source/Generated")
add_headerfiles("GraphBLAS/Include/*.h")
Expand Down
7 changes: 5 additions & 2 deletions packages/s/suitesparse/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package("suitesparse")
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", "apple"}})
add_configs("blas_static", {description = "Use static BLAS library.", default = true, type = "boolean"})
add_configs("graphblas", {description = "Enable static GraphBLAS module.", default = false, type = "boolean"})
add_configs("graphblas", {description = "Set GraphBLAS module.", default = "none", type = "string", values = {"none", "shared", "static"}})

add_deps("metis")
if not is_plat("windows") then
Expand Down Expand Up @@ -49,11 +49,14 @@ package("suitesparse")
if package:is_plat("windows") and not package:config("shared") then
suffix = "_static"
end
if package:config("graphblas") ~= "none" then
package:add("links", "graphblas" .. suffix)
end
for _, lib in ipairs({"lagraphx", "lagraph", "graphblas", "spex", "spqr", "rbio", "ParU", "umfpack", "ldl", "klu", "klu_cholmod", "cxsparse", "cholmod", "colamd", "ccolamd", "camd", "btf", "amd", "suitesparse_mongoose", "suitesparseconfig"}) do
package:add("links", lib .. suffix)
end
else
if package:config("graphblas") then
if package:config("graphblas") ~= "none" then
package:add("links", "GraphBLAS")
end
for _, lib in ipairs({"SPQR", "UMFPACK", "LDL", "KLU", "CXSparse", "CHOLMOD", "COLAMD", "CCOLAMD", "CAMD", "BTF", "AMD", "suitesparseconfig"}) do
Expand Down

0 comments on commit 42815c6

Please sign in to comment.