From 1193b60dc68927eb9132a9dc05d5a08ffc1655c0 Mon Sep 17 00:00:00 2001 From: benny066567 <58126350+hahahahbenny@users.noreply.github.com> Date: Sun, 22 Sep 2024 21:31:24 +0800 Subject: [PATCH] add lapack repo (#5313) * add lapack repo * Limit the platform to Linux * fix grammar problem and add test * delete the cpp version --- packages/l/lapack/xmake.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 packages/l/lapack/xmake.lua diff --git a/packages/l/lapack/xmake.lua b/packages/l/lapack/xmake.lua new file mode 100644 index 000000000..12cb3439e --- /dev/null +++ b/packages/l/lapack/xmake.lua @@ -0,0 +1,24 @@ +package("lapack") + set_homepage("https://netlib.org/lapack/") + set_description("LAPACK--Linear Algebra Package is a standard software library for numerical linear algebra") + + add_urls("https://github.com/Reference-LAPACK/lapack/archive/refs/tags/$(version).tar.gz", + "https://github.com/Reference-LAPACK/lapack.git") + + add_versions("v3.12.0", "eac9570f8e0ad6f30ce4b963f4f033f0f643e7c3912fc9ee6cd99120675ad48b") + + add_deps("cmake", "gfortran") + + add_links( "lapacke", "lapack", "cblas", "blas") + + on_install("linux", function (package) + local configs = {"-DLAPACKE=ON", "-DBUILD_TESTING=OFF", "-DCBLAS=ON"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("cblas_snrm2", {includes = "cblas.h"})) + assert(package:has_cfuncs("LAPACKE_dsyev", {includes = "lapacke_utils.h"})) + end)