package("spectra") set_kind("library", {headeronly = true}) set_homepage("https://spectralib.org/") set_description("Sparse Eigenvalue Computation Toolkit as a Redesigned ARPACK") set_license("MPL-2.0") add_urls("https://github.com/yixuan/spectra/archive/refs/tags/$(version).tar.gz", "https://github.com/yixuan/spectra.git") add_versions("v1.0.1", "919e3fbc8c539a321fd5a0766966922b7637cc52eb50a969241a997c733789f3") add_deps("cmake", "eigen") on_install("windows", "macosx", "linux", "mingw", "cross", function (package) import("package.tools.cmake").install(package) end) on_test(function (package) assert(package:check_cxxsnippets({test = [[ #include #include void test() { Eigen::MatrixXd A = Eigen::MatrixXd::Random(10, 10); Eigen::MatrixXd M = A + A.transpose(); Spectra::DenseSymMatProd op(M); Spectra::SymEigsSolver> eigs(op, 3, 6); eigs.init(); int nconv = eigs.compute(Spectra::SortRule::LargestAlge); } ]]}, {configs = {languages = "c++14"}})) end)