forked from ahmadia/homebrew-science
-
Notifications
You must be signed in to change notification settings - Fork 0
/
blaze-lib.rb
37 lines (31 loc) · 938 Bytes
/
blaze-lib.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
class BlazeLib < Formula
desc "High-performance C++ math library for dense and sparse arithmetic"
homepage "https://bitbucket.org/blaze-lib/blaze/"
url "https://bitbucket.org/blaze-lib/blaze/downloads/blaze-2.4.tar.gz"
sha256 "34af70c8bb4da5fd0017b7c47e5efbfef9aadbabc5aae416582901a4059d1fa3"
depends_on "boost"
def install
inreplace "Configfile", "CXX=\"g++\"", "CXX=\"#{ENV.cxx}\""
system "./configure"
system "make"
include.install "blaze"
lib.install "lib/libblaze.a"
end
test do
(testpath/"test.cpp").write <<-EOS.undent
#include <blaze/Blaze.h>
int main(int argc, char *argv[])
{
return 0;
}
EOS
flags = (ENV.cflags || "").split + (ENV.cppflags || "").split + (ENV.ldflags || "").split
flags += %W[
-I#{include}
-lblaze
-lboost_system
]
system ENV.cxx, "test.cpp", "-o", "test", *flags
system "./test"
end
end