Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions packages/e/eigen/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ package("eigen")
add_versions("3.3.8", "0215c6593c4ee9f1f7f28238c4e8995584ebf3b556e9dbf933d84feb98d5b9ef")
add_versions("3.3.9", "0fa5cafe78f66d2b501b43016858070d52ba47bd9b1016b0165a7b8e04675677")
add_versions("3.4.0", "b4c198460eba6f28d34894e3a5710998818515104d6e74e5cc331ce31e46e626")
add_versions("3.4.1", "8bb7280b7551bf06418d11a9671fdf998cb927830cf21589b394382d26779821")

add_configs("blas", {description = "Provide a Eigen-implemented BLAS.", default = false, type = "boolean"})
add_configs("lapack", {description = "Provide a Eigen-implemented LAPACK.", default = false, type = "boolean"})

if is_plat("mingw") and is_subhost("msys") then
add_extsources("pacman::eigen3")
elseif is_plat("linux") then
add_extsources("pacman::eigen", "apt::libeigen3-dev")
add_extsources("pacman::eigen3", "apt::libeigen3-dev")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The pacman package for Eigen on Linux distributions like Arch Linux is named eigen, not eigen3. This change will likely break the external source installation for users on those systems. Please revert this to pacman::eigen.

        add_extsources("pacman::eigen", "apt::libeigen3-dev")

elseif is_plat("macosx") then
add_extsources("brew::eigen")
end

add_deps("cmake")
add_includedirs("include")
add_includedirs("include/eigen3")
add_includedirs("include", "include/eigen3")
on_load(function (package)
if not package:config("blas") and not package:config("lapack") then
package:set("kind", "library", {headeronly = true})
Expand All @@ -38,7 +38,12 @@ package("eigen")
if not package:config("lapack") then
io.replace("CMakeLists.txt", "add_subdirectory(lapack", "#", {plain = true})
end
import("package.tools.cmake").install(package, {"-DBUILD_TESTING=OFF"})
local configs = {
"-DBUILD_TESTING=OFF",
"-DEIGEN_BUILD_DEMOS=OFF",
"-DEIGEN_BUILD_DOC=OFF",
}
import("package.tools.cmake").install(package, configs)

if not os.isfile(package:installdir("include/eigen3/Eigen/Dense")) then
os.vcp("unsupported/Eigen", package:installdir("include/eigen3/unsupported"))
Expand All @@ -48,17 +53,14 @@ package("eigen")

on_test(function (package)
assert(package:check_cxxsnippets({test = [[
#include <iostream>
#include <Eigen/Dense>
using Eigen::MatrixXd;
void test()
{
void test() {
MatrixXd m(2,2);
m(0,0) = 3;
m(1,0) = 2.5;
m(0,1) = -1;
m(1,1) = m(1,0) + m(0,1);
std::cout << m << std::endl;
}
]]}, {configs = {languages = "c++11"}}))
end)
Loading