OPeNDAP Updates
How do I build the HDF4 library so that it will link with the Hyrax HDF4 handler?
To build hdf4 so that it will link with our handler you have to do several things just a little differently than a normal build.
- Build the jpeg library specially
- Build the HDF4 library specially
- Optionally, build hdf-eos2
Here's how:
Assumption: $prefix is the root of a shrew source checkout. If you're not using the shrew SVN project, then you should read the explanation.
The short version, without explanation:
- For jpeg-6b: ./configure CFLAGS="-O2 -fPIC" --prefix=$prefix/deps/jpeg-6b; make; make install
- For HDF4: ./configure --disable-fortran --enable-production --enable-shared --disable-netcdf --with-jpeg=$prefix/src/dependencies/src/jpeg-6b,$prefix/src/dependencies/src/jpeg-6b --prefix=$prefix/deps/hdf-4.2.5; make; make install
- For hdf-eos2: ./configure CC=/$prefix/deps/hdf-4.2.5/bin/h4cc --disable-fortran --enable-production --enable-install-include --with-pic --with-hdf4=$prefix/deps/hdf-4.2.5 --prefix=$prefix/deps/hdf-eos2; make; make install
Now with more words:
- To build the jpeg library, get a fresh source distribution of the jpeg-6b source (later versions might work). When you configure the jpeg source, set the environment variable CFLAGS like this CFLAGS="-O2 -fPIC". You can do that all on one command line by running configure like: ./configure CFLAGS="-O2 -fPIC" --prefix=/some/special/place. The value of the --prefix option determines where the four executable programs will be installed; the library (a static library) and includes will stay in the source directory.
- When you build HDF4, use the following options to configure: disable-fortran, enable-production, enable-shared, disable-netcdf, with-jpeg and prefix. Of those enable-shared and with-jpeg are the ones you absolutely must have; the others are simpley a good idea. Again, this is for a copy of HDF4 that will be used only by the Hyrax server. The configure command looks like: ./configure --disable-fortran --enable-production --enable-shared --disable-netcdf --with-jpeg=/the/jpeg-6b/source/dir,/the/jpeg-6b/source/dir --prefix=$prefix.
- Pay special attention to the --with-jpeg option's value: It is the path to the source directory, listed twice (if instead you list just one directory, hdf4 expects to find the lib in /path/lib and the includes in /path/include, so you'll have to make those dirs and copy the library and includes by hand).
- Note that we don't recommend using the --with-szip option because few files use that and it will break linking with hdf-eos. Once built, install the library and you're ready to build the handler or...
- Build the hdf-eos2 library. For this build you will need to tell configure to use a non-standard compiler and provide a fair number of other options. You 'change compilers' using a special value for the CC environment variable. Here's how you run configure: ./configure CC=/home/jimg/src/hyrax_1.8_release/deps/hdf-4.2.5/bin/h4cc --disable-fortran --enable-production --enable-install-include --with-pic --with-hdf4=/path/to/hdf4 --prefix=/path/for/hdf-eos2
Matlab loaddap Tool 3.7.2 (31 May 2012)
One-day Course on Server Functions & Clients
The Data Access Protocol and OGC abstract specifications for Architecture and Coverages
I tried autoreconf and it didn't work. What now?
You need very recent version of the auto tools. Here's what I'm using:
[jimg@zoey libdap]$ autoconf --version autoconf (GNU Autoconf) 2.68 Written by David J. MacKenzie and Akim Demaille. [jimg@zoey libdap]$ automake --version automake (GNU automake) 1.11.1 Written by Tom Tromey <tromey@redhat.com>. [jimg@zoey libdap]$ libtool --version ltmain.sh (GNU libtool) 2.2.8
On the Mac (OS/X) all three tools are present, but generally the versions are old and in the way; update to new versions. By default, the source packages build very easily and install into /usr/local/{bin,lib,...} and will not break other things. Make sure to add /usr/local/bin to $PATH in your shell startup script (likely ~/.bashrc and also in environment.plist if you want these to be accessible to programs started by/in the Finder.