h5md / VMD-h5mdplugin

This plugin enables VMD to display data stored in h5 files that are structured according to the H5MD specifications (http://nongnu.org/h5md/)
Other
10 stars 9 forks source link

Fail to find hdf5.h file #18

Closed frank-stonybrook closed 8 years ago

frank-stonybrook commented 8 years ago

I edit HDF5LDFLAGS and HDF5CPPFLAGS to the path which I installed hdf5 and run the make. However, I get error message: gcc h5mdtest.c -o h5mdtest h5mdplugin.c -I/usr/local/lib/vmd/plugins/include -std=c99 -L /home/frank/HDF5/lib -L -Wl,-rpath,/home/frank/Documents/VMD-h5mdplugin-master -lhdf5_hl -lhdf5 -lh5md h5mdplugin.c:21:18: fatal error: hdf5.h: No such file or directory

Actually the hdf5.h is in the path specified by HDF5CPPFLAGS, why gcc complaints that hdf5.h couldn't be find?

Thanks

jonaslandsgesell commented 8 years ago

Actually the plugin supports two build systems: 1) the autotools (make) 2) cmake If you run make you need to adapt (only) the makefile and refer to the correct paths. The corresponding part where you need to adapt the makefile is the following: VMDDIR, HDF5LDFLAGS, HDF5CPPFLAGS

frank-stonybrook commented 8 years ago

Hi Jonaslandsgesell,

Is there any reason which causes the make fails? Because I already changed the three variables to the correct paths. This is part of my Makefile script, I am not sure whether there is any other problem.

screen shot 2015-10-13 at 17 56 56

Thanks

jonaslandsgesell commented 8 years ago

Hi Frank, this will not directly solve the problem but I think in the original version of the makefile there is a point behind -L in the following line LDFLAGS=$(HDF5LDFLAGS) -L. (maybe try a make clean after you added the point)

frank-stonybrook commented 8 years ago

Hi Jonaslandsgesell, Unfortunately, I still get error when running make. However if I manually copy the hdf5.h file in the current directory of Makefile, this error is fixed. Any idea why it happens?

Thanks

jonaslandsgesell commented 8 years ago

I think your adapted Makefile does not correctly try to use the header files. Otherwise your gcc command should look like:

gcc h5mdtest.c -o h5mdtest h5mdplugin.c -I/usr/local/lib/vmd/plugins/include -I/home/frank/HDF5/include -std=c99 -L /home/frank/HDF5/lib -L -Wl,-rpath,/home/frank/Documents/VMD-h5mdplugin-master -lhdf5_hl -lhdf5 -lh5md

Maybe the easiest way for a further analysis of the problem would be, if you clone the project from scratch. Adapt the makefile only in these 3 places and then try again to run make.

frank-stonybrook commented 8 years ago

Hi Jonaslandsgesell,

I just download all files and rerun the make. The error still appears.

After carefully checking the standard gcc command you provided and my results, I find out that the only difference is '-I/home/frank/HDF5/include'. I look at the original Makefile script on github. I think that this command is encoded by the this line in Makefile:

screen shot 2015-10-13 at 19 53 07

It seems that there is something which encoded this part '-I/home/frank/HDF5/include' is missing?? Another thing which confirms my suspension is that the variable 'CPPFLAGS' never used after defining. Thanks Frank

frank-stonybrook commented 8 years ago

Hi Jonaslandsgesell,

I figure out the problem. There is $(HDF5CPPFLAGS) missing in the command. When I fix it, the make doesn't complain this problem.

jonaslandsgesell commented 8 years ago

Thanks for the hint. I will fix this.