Both sides previous revision
Previous revision
Next revision
|
Previous revision
|
diana:windows:building:hdf [2010-02-16 15:34:28] dages |
diana:windows:building:hdf [2022-05-31 09:29:31] (current) |
There are binaries available, and they're probably fine, but the headers are not, because HDF4 / HDF5 install different headers depending on which compiler they were built with (which in itself is a bug). Luckily, building them from source is fairly easy. | There are binaries available, and they're probably fine, but the headers are not, because HDF4 / HDF5 install different headers depending on which compiler they were built with (which in itself is a bug). Luckily, building them from source is fairly easy. |
| |
**TODO:** Figure out the exact relationship between these three. Apparently, HDF4 wants NetCDF, and NetCDF wants HDF5... | Yeah, right. Actually, [[windows:building:hdf4|HDF4]] is a nightmare, so we've left it out. |
| |
===== NetCDF ===== | ===== NetCDF ===== |
$ LDFLAGS=-L/c/met.no/lib CPPFLAGS=-I/c/met.no/include ./configure --prefix=/c/met.no --disable-f90 --disable-examples | $ LDFLAGS=-L/c/met.no/lib CPPFLAGS=-I/c/met.no/include ./configure --prefix=/c/met.no --disable-f90 --disable-examples |
$ make all install | $ make all install |
| $ cp COPYRIGHT /c/met.no/copyright/netcdf.txt |
| |
<del>Note the ''%%--enable-shared%%'' part; you can leave out ''%%--disable-f90%%'' and ''%%--disable-examples%%'' if you want, but keep ''%%--enable-shared%%''.</del> | <del>Note the ''%%--enable-shared%%'' part; you can leave out ''%%--disable-f90%%'' and ''%%--disable-examples%%'' if you want, but keep ''%%--enable-shared%%''.</del> |
| |
===== HDF4 ===== | |
| |
First, get the latest source (currently 4.2r4) from http://www.hdfgroup.org/release4/obtain.html and extract it in a convenient place. | |
| |
HDF4's autoconf infrastructure is a weird mix of too-old and too-new. Open ''configure.ac'', look for "Libtool initialization" (around line 660) and replace the following two lines | |
| |
LT_INIT(dlopen) | |
LT_OUTPUT | |
| |
with these: | |
| |
AC_LIBTOOL_DLOPEN | |
AM_PROG_LIBTOOL | |
| |
Next, there is a spot in ''configure.ac'' that checks which OS you're running on and bails if it doesn't recognize it... which is stupid, because it controls code that is only used *only* if you want to use HDF4's own version of NetCDF, which we don't. We can work around this by changing ''cygwin'' to ''mingw32'' on line 695. It's wrong, but it doesn't matter, because the result is never used (see below). | |
| |
Then regenerate everything: | |
| |
$ aclocal | |
$ libtoolize --copy --force | |
$ autoheader | |
$ automake --add-missing --copy --foreign | |
$ autoconf | |
| |
<del>**XXX** automake warns about ''F77LINK'', check if that requires fixing.</del> probably harmless | |
| |
Finally, configure, build and install: | |
| |
$ LDFLAGS=-L/c/met.no/lib CPPFLAGS=-I/c/met.no/include ./configure --prefix=/c/met.no --disable-fortran --disable-netcdf | |
$ make all install | |
| |
You //must// specify ''%%--disable-netcdf%%'', otherwise HDF4 will clobber NetCDF's header files! | |
| |
===== HDF5 ===== | ===== HDF5 ===== |
$ LDFLAGS=-L/c/met.no/lib CPPFLAGS=-I/c/met.no/include ./configure --prefix=/c/met.no --enable-cxx | $ LDFLAGS=-L/c/met.no/lib CPPFLAGS=-I/c/met.no/include ./configure --prefix=/c/met.no --enable-cxx |
$ make all install | $ make all install |
| $ cp COPYING /c/met.no/copyright/hdf5.txt |
| |
**TODO** fix large file support! | **TODO** fix large file support! |