forked from keitheis/homebrew-dupes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlapack.rb
50 lines (44 loc) · 1.45 KB
/
lapack.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
49
50
class Lapack < Formula
desc "Linear Algebra PACKage"
homepage "http://www.netlib.org/lapack/"
url "http://www.netlib.org/lapack/lapack-3.6.1.tgz"
sha256 "888a50d787a9d828074db581c80b2d22bdb91435a673b1bf6cd6eb51aa50d1de"
head "https://github.com/Reference-LAPACK/lapack.git"
bottle do
sha256 "c4d56d7d4b5288d7629392239dea020e918fa3fdaf286cf046116d3afda2d6e1" => :el_capitan
sha256 "135069ff3f5ec2ca7ce0dc6d430ec3b05a8df07c32758f0008af18a04e7963a7" => :yosemite
sha256 "46d218675c35154e8435189fd15eb164b6317bb823402f4f7adba5c8ebd5547a" => :mavericks
end
keg_only :provided_by_osx
option "with-doxygen", "Build man pages with Doxygen"
depends_on "cmake" => :build
depends_on :fortran
depends_on "gcc"
depends_on "doxygen" => [:build, :optional, "with-llvm"]
def install
if build.with? "doxygen"
mv "make.inc.example", "make.inc"
system "make", "man"
man3.install Dir["DOCS/man/man3/*"]
end
mkdir "build" do
system "cmake", "..", "-DBUILD_SHARED_LIBS:BOOL=ON", "-DLAPACKE:BOOL=ON",
*std_cmake_args
system "make", "install"
end
end
test do
(testpath/"lp.cpp").write <<-EOS.undent
#include "lapacke.h"
int main() {
void *p = LAPACKE_malloc(sizeof(char)*100);
if (p) {
LAPACKE_free(p);
}
return 0;
}
EOS
system ENV.cc, "lp.cpp", "-I#{include}", "-L#{lib}", "-llapacke", "-o", "lp"
system "./lp"
end
end