46 lines
1.3 KiB
Ruby
46 lines
1.3 KiB
Ruby
class Lapack < Formula
|
|
desc "Linear Algebra PACKage"
|
|
homepage "http://www.netlib.org/lapack/"
|
|
url "http://www.netlib.org/lapack/lapack-3.8.0.tar.gz"
|
|
sha256 "deb22cc4a6120bff72621155a9917f485f96ef8319ac074a7afbc68aab88bcf6"
|
|
head "https://github.com/Reference-LAPACK/lapack.git"
|
|
|
|
bottle do
|
|
sha256 "d2fd3a045aead6bfd24b0334727c729a3350170182e78511ca2639e25bf9da89" => :high_sierra
|
|
sha256 "cae4a32b1eed31c3aae19a8675d7ae8593ac48579dd8204762d61d6758a1ed7c" => :sierra
|
|
sha256 "e93b388936eba21115a578b848b5b13562f0f2269b08a0d90b66d3d5fd7f5f8d" => :el_capitan
|
|
end
|
|
|
|
keg_only :provided_by_osx
|
|
|
|
depends_on "cmake" => :build
|
|
depends_on :fortran
|
|
depends_on "gcc"
|
|
|
|
def install
|
|
ENV.delete("MACOSX_DEPLOYMENT_TARGET")
|
|
|
|
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
|
|
#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
|