-
Notifications
You must be signed in to change notification settings - Fork 4
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
Experiment adding libhdf5 #157
Conversation
Linux build fails, and this is replicable on my local machine. Can't make much from the error message - looks like (for some reason) HDF5 is expecting a different version to what's installed? |
That's indeed strange. We had it working in a little sandbox toy experiment, right? On your machine too? So it seems our |
What happened is that CMake correctly found system hdf5 during the configuration stage:
but then when compiling the program the linker picks up matlab's own hdf5:
There are two problems:
With these two changes I'm able to build |
Probably the MacOS build needs that.
Move the target_link_libraries command to targets.cmake (where all of the others are). And explicitly link to our version of HDF5 when building the tests and tdms_lib.
@@ -44,6 +45,7 @@ function(test_target) | |||
${Matlab_MX_LIBRARY} | |||
${Matlab_MAT_LIBRARY} | |||
${LIBCXX_LIBRARY} | |||
${HDF5_CXX_LIBRARIES} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the target tdms isn't told to explicitly link to the HDF5 library found during configuration, so the linker just picks up the first one it finds. Adding
target_link_libraries(tdms ${HDF5_CXX_LIBRARIES})
should do the trick
Mosè's fix is also needed for the dynlib target (at least on my ARM64 Mac which tries to link the wrong HDF5 libraries).
I am starting to actually develop (for #181) over on Let's keep this PR open for now. |
* Of course it's HDF5_DIR not HDF5DIR https://stackoverflow.com/questions/56099624
Opening this PR so we can have an ongoing discussion and a record of it somewhere.
NOT INTENDED FOR REVIEW OR MERGING ANYTIME SOON
Tagging #181