Skip to content
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

error: ‘H5T_NATIVE_FLOAT’ was not declared in this scope #1658

Closed
MKAbdElrahman opened this issue Jul 7, 2021 · 5 comments
Closed

error: ‘H5T_NATIVE_FLOAT’ was not declared in this scope #1658

MKAbdElrahman opened this issue Jul 7, 2021 · 5 comments
Labels

Comments

@MKAbdElrahman
Copy link

I got the follwing error after running make

h5file.cpp: In member function ‘void meep::h5file::write_chunk(int, const size_t*, const size_t*, float*)’:
h5file.cpp:688:16: error: ‘H5T_NATIVE_FLOAT’ was not declared in this scope
688 | H5T_NATIVE_FLOAT, data);
| ^~~~~~~~~~~~~~~~
h5file.cpp: In member function ‘void meep::h5file::write_chunk(int, const size_t*, const size_t*, double*)’:
h5file.cpp:694:16: error: ‘H5T_NATIVE_DOUBLE’ was not declared in this scope
694 | H5T_NATIVE_DOUBLE, data);
| ^~~~~~~~~~~~~~~~~
h5file.cpp: In member function ‘void meep::h5file::read_chunk(int, const size_t*, const size_t*, float*)’:
h5file.cpp:829:15: error: ‘H5T_NATIVE_FLOAT’ was not declared in this scope
829 | H5T_NATIVE_FLOAT, data);
| ^~~~~~~~~~~~~~~~
h5file.cpp: In member function ‘void meep::h5file::read_chunk(int, const size_t*, const size_t*, double*)’:
h5file.cpp:835:15: error: ‘H5T_NATIVE_DOUBLE’ was not declared in this scope
835 | H5T_NATIVE_DOUBLE, data);
| ^~~~~~~~~~~~~~~~~
make[4]: *** [Makefile:660: h5file.lo] Error 1
make[4]: Leaving directory '/home/mk/Downloads/meep-1.19.0/src'
make[3]: *** [Makefile:721: all-recursive] Error 1
make[3]: Leaving directory '/home/mk/Downloads/meep-1.19.0/src'
make[2]: *** [Makefile:506: all] Error 2
make[2]: Leaving directory '/home/mk/Downloads/meep-1.19.0/src'
make[1]: *** [Makefile:515: all-recursive] Error 1
make[1]: Leaving directory '/home/mk/Downloads/meep-1.19.0'
make: *** [Makefile:422: all] Error 2

@stevengj
Copy link
Collaborator

stevengj commented Jul 7, 2021

What version of HDF5 do you have? Those types should be defined by hdf5.h.

@oskooi
Copy link
Collaborator

oskooi commented Dec 23, 2021

I think the problem here is that you installed the parallel version of HDF5 and are trying to build serial Meep (the default in the configure script) without specifying CC=mpicc CXX=mpic++ when configuring. This is why your compiler is unable to find hdf5.h. This procedure is actually explained in the HDF5 build instructions of the user manual:

Note: If you have a version of HDF5 compiled with MPI parallel I/O support, 
then you need to use the MPI compilers to link to it, even when you are compiling 
the serial version of Meep. Just use ./configure CC=mpicc CXX=mpic++ or whatever 
your MPI compilers are when configuring.

@shamefulCake1
Copy link

shamefulCake1 commented Jan 17, 2024

No, this essense of this bug is that this error appears even if meep is built with --without-hdf5, so those functions should not even be compiled.

Please, reopen this bug.

@shamefulCake1
Copy link

These lines are at the very bottom of this file, and there are no #ifdef HAVE_HDF5 guards in them, which is a bug really.

@stevengj
Copy link
Collaborator

See #2742

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants