ITK: HDF5 error about including private headers H5Tpkg.h

Raised by @lorensen in discourse https://discourse.itk.org/t/gcc-8-2/1601/2 and reproduced locally with gcc8.2.

build log: https://open.cdash.org/viewBuildError.php?buildid=5754102

Might be related to latest hdf5 update?

Building C object Modules/ThirdParty/HDF5/src/itkhdf5/src/CMakeFiles/hdf5-shared.dir/__/shared/H5Tinit.c.o
FAILED: Modules/ThirdParty/HDF5/src/itkhdf5/src/CMakeFiles/hdf5-shared.dir/__/shared/H5Tinit.c.o
/usr/lib/colorgcc/bin/cc -DH5_BUILT_AS_DYNAMIC_LIB -DH5_BUILT_AS_DYNAMIC_LIB=1 -DNDEBUG -D_GNU_SOURCE -Dhdf5_shared_EXPORTS -IModules/ThirdParty/ZLIB/src -IModules/ThirdParty/ZLIB/src -IModules/ThirdParty/HDF5/src -IModules/ThirdParty/HDF5/src -IModules/ThirdParty/HDF5/src/itkhdf5/src -IModules/ThirdParty/HDF5/src/itkhdf5 -Wno-uninitialized -Wno-unused-parameter -Wall -Wcast-align -Wdisabled-optimization -Wextra -Wformat=2 -Winvalid-pch -Wno-format-nonliteral -Wpointer-arith -Wshadow -Wunused -Wwrite-strings -funit-at-a-time -Wno-strict-overflow  -w -std=c99 -fstdarg-opt -pedantic -Wall -Wextra -fmessage-length=0 -O2 -g -DNDEBUG -fPIC -MD -MT Modules/ThirdParty/HDF5/src/itkhdf5/src/CMakeFiles/hdf5-shared.dir/__/shared/H5Tinit.c.o -MF Modules/ThirdParty/HDF5/src/itkhdf5/src/CMakeFiles/hdf5-shared.dir/__/shared/H5Tinit.c.o.d -o Modules/ThirdParty/HDF5/src/itkhdf5/src/CMakeFiles/hdf5-shared.dir/__/shared/H5Tinit.c.o   -c Modules/ThirdParty/HDF5/src/itkhdf5/shared/H5Tinit.c
In file included from Modules/ThirdParty/HDF5/src/itkhdf5/shared/H5Tinit.c:82:
Modules/ThirdParty/HDF5/src/itkhdf5/src/H5Tpkg.h:23:2: error: #error "Do not include this file outside the H5T package!"
 #error "Do not include this file outside the H5T package!"

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Comments: 21 (15 by maintainers)

Most upvoted comments

Ok, clean build with default CMake options (disabling tests) works good! This is, no ITKVtkGlue, no CMAKE_BUILD_SHARED.

I will try to isolate the error enabling those options. I don’t think this is related to gcc8

Using non-system VTK but VTK_DIR=/path-VTK 8.1.1/build works.

I guess there must be some clashing between HDF5 in ITK and the one used in VTK, at least when VTK uses system HDF5…

The thing I should double check is what happens when instead of system VTK-8.2.0-1 using system HDF5 (the one failing), I build the same version of VTK using their internal HDF5.

I have tested it with ITKVtkGlue OFF and ON, BUILD_SHARED_LIBS OFF or ON, and same results.

The error is the same than the one reported in vcpkg: https://github.com/Microsoft/vcpkg/issues/3867 and might be related with the hdf5 CMakeFiles.txt problem related to find_package. Pinging @dzenanz, as he references the same issue in other PR in vcpkg. Even though there reported that was solved not using SYSTEM_HDF5, but here it fails compiling HDF5 internally.

I am using latest CMake, and I am sure both of us have the ITKVtkGlue module enabled. I will be able to have a look next week if the docker image doesn’t reproduce it.