Building HDF5 for OS X Mavericks
Posted onThere aren't always Mac versions of binary distributions of OSS, so sometimes the package needs to be built with Xcode. This isn't a big deal other than that I try to maintain a repeatable installation discipline, and I like to be able to undo operations that are performed on my systems. The best way to accomplish this is with packages.
I needed to build HDF5 for a project. The Python bits are trivially installed with pip, but they depend on native libraries... so I set out to learn how to package the non-python dependencies.
Brew and macports just don't interest me right now. All told, there are probably less than ten things that I need to compile and maintain, so adding another package manger into the mix is just silly.
After some research -- maybe an hour total -- this is what I came up with:
SZIP
./configure --prefix=/usr/local
make
DESTDIR=$(pwd)/DEST make install
pkgbuild --root DEST \
--ownership recommended \
--identifier org.hdfgroup.szip \
--version 2.1 \
szip-2.1.pkg
HDF5
./configure --prefix=/usr/local --with-szip=/usr/local
make
DESTDIR=$(pwd)/DEST make install
pkgbuild --root DEST \
--ownership recommended \
--identifier org.hdfgroup.hdf5 \
--version 1.8.12 \
hdf5-1.8.12.pkg
Obviuously the first paragraph of each example just configures and builds an autoconf'd package. The second paragraph is the best invocation for the OS X native package builder that I could make before my attention span ran out. :) It literally just specifies from where to get the files, what the installed permisions should be, the name of the package for the receipts database and the name of the output (package) file.
This was not hard.