h5py setup.py on Mac: hdf5.h file not found

10.1k views Asked by At

I am building h5py on Mac, following instructions "Building against Parallel HDF5" in this link: http://docs.h5py.org/en/latest/build.html

$ export CC=mpicc
$ python setup.py configure --mpi
$ sudo python setup.py build

I get this error:

h5py-2.5.0/h5py/api_compat.h:27:10: fatal error: 'hdf5.h' file not found

What should I do? If I need to install some dev version of HDF5, how can I do it on Mac?

2

There are 2 answers

2
Katie Rose On

I was getting this same error message yesterday, doing a general installation of HDF5 (not building against parallel). I was able to get around it by using Homebrew (a package manager for OS X that can be found here: http://brew.sh/).

Once you've installed Homebrew (if you don't already have it), the command is brew install hdf5.

1
dEll On

You can find hdf5.h lib in your Unix and set in CPATH varible

freebsd 11 example:

>> find /usr -iname "*hdf5.h*"  
<< /usr/local/include/hdf5.h
>> export CPATH="/usr/local/include/"

Then you can compile that you need