class Eigen < Formula desc "C++ template library for linear algebra" homepage "https://eigen.tuxfamily.org/" url "https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz" sha256 "8586084f71f9bde545ee7fa6d00288b264a2b7ac3607b974e54d13e7162c1c72" license "MPL-2.0" revision 1 head "https://gitlab.com/libeigen/eigen.git", branch: "master" livecheck do url :stable regex(/^v?(\d+(?:\.\d+)+)$/i) end no_autobump! because: :requires_manual_review bottle do rebuild 3 sha256 cellar: :any_skip_relocation, all: "06503290dc3c07a67b8f582046b0a7f0bd68c2cb2da1e5bc071710de5ba7f5ec" end depends_on "cmake" => :build def install system "cmake", "-S", ".", "-B", "eigen-build", "-Dpkg_config_libdir=#{lib}", *std_cmake_args system "cmake", "--install", "eigen-build" end test do (testpath/"test.cpp").write <<~CPP #include #include using Eigen::MatrixXd; int main() { 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; } CPP system ENV.cxx, "test.cpp", "-I#{include}/eigen3", "-o", "test" assert_equal %w[3 -1 2.5 1.5], shell_output("./test").split end end