2011-03-10 05:11:03 +00:00
|
|
|
class Eigen < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "C++ template library for linear algebra"
|
2014-12-24 18:29:15 +00:00
|
|
|
homepage "http://eigen.tuxfamily.org/"
|
2016-01-08 12:40:09 +00:00
|
|
|
url "https://bitbucket.org/eigen/eigen/get/3.2.7.tar.bz2"
|
|
|
|
sha256 "e58e1a11b23cf2754e32b3c5990f318a8461a3613c7acbf6035870daa45c2f3e"
|
2015-10-05 13:36:04 +00:00
|
|
|
head "https://bitbucket.org/eigen/eigen", :using => :hg
|
2014-03-09 10:57:03 +00:00
|
|
|
|
2014-08-30 15:44:58 +00:00
|
|
|
bottle do
|
2015-09-13 19:35:34 +00:00
|
|
|
cellar :any_skip_relocation
|
2015-12-29 13:24:46 +00:00
|
|
|
revision 1
|
|
|
|
sha256 "79253659ae74f1bcf2293be0ddb1a31c8d763b2ddaed75de3a69ac6e9b234c2e" => :el_capitan
|
|
|
|
sha256 "82ee2a1528e9d69a71bbf07d59f330dcbf067b5ec14553f4051cc69e52cb1d24" => :yosemite
|
|
|
|
sha256 "d0ba02c5d3c6e5ea89679cb85bdddd28fafcdcf65174e2c123e2407d7f7b1c34" => :mavericks
|
2014-08-30 15:44:58 +00:00
|
|
|
end
|
|
|
|
|
2015-10-05 13:36:04 +00:00
|
|
|
option :universal
|
2010-03-18 15:43:45 +00:00
|
|
|
|
2014-12-24 18:29:15 +00:00
|
|
|
depends_on "cmake" => :build
|
2010-03-18 15:43:45 +00:00
|
|
|
|
|
|
|
def install
|
2012-08-20 05:01:22 +00:00
|
|
|
ENV.universal_binary if build.universal?
|
2015-12-29 13:03:31 +00:00
|
|
|
|
2014-12-24 18:29:15 +00:00
|
|
|
mkdir "eigen-build" do
|
2012-05-26 16:46:23 +00:00
|
|
|
args = std_cmake_args
|
2014-12-24 18:29:15 +00:00
|
|
|
args << "-Dpkg_config_libdir=#{lib}" << ".."
|
|
|
|
system "cmake", *args
|
2015-08-03 12:55:31 +00:00
|
|
|
system "make", "install"
|
2011-04-04 21:22:56 +00:00
|
|
|
end
|
2014-12-24 19:01:41 +00:00
|
|
|
(share/"cmake/Modules").install "cmake/FindEigen3.cmake"
|
2010-03-18 15:43:45 +00:00
|
|
|
end
|
2014-12-06 08:56:33 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.cpp").write <<-EOS.undent
|
|
|
|
#include <iostream>
|
|
|
|
#include <Eigen/Dense>
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
system ENV.cxx, "test.cpp", "-I#{include}/eigen3", "-o", "test"
|
2015-12-29 13:03:31 +00:00
|
|
|
assert_equal %w[3 -1 2.5 1.5], shell_output("./test").split
|
2014-12-06 08:56:33 +00:00
|
|
|
end
|
2010-03-18 15:43:45 +00:00
|
|
|
end
|