|
@@ -2,24 +2,33 @@ package("metis")
|
|
|
|
|
|
set_homepage("http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
|
|
|
set_description("Serial Graph Partitioning and Fill-reducing Matrix Ordering")
|
|
|
+ set_license("Apache-2.0")
|
|
|
|
|
|
- add_urls("https://github.com/xq114/METIS/archive/v$(version).tar.gz")
|
|
|
- add_versions("5.1.1", "945d381d3b50ca70ac93f0daf32c80e6f16f11514879d5ff1438aa82c20a0ba5")
|
|
|
+ add_urls("https://github.com/KarypisLab/METIS/archive/refs/tags/$(version).tar.gz")
|
|
|
+ add_versions("v5.2.1", "1a4665b2cd07edc2f734e30d7460afb19c1217c2547c2ac7bf6e1848d50aff7a")
|
|
|
+
|
|
|
+ add_patches("5.2.1", "patches/5.2.1/gklib.patch", "63e5035241f23ee664800ec1811ea8baa69895c71ec007ab1a95103a290c11eb")
|
|
|
+ add_resources("5.2.1", "gklib", "https://github.com/KarypisLab/GKlib.git", "8bd6bad750b2b0d90800c632cf18e8ee93ad72d7")
|
|
|
|
|
|
- add_deps("cmake")
|
|
|
add_configs("long_index", {description = "Use 64-bit uint as index.", default = false, type = "boolean"})
|
|
|
add_configs("double", {description = "Use double precision floats.", default = true, type = "boolean"})
|
|
|
|
|
|
+ add_deps("cmake")
|
|
|
+ if is_plat("linux") then
|
|
|
+ add_syslinks("m")
|
|
|
+ end
|
|
|
on_install("windows", "macosx", "linux", function (package)
|
|
|
- if package:config("long_index") then
|
|
|
- io.gsub(path.join("include", "metis.h"), "define IDXTYPEWIDTH %d+", "define IDXTYPEWIDTH 64")
|
|
|
- end
|
|
|
- if package:config("double") then
|
|
|
- io.gsub(path.join("include", "metis.h"), "define REALTYPEWIDTH %d+", "define REALTYPEWIDTH 64")
|
|
|
- end
|
|
|
+ local idx_width = package:config("long_index") and 64 or 32
|
|
|
+ io.gsub(path.join("include", "metis.h"), "//#define IDXTYPEWIDTH %d+", "#define IDXTYPEWIDTH " .. idx_width)
|
|
|
+ local real_width = package:config("double") and 64 or 32
|
|
|
+ io.gsub(path.join("include", "metis.h"), "//#define REALTYPEWIDTH %d+", "#define REALTYPEWIDTH " .. real_width)
|
|
|
+ io.replace(path.join(package:resourcefile("gklib"), "gk_arch.h"), "gk_ms_stdint.h", "stdint.h", {plain = true})
|
|
|
+ io.replace(path.join(package:resourcefile("gklib"), "gk_arch.h"), "gk_ms_inttypes.h", "inttypes.h", {plain = true})
|
|
|
+
|
|
|
local configs = {}
|
|
|
- table.insert(configs, "-DSHARED=" .. (package:config("shared") and "ON" or "OFF"))
|
|
|
table.insert(configs, "-DDEBUG=" .. (package:debug() and "ON" or "OFF"))
|
|
|
+ table.insert(configs, "-DSHARED=" .. (package:config("shared") and "ON" or "OFF"))
|
|
|
+ table.insert(configs, "-DGKLIB_PATH=" .. package:resourcefile("gklib"):gsub("\\", "/"))
|
|
|
import("package.tools.cmake").install(package, configs)
|
|
|
end)
|
|
|
|