d46282db1d
By default, NetCDF only builds static libs. This leads to some complicated dependencies that must be satisfied by other programs that link against libnetcdf.a: nc-config --libs -L/<brew root>/Cellar/netcdf/4.1.1/lib -lnetcdf -L/<brew root>/Cellar/hdf5/1/lib -lhdf5_hl -lhdf5 -lz -lm -lcurl HDF5 is required to access version 4 of the NetCDF file format. When shared libraries are provided, the linking requirements are greatly simplified: nc-config --libs -L/<brew root>/Cellar/netcdf/4.1.1/lib -lnetcdf This eases the build process for other formulas that depend on NetCDF libraries. The static libraries are still compiled and available for use. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
24 lines
757 B
Ruby
24 lines
757 B
Ruby
require 'formula'
|
|
|
|
class Netcdf <Formula
|
|
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'
|
|
|
|
def install
|
|
# HDF5 is required to create and access files
|
|
# in the NetCDF version 4 format.
|
|
hdf5 = Formula.factory('hdf5')
|
|
szip = Formula.factory('szip')
|
|
|
|
system "./configure", "--prefix=#{prefix}",
|
|
"--disable-dependency-tracking",
|
|
"--with-szip=#{szip.prefix}",
|
|
"--with-hdf5=#{hdf5.prefix}",
|
|
"--enable-netcdf4",
|
|
"--enable-shared"
|
|
system "make install"
|
|
end
|
|
end
|