[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)



On Tue, Nov 28, 2017 at 10:00:48PM +0100, Christian Seiler wrote:
> 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>

I did so in
   https://anonscm.debian.org/cgit/debian-med/gatb-core.git/tree/debian/patches/fix_hdf5_includes.patch

I guess this has no better effect than:

...
[  5%] Building CXX object src/CMakeFiles/gatbcore-static.dir/gatb/bank/impl/BankConverterAlgorithm.cpp.o
cd /build/gatb-core-1.3.0+dfsg/obj-x86_64-linux-gnu/src && /usr/bin/c++   -I/build/gatb-core-1.3.0+dfsg/obj-x86_64-linux-gnu/include -I/build/gatb-core-1.3.0+dfsg/obj-x86_64-linux-gnu/include/None -I/build/gatb-core-1.3.0+dfsg/gatb-core/src -I/build/gatb-core-1.3.0+dfsg/gatb-core/thirdparty  -g -O2 -fdebug-prefix-map=/build/gatb-core-1.3.0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -msse2 -msse4.2 -mpopcnt   -std=c++11 -O3 -DNDEBUG -Wall -Wno-unused-function -Wno-format -Wno-unknown-pragmas -Wno-invalid-offsetof -o CMakeFiles/gatbcore-static.dir/gatb/bank/impl/BankConverterAlgorithm.cpp.o -c /build/gatb-core-1.3.0+dfsg/gatb-core/src/gatb/bank/impl/BankConverterAlgorithm.cpp
cc1plus: error: -Wformat-security ignored without -Wformat [-Werror=format-security]
cc1plus: error: -Wformat-security ignored without -Wformat [-Werror=format-security]
cc1plus: error: -Wformat-security ignored without -Wformat [-Werror=format-security]
cc1plus: error: -Wformat-security ignored without -Wformat [-Werror=format-security]
In file included from /build/gatb-core-1.3.0+dfsg/gatb-core/src/gatb/tools/math/Integer.hpp:29:0,
                 from /build/gatb-core-1.3.0+dfsg/gatb-core/src/gatb/tools/misc/impl/Algorithm.hpp:37,
                 from /build/gatb-core-1.3.0+dfsg/gatb-core/src/gatb/bank/impl/BankConverterAlgorithm.hpp:31,
                 from /build/gatb-core-1.3.0+dfsg/gatb-core/src/gatb/bank/impl/BankConverterAlgorithm.cpp:20:
/build/gatb-core-1.3.0+dfsg/gatb-core/src/gatb/tools/math/LargeInt.hpp:38:10: fatal error: hdf5.h: No such file or directory
 #include <hdf5.h>
          ^~~~~~~~
cc1plus: some warnings being treated as errors
compilation terminated.
...


Since I also need to implement this ...

> 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.

... properly.

I also added this to
   https://anonscm.debian.org/cgit/debian-med/gatb-core.git/tree/debian/patches/use_debian_packaged_hdf5.patch
(line 60+) but I have no idea how to name the targets.  I'm sorry
but I'm quite illiterate in cmake and have no idea where to find
the proper location for this line and the target name. :-(

Sorry for requesting more detailed help.

Kind regards

       Andreas.

-- 
http://fam-tille.de


Reply to: