jchelly / gadgetviewer

Simple tool for interactive visualisation of Gadget and SWIFT N-body simulations
GNU General Public License v3.0
24 stars 9 forks source link

hdf5-related compile error #12

Closed BenWibking closed 3 years ago

BenWibking commented 3 years ago

Hi,

I get the following compile error when enabling HDF5 support:

Making all in hdf5
make[2]: Entering directory '/Users/benwibking/gadgetviewer/hdf5'
Making all in src
make[3]: Entering directory '/Users/benwibking/gadgetviewer/hdf5/src'
/bin/sh ../../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../.     -g -O2 -MT read_hdf5_c.lo -MD -MP -MF .deps/read_hdf5_c.Tpo -c -o read_hdf5_c.lo read_hdf5_c.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../. -g -O2 -MT read_hdf5_c.lo -MD -MP -MF .deps/read_hdf5_c.Tpo -c read_hdf5_c.c  -fno-common -DPIC -o .libs/read_hdf5_c.o
read_hdf5_c.c:308:10: warning: 11 enumeration values not handled in switch: 'H5T_NO_CLASS', 'H5T_TIME',
      'H5T_STRING'... [-Wswitch]
  switch(class)
         ^
read_hdf5_c.c:308:10: note: add missing switch cases
  switch(class)
         ^
read_hdf5_c.c:537:100: error: too few arguments to function call, expected 8, have 7
      H5Oget_info_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_NATIVE, i, &object_info, H5P_DEFAULT); 
      ~~~~~~~~~~~~~~~~~~                                                                           ^
/usr/local/include/H5Opublic.h:190:8: note: 'H5Oget_info_by_idx3' declared here
H5_DLL herr_t H5Oget_info_by_idx3(hid_t loc_id, const char *group_name,
       ^
1 warning and 1 error generated.

Perhaps the HDF5 API has changed? I have hdf5 version 1.12.0 installed via homebrew on macOS. I've used a command-line flag to revert to the version 1.6 API in Gadget -- is that necessary here?

jchelly commented 3 years ago

Yes, the H5Oget_info_by_idx function has a new parameter in HDF5 1.12. I've pushed a commit to master to fix it. It seems to work here using HDF5 1.12 on linux with the Intel compiler.

I'll need to update the code for reading Eagle simulations at some point. That's still requesting the HDF5 1.6 API.

BenWibking commented 3 years ago

This is all I need for now. Thanks for fixing. I'll go ahead and close this issue.