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

Building with CMake fails #28

Open fhoefling opened 6 years ago

fhoefling commented 6 years ago

Building with CMake fails since commit a715075 with the following error:

$ /usr/bin/cc -fPIC -Wall -std=c99 -pedantic -fPIC -O3 -DNDEBUG  -Wl,--no-undefined -Wl,--as-needed -Wl,-s -shared -Wl,-soname,h5mdplugin.so -o h5mdplugin.so CMakeFiles/h5mdplugin.dir/h5mdplugin.c.o  -Wl,-rpath,/group/ag_compstatphys/packages/Debian-GNU-Linux-9.4-stretch/hdf5-1.8.18/lib: libh5md.a /group/ag_compstatphys/packages/Debian-GNU-Linux-9.4-stretch/hdf5-1.8.18/lib/libhdf5.so -lz -ldl -lm -lm
libh5md.a(libh5md.c.o): In function `h5md_set_author':
libh5md.c:(.text+0xcd2): undefined reference to `H5LTset_attribute_string'
libh5md.c:(.text+0xcf1): undefined reference to `H5LTset_attribute_string'
libh5md.c:(.text+0xd40): undefined reference to `H5LTset_attribute_string'
libh5md.a(libh5md.c.o): In function `h5md_set_creator':
libh5md.c:(.text+0xdb9): undefined reference to `H5LTset_attribute_string'
libh5md.c:(.text+0xdd8): undefined reference to `H5LTset_attribute_string'
libh5md.a(libh5md.c.o):libh5md.c:(.text+0xe18): more undefined references to `H5LTset_attribute_string' follow
collect2: error: ld returned 1 exit status

Tested with CMake versions 3.7.0 and 3.11.1 and HDF5 versions 1.8.18 and 1.10.2.

fhoefling commented 6 years ago

The linking command of the latest working commit is as follows:

/usr/bin/cc -Wall -std=c99 -pedantic -fPIC -O3 -DNDEBUG  -rdynamic CMakeFiles/h5mdtest.dir/h5mdtest.c.o CMakeFiles/h5mdtest.dir/h5mdplugin.c.o  -o h5mdtest  -Wl,-rpath,/group/ag_compstatphys/packages/Debian-GNU-Linux-9.4-stretch/hdf5-1.8.18/lib libh5md.a /group/ag_compstatphys/packages/Debian-GNU-Linux-9.4-stretch/hdf5-1.8.18/lib/libhdf5.so /group/ag_compstatphys/packages/Debian-GNU-Linux-9.4-stretch/hdf5-1.8.18/lib/libhdf5_hl.so -lm
fhoefling commented 6 years ago

The problem is a missing libhdf5_hl.so at the end of the linking command. The issue did not arise with CMake version 3.2.0. Here is a link to a somewhat cryptic information: https://support.hdfgroup.org/HDF5/faq/cmake.html

fhoefling commented 6 years ago

Fixed by #29, please test.