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"
2017-05-01 19:22:40 +00:00
revision 3
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-05-04 02:36:36 +00:00
sha256 "9013bc0a104d3d3163155cadbbf847d94e53513fe569bf8d9262977b9d192c0f" => :sierra
sha256 "7ebe016039ef1ba945a049a51449a245242df8300ac178547f240d624c1f3e7c" => :el_capitan
sha256 "fa4a66bf44fce6ced094c29b10632cb99368bff26818455eb6147de3edffc4d1" => :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