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

Building with CMake fails #28

Open
fhoefling opened this issue Jun 26, 2018 · 3 comments
Open

Building with CMake fails #28

fhoefling opened this issue Jun 26, 2018 · 3 comments

Comments

@fhoefling
Copy link
Member

fhoefling commented Jun 26, 2018

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
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

Fixed by #29, please test.

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

No branches or pull requests

1 participant