xmake.lua 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package("superlu")
  2. set_homepage("https://portal.nersc.gov/project/sparse/superlu/")
  3. set_description("SuperLU is a general purpose library for the direct solution of large, sparse, nonsymmetric systems of linear equations.")
  4. set_license("BSD-3-Clause")
  5. add_urls("https://github.com/xiaoyeli/superlu/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/xiaoyeli/superlu.git")
  7. add_versions("v5.2.2", "470334a72ba637578e34057f46948495e601a5988a602604f5576367e606a28c")
  8. add_versions("v5.3.0", "3e464afa77335de200aeb739074a11e96d9bef6d0b519950cfa6684c4be1f350")
  9. add_configs("blas", {description = "Choose BLAS library to use.", default = "mkl", type = "string", values = {"mkl", "openblas"}})
  10. on_load("windows", "linux", "macosx", function (package)
  11. package:add("deps", package:config("blas"))
  12. end)
  13. on_install("windows", "linux", "macosx", function (package)
  14. os.cd("SRC")
  15. io.writefile("xmake.lua", format([[
  16. add_rules("mode.debug", "mode.release")
  17. add_requires("%s")
  18. target("superlu")
  19. set_kind("$(kind)")
  20. add_defines("USE_VENDOR_BLAS")
  21. if is_plat("windows") and is_kind("shared") then
  22. add_rules("utils.symbols.export_all")
  23. end
  24. add_files("*.c")
  25. add_includedirs(".")
  26. add_headerfiles("*.h")
  27. add_packages("%s")
  28. ]], package:config("blas"), package:config("blas")))
  29. local configs = {kind = package:config("shared") and "shared" or "static"}
  30. import("package.tools.xmake").install(package, configs)
  31. end)
  32. on_test(function (package)
  33. assert(package:has_cfuncs("dCreate_Dense_Matrix", {includes = "slu_ddefs.h"}))
  34. end)