[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: CMake help needed to enable hdf5 for gatb-core (Was: [MoM] Re: gatb-core packaging)



Hi Andreas,

On 11/28/2017 11:52 AM, Andreas Tille wrote:
> it turned out hat the cmake issue is a bit tricky for a MoM project so I
> gave it a try myself.  The current state of gatb-core packaging is in
> Git[1].  I went as far as my poor cmake knowledge permits to replace the
> cmake hdf5 code to use the Debian packaged code after the internal code
> copy was removed.  Unfortunately I failed to get the proper -I options
> propagated to the compiler call since I'm ending up with:

Problem is that the system-wide hdf5.h  is always directly in the include
path (#include <hdf5.h>, wherease the embedded code copy of the project
you're trying to use was somehow put into the source project in such a
way that they used #include <hdf5/hdf5.h> (see the error message). And
since that _adds_ a directory layer, there's no -I flag you can pass that
will make this work out of the box.

So you'll definitely need to patch the source files and replace
#include <hdf5/hdf5.h> with #include <hdf5.h>

Then you also have the problem that your compile line doesn't include
the HDF5 directories. I haven't looked at your packaging, but in
general you need to have the following in CMake to link against HDF5:

find_package(HDF5 REQUIRED)
include_directories(${HDF5_INCLUDE_DIRS})
target_link_libraries(name_of_program_or_library ${HDF5_LIBRARIES})

The last line possibly multiple times for multiple targets.

Regards,
Christian


Reply to: