h5cc seems to point to the wrong locations?


#1

I have been using h5py for a while and I just tried installing the hdf5 library for making programs in C. (hdf5-1.12.0). I need some help setting it up properly. I am using Linux (via Windows WSL 2).

My understanding is that I can compile programs using the h5cc program. But when I try:

h5cc -o h5ex.out h5ex_d_chunk.c

h5cc cannot find any of the headers.

But as far as I can tell, hdf5 was installed to \usr\local\hdf5

Also, I tied fixing the include file problem but h5cc seems to be looking for the following directory for library files:

gcc: error: /usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_hl.a: No such file or directory
gcc: error: /usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.a: No such file or directory

Is there any advice on how I should fix this?


#2

Do you install the 1.12 binary yourself?
There will be a 1.12.1 release soon (release candidate this week).
h5cc internal details depends on the build system used to build the release.


#3

Properly installing a given version of MPI is nontrivial, but you will get reasonable performance with installing openmpi v4.1 from source.

ompi 4.0.5

apt install flex
git clone  https://github.com/open-mpi/ompi.git && cd ompi && git checkout v4.0.5
./autogen.pl && ./configure --prefix=/usr/local  --with-libevent=/usr/local

hdf5 1.10.7

git clone https://github.com/HDFGroup/hdf5.git && cd hdf5
git checkout hdf5-1_10_7
./configure --prefix=/usr/local  -enable-parallel |grep 'Parallel HDF5'
make -j8 && sudo make install

H5CPP parallel (similar syntax to h5py)

git clone https://github.com/steven-varga/h5cpp.git
git checkout master
make install

MPI examples:

You can find then in examples/mpi/[collective.cpp, independent.cpp]

best: steve


#4

I installed the programs using the make script as described in the included INSTALL text file.

I did some more digging, and it seems like I had several h5cc programs installed, one by Python, one by myself, and one I don’t know where it came from. It seems this final one is configured to look for directories that don’t exist.

I was able to fix it by directly calling a different h5cc program.

Thanks for your response