forked from ahmadia/homebrew-science
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharmadillo.rb
48 lines (40 loc) · 1.41 KB
/
armadillo.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
class Armadillo < Formula
desc "C++ linear algebra library"
homepage "https://arma.sourceforge.io/"
url "https://downloads.sourceforge.net/project/arma/armadillo-7.950.1.tar.xz"
sha256 "a32da32a0ea420b8397a53e4b40ed279c1a5fc791dd492a2ced81ffb14ad0d1b"
bottle do
cellar :any
sha256 "f4939714d766769c07d478357bbb566b315c568c7ef9955391738c9f835bbbb8" => :sierra
sha256 "8ed46aea32a660baa5771460e1daa8802434a736e53d1011111e4fad21fb3b8b" => :el_capitan
sha256 "0532cbdc768de8217a1f2a5c808bbe6ebe4a7b8c26e331075c9adc14492d003d" => :yosemite
sha256 "5e59e7355c15b2c5a200c30730b7e815f92a3e41f931942ab8a73ab76435842e" => :x86_64_linux
end
option :cxx11
depends_on "cmake" => :build
depends_on "pkg-config" => :build
depends_on "arpack"
depends_on "hdf5"
depends_on "superlu"
depends_on "openblas" if OS.linux?
def install
ENV.cxx11 if build.cxx11?
system "cmake", ".", "-DDETECT_HDF5=ON", *std_cmake_args
system "make", "install"
prefix.install "examples"
end
test do
(testpath/"test.cpp").write <<-EOS
#include <iostream>
#include <armadillo>
using namespace std;
using namespace arma;
int main(int argc, char** argv)
{
cout << arma_version::as_string() << endl;
}
EOS
system ENV.cxx, "test.cpp", "-I#{include}", "-L#{lib}", "-larmadillo", "-o", "test"
assert_equal `./test`.to_i, version.to_s.to_i
end
end