aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorCharlie Sharpsteen2011-01-04 13:34:51 -0800
committerMike McQuaid2011-01-04 21:43:03 +0000
commit5e95789b9ed6e88db263870e496bc402d3f61a33 (patch)
tree9fdc11d7f7db0881edb57f3672ddef1328561372 /Library
parentdfb99050d6a9ca6ef22232e98fc7bd89c5155026 (diff)
downloadhomebrew-5e95789b9ed6e88db263870e496bc402d3f61a33.tar.bz2
Update SuiteSparse to version 3.5.0 and add alias
Makefile patch has been replaced by an inreplace block as it is easier to understand. `umfpack` is now aliased to `suite-sparse`. UMFPACK is the SuiteSparse component that most people look for as it is a SciPy dependency. Closes #3814. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
l---------Library/Aliases/umfpack1
-rw-r--r--Library/Formula/suite-sparse.rb132
2 files changed, 32 insertions, 101 deletions
diff --git a/Library/Aliases/umfpack b/Library/Aliases/umfpack
new file mode 120000
index 000000000..843282b1d
--- /dev/null
+++ b/Library/Aliases/umfpack
@@ -0,0 +1 @@
+../Formula/suite-sparse.rb \ No newline at end of file
diff --git a/Library/Formula/suite-sparse.rb b/Library/Formula/suite-sparse.rb
index c2a6fa4fe..e882c0a51 100644
--- a/Library/Formula/suite-sparse.rb
+++ b/Library/Formula/suite-sparse.rb
@@ -1,25 +1,17 @@
require 'formula'
class SuiteSparse <Formula
- url 'http://www.cise.ufl.edu/research/sparse/SuiteSparse/SuiteSparse-3.4.0.tar.gz'
+ url 'http://www.cise.ufl.edu/research/sparse/SuiteSparse/SuiteSparse-3.5.0.tar.gz'
homepage 'http://www.cise.ufl.edu/research/sparse/SuiteSparse/'
- md5 'e59dcabc9173b1ba1b3659ae147006b8'
+ md5 'd2cd759dd04f2f4258081e80c2891366'
depends_on "metis"
depends_on "tbb"
- def patches
- { :p1 => DATA }
- end
-
def install
# SuiteSparse doesn't like to build in parallel
ENV.deparallelize
- # Statically link libmetis
- metis = Formula.factory("metis")
- ENV["HOMEBREW_METIS"] = "#{metis.lib}/libmetis.a"
-
# So, SuiteSparse was written by a scientific researcher. This
# tends to result in makefile-based build systems that are completely
# ignorant of the existance of things such as CPPFLAGS and LDFLAGS.
@@ -29,98 +21,36 @@ class SuiteSparse <Formula
ENV['CFLAGS'] += " -isystem #{HOMEBREW_PREFIX}/include -L#{HOMEBREW_PREFIX}/lib"
end
- system "make"
+ # Some of the suite-sparse libraries use Metis
+ metis = Formula.factory("metis")
+
+ inreplace 'UFconfig/UFconfig.mk' do |s|
+ # Compilers
+ s.change_make_var! "CC", ENV.cc
+ s.change_make_var! "CFLAGS", ENV.cflags
+ s.change_make_var! "CPLUSPLUS", ENV.cxx
+
+ # Libraries
+ s.change_make_var! "BLAS", "-Wl,-framework -Wl,Accelerate"
+ s.change_make_var! "LAPACK", "$(BLAS)"
+ s.remove_make_var! "METIS_PATH"
+ s.change_make_var! "METIS", metis.lib + 'libmetis.a'
+ s.change_make_var! "SPQR_CONFIG", "-DHAVE_TBB"
+ s.change_make_var! "TBB", "-ltbb"
+
+ # Installation
+ s.change_make_var! "INSTALL_LIB", lib
+ s.change_make_var! "INSTALL_INCLUDE", include
+ end
+
+ # Remove a stray Lib prefix
+ inreplace 'UFconfig/Makefile', %r|Lib/|, ''
+
+ system "make library"
- lib.install Dir['*/Lib/*.a']
- include.install Dir['*/Include/*.h']
- include.install 'UFconfig/UFconfig.h'
+ lib.mkpath
+ include.mkpath
+ system "make install"
end
end
-__END__
-Patch to the SuiteSparse master Make configuration file.
-Ensures SuiteSparse builds against Hombrew's copy of metis
-and uses Hombrew environment variables related to compilation.
-diff --git a/UFconfig/UFconfig.mk b/UFconfig/UFconfig.mk
-index bda4c7b..84a878b 100644
---- a/UFconfig/UFconfig.mk
-+++ b/UFconfig/UFconfig.mk
-@@ -33,11 +33,11 @@
- # C compiler and compiler flags: These will normally not give you optimal
- # performance. You should select the optimization parameters that are best
- # for your system. On Linux, use "CFLAGS = -O3 -fexceptions" for example.
--CC = cc
-+# CC = cc
- # CFLAGS = -O (for example; see below for details)
-
- # C++ compiler (also uses CFLAGS)
--CPLUSPLUS = g++
-+CPLUSPLUS = $(CXX)
-
- # ranlib, and ar, for generating libraries
- RANLIB = ranlib
-@@ -49,11 +49,11 @@ MV = mv -f
-
- # Fortran compiler (not normally required)
- F77 = f77
--F77FLAGS = -O
-+F77FLAGS = $(FCFLAGS)
- F77LIB =
-
- # C and Fortran libraries
--LIB = -lm
-+LIB = -lm -lstdc++ $(LDFLAGS)
-
- # For compiling MATLAB mexFunctions (MATLAB 7.5 or later)
- MEX = mex -O -largeArrayDims -lmwlapack -lmwblas
-@@ -89,8 +89,8 @@ MEX = mex -O -largeArrayDims -lmwlapack -lmwblas
- # BLAS = -lgoto -lgfortran -lgfortranbegin -lg2c
-
- # This is probably slow ... it might connect to the Standard Reference BLAS:
--BLAS = -lblas -lgfortran -lgfortranbegin -lg2c
--LAPACK = -llapack
-+BLAS = -Wl,-framework -Wl,Accelerate
-+LAPACK = $(BLAS)
-
- # Using non-optimized versions:
- # BLAS = -lblas_plain -lgfortran -lgfortranbegin -lg2c
-@@ -122,8 +122,8 @@ XERBLA =
- # The path is relative to where it is used, in CHOLMOD/Lib, CHOLMOD/MATLAB, etc.
- # You may wish to use an absolute path. METIS is optional. Compile
- # CHOLMOD with -DNPARTITION if you do not wish to use METIS.
--METIS_PATH = ../../metis-4.0
--METIS = ../../metis-4.0/libmetis.a
-+METIS_PATH =
-+METIS = $(HOMEBREW_METIS)
-
- # If you use CHOLMOD_CONFIG = -DNPARTITION then you must use the following
- # options:
-@@ -198,16 +198,16 @@ CHOLMOD_CONFIG =
- # -DHAVE_TBB enable the use of Intel's Threading Building Blocks (TBB)
-
- # default, without timing, without TBB:
--SPQR_CONFIG =
-+SPQR_CONFIG = -DHAVE_TBB
- # with timing and TBB:
- # SPQR_CONFIG = -DTIMING -DHAVE_TBB
- # with timing
- # SPQR_CONFIG = -DTIMING
-
- # with TBB, you must select this:
--# TBB = -ltbb
-+TBB = -ltbb
- # without TBB:
--TBB =
-+# TBB =
-
- # with timing, you must include the timing library:
- # RTLIB = -lrt
-@@ -220,7 +220,7 @@ RTLIB =
-
- # Using default compilers:
- # CC = gcc
--CFLAGS = -O3 -fexceptions
-+# CFLAGS = -O3 -fexceptions
-
- # alternatives:
- # CFLAGS = -g -fexceptions \