# Build error with itk on ubuntu1804

**URL:** <https://discourse.slicer.org/t/build-error-with-itk-on-ubuntu1804/8107>\
**Category:** Development\
**Tags:** build\
**Created:** [August 20, 2019, 6:36pm UTC](https://discourse.slicer.org/t/build-error-with-itk-on-ubuntu1804/8107 "2019-08-20T18:36:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chenray844](https://avatars.discourse-cdn.com/v4/letter/c/aeb1de/32.png) [@chenray844](https://discourse.slicer.org/u/chenray844)\
**Post date:** [August 20, 2019, 6:36pm UTC](https://discourse.slicer.org/t/build-error-with-itk-on-ubuntu1804/8107/1 "2019-08-20T18:36:38Z")

</div>

when I build slicer on ubuntu1804 with latest code, some error happens.

```auto
[74%] Building C object Modules/ThirdParty/HDF5/src/itkhdf5/src/CMakeFiles/hdf5-shared.dir/__/shared/H5Tinit.c.o
In file included from /home/chenrf/Projects/medical/slicer/build/ITK-build/Modules/ThirdParty/HDF5/src/itkhdf5/shared/H5Tinit.c:82:0:
/home/chenrf/Projects/medical/slicer/build/ITK/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!"
  ^ ~~~~
Modules/ThirdParty/HDF5/src/itkhdf5/src/CMakeFiles/hdf5-shared.dir/build.make:3944: recipe for target 'Modules/ThirdParty/HDF5/src/itkhdf5/src/CMakeFiles/hdf5-shared.dir/__/shared/H5Tinit.c.o' failed
make[5]: *** [Modules/ThirdParty/HDF5/src/itkhdf5/src/CMakeFiles/hdf5-shared.dir/__/shared/H5Tinit.c.o] Error 1
CMakeFiles/Makefile2:6965: recipe for target 'Modules/ThirdParty/HDF5/src/itkhdf5/src/CMakeFiles/hdf5-shared.dir/all' failed
make[4]: *** [Modules/ThirdParty/HDF5/src/itkhdf5/src/CMakeFiles/hdf5-shared.dir/all] Error 2
make[4]: *** Waiting for unfinished jobs....

```

ITK:

```auto
$ git branch
* (HEAD detached at 35e6f54643)
  welcome

```

Slicer:

```auto
git reflog
aa245a9d5 (HEAD -> master, origin/master, origin/HEAD) HEAD@{0}: pull: Fast-forward
ced36e5fa (origin/nightly-master) HEAD@{1}: pull: Fast-forward
1b7888e90 HEAD@{2}: pull: Fast-forward

```

cmake

```auto
 cmake --version
cmake version 3.15.0

CMake suite maintained and supported by Kitware (kitware.com/cmake).

```

How can I fix this bug?

> <https://github.com/InsightSoftwareConsortium/ITK/issues/509#issuecomment-522998801>

---

<div class="post-metadata">

**Author:** ![chenray844](https://avatars.discourse-cdn.com/v4/letter/c/aeb1de/32.png) [@chenray844](https://discourse.slicer.org/u/chenray844)\
**Post date:** [August 19, 2019, 7:31am UTC](https://discourse.slicer.org/t/build-error-with-itk-on-ubuntu1804/8107/2 "2019-08-19T07:31:32Z")

</div>

In file included from /home/chenrf/Projects/medical/slicer/build/ITK-build/Modules/ThirdParty/HDF5/src/itkhdf5/shared/H5Tinit.c:82:0:  
/home/chenrf/Projects/medical/slicer/build/ITK/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!”  
^ ~~~~  
Modules/ThirdParty/HDF5/src/itkhdf5/src/CMakeFiles/hdf5-shared.dir/build.make:3944: recipe for target 'Modules/ThirdParty/HDF5/src/itkhdf5/src/CMakeFiles/hdf5-shared.dir/**/shared/H5Tinit.c.o’ failed  
make[5]: \*\*\* [Modules/ThirdParty/HDF5/src/itkhdf5/src/CMakeFiles/hdf5-shared.dir/**/shared/H5Tinit.c.o] Error 1  
CMakeFiles/Makefile2:6965: recipe for target ‘Modules/ThirdParty/HDF5/src/itkhdf5/src/CMakeFiles/hdf5-shared.dir/all’ failed  
make[4]: \*\*\* [Modules/ThirdParty/HDF5/src/itkhdf5/src/CMakeFiles/hdf5-shared.dir/all] Error 2  
make[4]: \*\*\* Waiting for unfinished jobs…

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/2/02c88470e7a55ba6fedea6b89022c9e8230e48f9.png)

@all

What can I do to fit this build ITK error?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [August 23, 2019, 6:27pm UTC](https://discourse.slicer.org/t/build-error-with-itk-on-ubuntu1804/8107/3 "2019-08-23T18:27:40Z")

</div>

You can see on the [dashboard](http://slicer.cdash.org/index.php?project=SlicerPreview) that Slicer builds without problems on Linux. Maybe try with the same tools as used on the dashboard computer (CMake version, compiler, etc.), and maybe also try to uninstall any system ITK, VTK, HDF5 libraries.
