2010-05-08 02:13:11 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Netcdf < Formula
|
2010-05-08 02:13:11 +00:00
|
|
|
url 'http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.1.1.tar.gz'
|
|
|
|
homepage 'http://www.unidata.ucar.edu/software/netcdf/'
|
|
|
|
md5 '79c5ff14c80d5e18dd8f1fceeae1c8e1'
|
|
|
|
|
|
|
|
depends_on 'hdf5'
|
2010-08-08 17:05:32 +00:00
|
|
|
depends_on 'gfortran' if ARGV.include? '--fortran'
|
|
|
|
|
|
|
|
def options
|
|
|
|
[['--fortran', 'Compile with Fortran support']]
|
|
|
|
end
|
2010-05-08 02:13:11 +00:00
|
|
|
|
|
|
|
def install
|
2010-08-08 17:05:32 +00:00
|
|
|
# HDF5 is required to create and access files in the version 4 format
|
2010-05-08 02:13:11 +00:00
|
|
|
hdf5 = Formula.factory('hdf5')
|
|
|
|
|
2010-08-08 17:05:32 +00:00
|
|
|
args = ["--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--with-hdf5=#{hdf5.prefix}",
|
|
|
|
"--enable-netcdf4",
|
|
|
|
"--enable-shared"]
|
|
|
|
args << "--disable-fortran" unless ARGV.include? '--fortran'
|
|
|
|
|
|
|
|
system "./configure", *args
|
2010-05-08 02:13:11 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
2010-06-11 01:35:44 +00:00
|
|
|
|
2010-08-08 17:05:32 +00:00
|
|
|
def caveats; <<-EOS
|
|
|
|
To build with (experimental) fortran support:
|
|
|
|
brew install netcdf --fortran
|
2010-06-11 01:35:44 +00:00
|
|
|
|
2010-08-08 17:05:32 +00:00
|
|
|
You may have to set FCFLAGS and FFLAGS to be consistant with Homebrew's use
|
|
|
|
of C compilers in order for the brew to install correctly.
|
2010-06-11 01:35:44 +00:00
|
|
|
EOS
|
|
|
|
end
|
2010-05-08 02:13:11 +00:00
|
|
|
end
|