-
Notifications
You must be signed in to change notification settings - Fork 637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing compile issue if hdf5 not installed #2742
Conversation
…s per the explanatory text
sync docs with meep main
…erly, where hdf5 variables are undefined.
Note that both Lines 623 to 626 in 295fa63
Lines 773 to 775 in 295fa63
This means these functions should compile without HDF5 but will fail at runtime due to: Lines 689 to 691 in 295fa63
This means that Line 61 in 295fa63
To get |
For me, "make" did not work. I think it's because "H5T_NATIVE_DOUBLE" has to exist since it is given as an argument for the underscore function, even if _write_chunk has the #ifdef as its first line. (still new to github, not sure how you do the code snippet preview, but this is line 702 from src/h5file.cpp) When HDF5 isn't installed, "H5T_NATIVE_DOUBLE" is undefined since it's not given as an argument to the method, and not defined anywhere else in the Meep files. The compiler still needs to be able to call _write_chunk even if it's an empty function. |
I would rather fix this by editing this block Lines 48 to 50 in 425aa39
to add dummy definitions # define H5T_NATIVE_FLOAT 0 // ignored
# define H5T_NATIVE_DOUBLE 0 // ignored That way, it will still fall through to the error exception if HDF5 is missing. |
When trying to compile from source, if HDF5 is not enabled, the "HAVE_HDF5" identifier is false and certain sections within h5file.cpp are ignored. Some types (H5T_NATIVE_DOUBLE, "H5T_NATIVE_FLOAT) are used within a few h5file::***_chunk
functions, and without HDF5, are undefined. This prevents the file from compiling. Added #ifdef blocks to get file to compile without HDF5.