2011-03-10 05:11:03 +00:00
|
|
|
class Eigen < Formula
|
2014-12-24 18:29:15 +00:00
|
|
|
homepage "http://eigen.tuxfamily.org/"
|
2015-02-09 15:31:42 +00:00
|
|
|
url "http://bitbucket.org/eigen/eigen/get/3.2.4.tar.bz2"
|
|
|
|
sha1 "64ea809acc449adbd8fe616def7d48ff4f0776a8"
|
2014-03-09 10:57:03 +00:00
|
|
|
|
2014-08-30 15:44:58 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2015-02-09 16:06:08 +00:00
|
|
|
sha1 "24b12f960b5d1b29814baee5d4ffd1f070d82b93" => :yosemite
|
|
|
|
sha1 "4aeb1dc9374989f6721e655a51443c5fd92770bf" => :mavericks
|
|
|
|
sha1 "69d4e8c691887006dfdae968ea8650c11cff3b51" => :mountain_lion
|
2014-08-30 15:44:58 +00:00
|
|
|
end
|
|
|
|
|
2014-12-24 18:29:15 +00:00
|
|
|
head "https://bitbucket.org/eigen/eigen", :using => :hg
|
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
|
|
|
|
2012-08-20 05:01:22 +00:00
|
|
|
option :universal
|
|
|
|
|
2010-03-18 15:43:45 +00:00
|
|
|
def install
|
2012-08-20 05:01:22 +00:00
|
|
|
ENV.universal_binary if build.universal?
|
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.delete "-DCMAKE_BUILD_TYPE=None"
|
|
|
|
args << "-DCMAKE_BUILD_TYPE=Release"
|
|
|
|
args << "-Dpkg_config_libdir=#{lib}" << ".."
|
|
|
|
system "cmake", *args
|
|
|
|
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"
|
|
|
|
assert_equal `./test`.split, %w[3 -1 2.5 1.5]
|
|
|
|
end
|
2010-03-18 15:43:45 +00:00
|
|
|
end
|