2010-02-11 18:01:59 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Hdf5 < Formula
|
2011-12-14 00:59:23 +00:00
|
|
|
homepage 'http://www.hdfgroup.org/HDF5'
|
2013-05-14 21:25:30 +00:00
|
|
|
url 'http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.11.tar.bz2'
|
|
|
|
sha1 '87ded0894b104cf23a4b965f4ac0a567f8612e5e'
|
2010-02-11 18:01:59 +00:00
|
|
|
|
2012-09-06 03:55:46 +00:00
|
|
|
# TODO - warn that these options conflict
|
2013-01-21 21:12:37 +00:00
|
|
|
option :universal
|
2012-09-06 03:55:46 +00:00
|
|
|
option 'enable-fortran', 'Compile Fortran bindings'
|
2013-02-01 11:54:03 +00:00
|
|
|
option 'enable-cxx', 'Compile C++ bindings'
|
2012-09-06 03:55:46 +00:00
|
|
|
option 'enable-threadsafe', 'Trade performance and C++ or Fortran support for thread safety'
|
2013-02-01 11:54:03 +00:00
|
|
|
option 'enable-parallel', 'Compile parallel bindings'
|
2013-03-07 18:34:37 +00:00
|
|
|
option 'enable-fortran2003', 'Compile Fortran 2003 bindings. Requires enable-fortran.'
|
2013-02-01 11:54:03 +00:00
|
|
|
|
2013-06-24 03:29:13 +00:00
|
|
|
depends_on :fortran if build.include? 'enable-fortran' or build.include? 'enable-fortran2003'
|
2013-02-01 11:54:03 +00:00
|
|
|
depends_on 'szip'
|
2013-06-27 03:08:54 +00:00
|
|
|
depends_on :mpi => [:cc, :cxx, :f90] if build.include? "enable-parallel"
|
2011-04-01 20:43:30 +00:00
|
|
|
|
2010-02-11 18:01:59 +00:00
|
|
|
def install
|
2013-01-21 21:12:37 +00:00
|
|
|
ENV.universal_binary if build.universal?
|
2012-05-23 20:27:22 +00:00
|
|
|
args = %W[
|
|
|
|
--prefix=#{prefix}
|
|
|
|
--enable-production
|
|
|
|
--enable-debug=no
|
|
|
|
--disable-dependency-tracking
|
|
|
|
--with-zlib=/usr
|
|
|
|
--with-szlib=#{HOMEBREW_PREFIX}
|
|
|
|
--enable-filters=all
|
|
|
|
--enable-static=yes
|
|
|
|
--enable-shared=yes
|
2011-04-01 20:43:30 +00:00
|
|
|
]
|
2012-09-06 03:55:46 +00:00
|
|
|
|
2013-02-01 11:54:03 +00:00
|
|
|
args << '--enable-parallel' if build.include? 'enable-parallel'
|
2012-09-06 03:55:46 +00:00
|
|
|
if build.include? 'enable-threadsafe'
|
2012-05-23 20:27:22 +00:00
|
|
|
args.concat %w[--with-pthread=/usr --enable-threadsafe]
|
|
|
|
else
|
2013-02-01 11:54:03 +00:00
|
|
|
if build.include? 'enable-cxx'
|
|
|
|
args << '--enable-cxx'
|
|
|
|
end
|
2013-03-07 18:34:37 +00:00
|
|
|
if build.include? 'enable-fortran' or build.include? 'enable-fortran2003'
|
2012-09-06 03:55:46 +00:00
|
|
|
args << '--enable-fortran'
|
2013-03-07 18:34:37 +00:00
|
|
|
args << '--enable-fortran2003' if build.include? 'enable-fortran2003'
|
2012-09-06 03:55:46 +00:00
|
|
|
end
|
2012-05-23 20:27:22 +00:00
|
|
|
end
|
2011-04-01 20:43:30 +00:00
|
|
|
|
2013-02-01 11:54:03 +00:00
|
|
|
if build.include? 'enable-parallel'
|
|
|
|
ENV['CC'] = 'mpicc'
|
|
|
|
ENV['FC'] = 'mpif90'
|
|
|
|
end
|
2013-03-07 18:34:37 +00:00
|
|
|
|
2011-04-01 20:43:30 +00:00
|
|
|
system "./configure", *args
|
2010-02-11 18:01:59 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|