forked from staticfloat/homebrew-julia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
suite-sparse42-julia.rb
52 lines (42 loc) · 1.67 KB
/
suite-sparse42-julia.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
51
52
require 'formula'
class SuiteSparse42Julia < Formula
homepage 'http://www.cise.ufl.edu/research/sparse/SuiteSparse'
url 'http://www.cise.ufl.edu/research/sparse/SuiteSparse/SuiteSparse-4.2.1.tar.gz'
mirror 'http://d304tytmzqn1fl.cloudfront.net/SuiteSparse-4.2.1.tar.gz'
sha1 '2fec3bf93314bd14cbb7470c0a2c294988096ed6'
bottle do
revision 1
root_url 'https://juliabottles.s3.amazonaws.com'
cellar :any
sha256 "871d4f17fa18f6b98aa3a48c5286363fabcc02aa393278c4d966848d3c1cbd3b" => :mountain_lion
sha256 "74c587fd90b58595d1c00cb622501629a44bda7bc6c3189062cd19f9dffe0556" => :yosemite
sha256 "6a8387b29ff4220c43ac25d4959a83740c99b1129f16896e402f38a29a475def" => :mavericks
end
keg_only 'Conflicts with suite-sparse in homebrew-science.'
depends_on "tbb" => :optional
depends_on "metis" => :optional
depends_on "staticfloat/julia/openblas-julia"
option "with-metis", "Compile in metis libraries"
def install
# SuiteSparse doesn't like to build in parallel
ENV.j1
inreplace 'SuiteSparse_config/SuiteSparse_config.mk' do |s|
# Put in the proper libraries
s.change_make_var! "BLAS", "-lopenblas"
s.change_make_var! "LAPACK", "$(BLAS)"
if build.with? "metis"
s.remove_make_var! "METIS_PATH"
s.change_make_var! "METIS", Formula["metis"].lib + "libmetis.a"
end
# Installation
s.change_make_var! "INSTALL_LIB", lib
s.change_make_var! "INSTALL_INCLUDE", include
s.change_make_var! "SPQR_CONFIG", "-DNCAMD -DNPARTITION"
s.change_make_var! "CHOLMOD_CONFIG", "-DNCAMD -DNPARTITION"
end
system "make library"
lib.mkpath
include.mkpath
system "make install"
end
end