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

HDF5 error about including private headers H5Tpkg.h #509

Open
phcerdan opened this Issue Feb 15, 2019 · 10 comments

Comments

Projects
None yet
2 participants
@phcerdan
Copy link
Contributor

phcerdan commented Feb 15, 2019

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

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!"

@thewtex thewtex self-assigned this Feb 15, 2019

@thewtex

This comment has been minimized.

Copy link
Member

thewtex commented Feb 15, 2019

This is likely related to the recent HDF5 update:

#397

It now showing up on the dashboard thanks to @lorensen 's build:

https://open.cdash.org/viewBuildError.php?buildid=5756101

I will take a look.

@thewtex

This comment has been minimized.

Copy link
Member

thewtex commented Feb 15, 2019

@phcerdan @lorensen I addressed these issues with the gcc:8 Docker image compiler: #510

but I did not experience that error. What CMake version are you using? Are there any other CMake options passed?

@phcerdan

This comment has been minimized.

Copy link
Contributor Author

phcerdan commented Feb 21, 2019

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.

@phcerdan

This comment has been minimized.

Copy link
Contributor Author

phcerdan commented Feb 25, 2019

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: Microsoft/vcpkg#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.

@phcerdan

This comment has been minimized.

Copy link
Contributor Author

phcerdan commented Feb 25, 2019

My CMake version is 3.13.4-1

@phcerdan

This comment has been minimized.

Copy link
Contributor Author

phcerdan commented Feb 25, 2019

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

@phcerdan

This comment has been minimized.

Copy link
Contributor Author

phcerdan commented Feb 25, 2019

Enabling ITKVtkGlue with system VTK (this is system vtk-8.2.0-1 with system hdf5-1.10.4-1) fails with error:
Note that targets are cleaned before rebuilding with:
ninja -t clean hdf5-static hdf5_cpp-static

Error:

[352/354] Building C object Modules/ThirdParty/HDF5/src/itkhdf5/src/CMakeFiles/hdf5-static.dir/__/H5Tinit.c.o
FAILED: Modules/ThirdParty/HDF5/src/itkhdf5/src/CMakeFiles/hdf5-static.dir/__/H5Tinit.c.o
/usr/lib/colorgcc/bin/cc -DNDEBUG -D_GNU_SOURCE -IModules/ThirdParty/ZLIB/src -I/Modules/ThirdParty/ZLIB/src -I/Modules/ThirdParty/HDF5/src -IModules/ThirdParty/HDF5/src -I/Modules/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 -O3 -DNDEBUG -fPIC -MD -MT Modules/ThirdParty/HDF5/src/itkhdf5/src/CMakeFiles/hdf5-static.dir/__/H5Tinit.c.o -MF Modules/ThirdParty/HDF5/src/itkhdf5/src/CMakeFiles/hdf5-static.dir/__/H5Tinit.c.o.d -o Modules/ThirdParty/HDF5/src/itkhdf5/src/CMakeFiles/hdf5-static.dir/__/H5Tinit.c.o   -c Modules/ThirdParty/HDF5/src/itkhdf5/H5Tinit.c
cc: error: Modules/ThirdParty/HDF5/src/itkhdf5/H5Tinit.c: No such file or directory
cc: fatal error: no input files
compilation terminated.
ninja: build stopped: subcommand failed.
@phcerdan

This comment has been minimized.

Copy link
Contributor Author

phcerdan commented Feb 25, 2019

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.

@phcerdan

This comment has been minimized.

Copy link
Contributor Author

phcerdan commented Feb 28, 2019

Tested with my compiled vtk-8.2.0 using their internal hdf5 and no problems. I guess it can be narrowed down to problems using system hdf5 in VTK and non-system hdf5 in ITK...

@thewtex

This comment has been minimized.

Copy link
Member

thewtex commented Feb 28, 2019

Great deduction @phcerdan 👁

system hdf5 in VTK and non-system hdf5 in ITK

This may be difficult to support versus 'system / system' and 'non-system / non-system'. Does VTKConfig.cmake provide information on whether VTK was built with a system HDF5? We could at least, then, throw an error when it is know to cause an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.