homebrew-core/Formula/hdf5.rb

54 lines
1.5 KiB
Ruby
Raw Normal View History

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'
url 'http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.10/src/hdf5-1.8.10-patch1.tar.bz2'
sha1 '458cb91496e313debd55d52a7f89459a5469cceb'
version '1.8.10-patch1'
2010-02-11 18:01:59 +00:00
2012-09-06 03:55:46 +00:00
# TODO - warn that these options conflict
option :universal
2012-09-06 03:55:46 +00:00
option 'enable-fortran', 'Compile Fortran bindings'
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'
option 'enable-parallel', 'Compile parallel bindings'
depends_on 'szip'
depends_on MPIDependency.new(:cc, :cxx, :f90) if build.include? "enable-parallel"
2010-02-11 18:01:59 +00:00
def install
ENV.universal_binary if build.universal?
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
]
2012-09-06 03:55:46 +00:00
args << '--enable-parallel' if build.include? 'enable-parallel'
2012-09-06 03:55:46 +00:00
if build.include? 'enable-threadsafe'
args.concat %w[--with-pthread=/usr --enable-threadsafe]
else
if build.include? 'enable-cxx'
args << '--enable-cxx'
end
2012-09-06 03:55:46 +00:00
if build.include? 'enable-fortran'
args << '--enable-fortran'
ENV.fortran
end
end
if build.include? 'enable-parallel'
ENV['CC'] = 'mpicc'
ENV['FC'] = 'mpif90'
end
system "./configure", *args
2010-02-11 18:01:59 +00:00
system "make install"
end
end