homebrew-core/Formula/lapack.rb

46 lines
1.3 KiB
Ruby
Raw Normal View History

2017-04-04 11:12:45 +00:00
class Lapack < Formula
desc "Linear Algebra PACKage"
homepage "http://www.netlib.org/lapack/"
url "http://www.netlib.org/lapack/lapack-3.7.0.tgz"
sha256 "ed967e4307e986474ab02eb810eed1d1adc73f5e1e3bc78fb009f6fe766db3be"
revision 2
2017-04-04 11:12:45 +00:00
head "https://github.com/Reference-LAPACK/lapack.git"
2017-04-04 13:57:52 +00:00
bottle do
2017-04-21 19:13:41 +00:00
sha256 "26a40d104a1eb3aa734306a5fdadc5b45010a4b9414e95572cc6abe6433bb9a4" => :sierra
sha256 "c4e22f5cf4e3f702c3528755c0880403e74ef08f0c48be7c4fbef972ea9cc18a" => :el_capitan
sha256 "4ca805b1f1c88e8e62120cac73f9dd91cb8db83f8dfbbd6e53577565a804f918" => :yosemite
2017-04-04 13:57:52 +00:00
end
2017-04-04 11:12:45 +00:00
keg_only :provided_by_osx
depends_on "cmake" => :build
2017-04-04 11:12:45 +00:00
depends_on :fortran
depends_on "gcc"
def install
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"
2017-04-04 11:12:45 +00:00
system "./lp"
end
end