forked from ahmadia/homebrew-science
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openblas.rb
37 lines (30 loc) · 1.26 KB
/
openblas.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
require 'formula'
# Avoid openblas downloading the LAPACK on demand.
# We want openblas to build LAPACK because it knows how to patch LAPACK,
# but *we* want to download, cache and checksum that!
class OpenblasLapack < Formula
url 'http://www.netlib.org/lapack/lapack-3.4.2.tgz'
sha1 '93a6e4e6639aaf00571d53a580ddc415416e868b'
end
class Openblas < Formula
homepage 'http://xianyi.github.io/OpenBLAS/'
# Maintainers, remember to update the LAPACK url in OpenblasLapack above.
# See the "LAPACK_URL" in the openblas Makefile for the right version.
url 'https://github.com/xianyi/OpenBLAS/archive/v0.2.6.tar.gz'
sha1 'f5c040660cb83630f9ac3e34a907889dcfac3415'
head "https://github.com/xianyi/OpenBLAS.git", :branch => "develop"
# OS X provides the Accelerate.framework, which is a BLAS/LAPACK impl.
keg_only :provided_by_osx
def install
ENV.fortran
lapack = OpenblasLapack.new
lapack.brew{} # download and checksum
ohai "Using LAPACK: #{lapack.cached_download}"
inreplace 'Makefile',
'LAPACK_URL=http://www.netlib.org/lapack/lapack-3.4.2.tgz',
"LAPACK_URL=file://#{lapack.cached_download}"
# Must call in two steps
system "make", "FC=#{ENV['FC']}"
system "make", "PREFIX=#{prefix}", "install"
end
end