# Updating ITK's HDF5

**URL:** https://discourse.itk.org/t/updating-itks-hdf5/472
**Category:** Engineering
**Created:** [December 1, 2017, 12:18am UTC](https://discourse.itk.org/t/updating-itks-hdf5/472 "2017-12-01T00:18:35Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![seanm](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/a88e4f/32.png) [@seanm](https://discourse.itk.org/u/seanm)
#### Post date: [December 1, 2017, 12:18am UTC](https://discourse.itk.org/t/updating-itks-hdf5/472/1 "2017-12-01T00:18:35Z")

</div>

Hi all,

ITK master includes HDF5 1.8.17, and 1.8.20 was released today so I thought I’d try to update it. But the current scripts seem to be out of date. HDF switched from svn to git in late 2016 or early 2017, ie since 1.8.17. So I figure this fact perhaps changes the entire strategy that those scripts use. How to proceed?

Thanks,

---

<div class="post-metadata">

### Author: ![fbudin](https://discourse.itk.org/user_avatar/discourse.itk.org/fbudin/32/14_2.png) [@fbudin](https://discourse.itk.org/u/fbudin)
#### Post date: [December 1, 2017, 1:54pm UTC](https://discourse.itk.org/t/updating-itks-hdf5/472/2 "2017-12-01T13:54:13Z")

</div>

Hello @seanm,

Thanks for looking into this. Best would be to create an [`UpdateFromUpstream.sh`](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/ThirdParty/GDCM/UpdateFromUpstream.sh) like there are for other third party libraries. This script calls [`update-third-party.bash`](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/Maintenance/update-third-party.bash). You can try to do this, and report here the problems you are encountering.

Hope this helps.

---

<div class="post-metadata">

### Author: ![seanm](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/a88e4f/32.png) [@seanm](https://discourse.itk.org/u/seanm)
#### Post date: [December 4, 2017, 7:24pm UTC](https://discourse.itk.org/t/updating-itks-hdf5/472/3 "2017-12-04T19:24:48Z")

</div>

François,

So I gave it a try…

The last few lines of output are:

```auto
Receiving objects: 100% (551/551), 2.62 MiB | 0 bytes/s, done.
Resolving deltas: 100% (152/152), done.
From /Users/sean/external/ITK/work/extract
 * [new branch] upstream-HDF5 -> upstream-HDF5
++ git merge --log -s ours --no-commit --allow-unrelated-histories upstream-HDF5
Merge with strategy ours failed.
+ rm -rf /Users/sean/external/ITK/work

```

It creates an ‘upstream-HDF5’ branch, but Modules/ThirdParty/HDF5/src/itkhdf5 doesn’t have new contents, I think perhaps because that folder already exists. Should I git rm it prior?

Cheers,

---

<div class="post-metadata">

### Author: ![fbudin](https://discourse.itk.org/user_avatar/discourse.itk.org/fbudin/32/14_2.png) [@fbudin](https://discourse.itk.org/u/fbudin)
#### Post date: [December 4, 2017, 7:40pm UTC](https://discourse.itk.org/t/updating-itks-hdf5/472/4 "2017-12-04T19:40:35Z")

</div>

@matt.mccormick Any idea or suggestion to help @seanm ?

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [December 4, 2017, 7:45pm UTC](https://discourse.itk.org/t/updating-itks-hdf5/472/5 "2017-12-04T19:45:26Z")

</div>

Yes, it is prudent to start apply on a fresh `ITK` clone.

If it still fails, `git status` may be able to help determine the issues with the merged, and conflicts may need to be resolved manually.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [July 27, 2018, 1:53pm UTC](https://discourse.itk.org/t/updating-itks-hdf5/472/6 "2018-07-27T13:53:12Z")

</div>

The second warning [here](https://open.cdash.org/viewConfigure.php?buildid=5471437) comes from HDF5. I thought that updating HDF5 might help. [Here](http://review.source.kitware.com/#/c/23597/) is a patch which should finish the process which @hjmjohnson started in March.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [August 1, 2018, 2:49pm UTC](https://discourse.itk.org/t/updating-itks-hdf5/472/7 "2018-08-01T14:49:16Z")

</div>

Now that the update patch has been merged, some machines have new ~300 test failures. This seems to be the prevailing error message:

```nohighlight
Assertion failed: (( '_'!=((const char *) __func__ )[2] && '_'!=((const char *) __func__ )[3] && !( ((const char *) __func__ )[4] && (isupper((int)( __func__ [3])) || isdigit((int)( __func__ [3]))) && '_'==((const char *) __func__ )[4] )) && "Function naming conventions are incorrect - check H5_IS_API|PUB|PRIV|PKG macros in H5private.h (this is usually due to an incorrect number of underscores)"), function itk_H5dont_atexit, file /Users/builder/external/ITK/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5.c, line 446.
itkTestDriver: Process exception: Child aborted

```

@blowekamp @seanm This seems to be affecting your machines. Is there anything special in these builds related to HDF5 configuration?

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [August 1, 2018, 2:50pm UTC](https://discourse.itk.org/t/updating-itks-hdf5/472/8 "2018-08-01T14:50:40Z")

</div>

Debug is on. I don’t think it’s enabled for the Gerrit CI.

---

<div class="post-metadata">

### Author: ![seanm](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/a88e4f/32.png) [@seanm](https://discourse.itk.org/u/seanm)
#### Post date: [August 1, 2018, 2:57pm UTC](https://discourse.itk.org/t/updating-itks-hdf5/472/9 "2018-08-01T14:57:34Z")

</div>

This gives me deja vu. I think it’s related to the symbol mangling. IIRC, the HDF5 code actually introspects the names of their symbols… let me see if I can find old emails about it…

Cheers,

---

<div class="post-metadata">

### Author: ![gdevenyi](https://discourse.itk.org/user_avatar/discourse.itk.org/gdevenyi/32/355_2.png) [@gdevenyi](https://discourse.itk.org/u/gdevenyi)
#### Post date: [August 2, 2018, 4:00pm UTC](https://discourse.itk.org/t/updating-itks-hdf5/472/10 "2018-08-02T16:00:52Z")

</div>

Hi,

It looks like the HDF5 update broke the MINCIO in a weird way.

ITK’s MINCIO now creates MINC files that only ITK can read/write. They’re somewhat right, as I can use ITK’s MINCIO to convert the file to a NIFTI and that NIFTI file is fine, however minc-toolkit proper can no longer read the MINC files.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [August 2, 2018, 4:52pm UTC](https://discourse.itk.org/t/updating-itks-hdf5/472/11 "2018-08-02T16:52:29Z")

</div>

Thanks for the feedback Gabriel.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [August 2, 2018, 10:21pm UTC](https://discourse.itk.org/t/updating-itks-hdf5/472/12 "2018-08-02T22:21:30Z")

</div>

I was able to reproduce the problem. As @blowekamp said, it appears in a debug build. The crash occurs during static initialization of ITKHDF5 library, so everything which is linked to it crashes (e.g. MINCIO). It is not obvious what the problem is. As @seanm mentioned the mangling, [here](http://review.source.kitware.com/#/c/23613/) is a patch which updates that. But that does not fix the crash, it only adds some warnings about duplicate symbol re-definitions.

---

<div class="post-metadata">

### Author: ![seanm](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/a88e4f/32.png) [@seanm](https://discourse.itk.org/u/seanm)
#### Post date: [August 3, 2018, 2:38am UTC](https://discourse.itk.org/t/updating-itks-hdf5/472/13 "2018-08-03T02:38:33Z")

</div>

I think this is what I was recalling:

[http://review.source.kitware.com/#/c/23177/](http://review.source.kitware.com/#/c/23177/)

[https://gitlab.kitware.com/third-party/hdf5/commit/72b9dd90c1c189a5e9059d375e4c20444bfa4a9c#f49d7c12a9a817d8d3e0e7397caff73fc79e6b9c](https://gitlab.kitware.com/third-party/hdf5/commit/72b9dd90c1c189a5e9059d375e4c20444bfa4a9c#f49d7c12a9a817d8d3e0e7397caff73fc79e6b9c)

Sean

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [August 3, 2018, 1:31pm UTC](https://discourse.itk.org/t/updating-itks-hdf5/472/14 "2018-08-03T13:31:01Z")

</div>

We are missing [this](http://review.source.kitware.com/#/c/23177/1..2/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5private.h). I will check whether that is enough or we need some other [changes](https://gitlab.kitware.com/third-party/hdf5/commit/72b9dd90c1c189a5e9059d375e4c20444bfa4a9c#f49d7c12a9a817d8d3e0e7397caff73fc79e6b9c) VTK did.

Thanks for pointing this out @seanm!

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [August 3, 2018, 9:07pm UTC](https://discourse.itk.org/t/updating-itks-hdf5/472/15 "2018-08-03T21:07:12Z")

</div>

This [patch](http://review.source.kitware.com/#/c/23613/) solves the problem for me.

---

<div class="post-metadata">

### Author: ![gdevenyi](https://discourse.itk.org/user_avatar/discourse.itk.org/gdevenyi/32/355_2.png) [@gdevenyi](https://discourse.itk.org/u/gdevenyi)
#### Post date: [August 7, 2018, 3:40pm UTC](https://discourse.itk.org/t/updating-itks-hdf5/472/16 "2018-08-07T15:40:31Z")

</div>

Unfortunately, this doesn’t seem to have fixed the MINCIO issue for me.

Any suggestions as to how to debug?

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [August 7, 2018, 3:43pm UTC](https://discourse.itk.org/t/updating-itks-hdf5/472/17 "2018-08-07T15:43:20Z")

</div>

Try clean and rebuild, or do a fresh build (configure and build ITK in a new directory).

---

<div class="post-metadata">

### Author: ![gdevenyi](https://discourse.itk.org/user_avatar/discourse.itk.org/gdevenyi/32/355_2.png) [@gdevenyi](https://discourse.itk.org/u/gdevenyi)
#### Post date: [August 7, 2018, 3:43pm UTC](https://discourse.itk.org/t/updating-itks-hdf5/472/18 "2018-08-07T15:43:58Z")

</div>

Done and done.

Using the .hdf5 format does seem to work, so this is a MINCIO specific issue.

---

<div class="post-metadata">

### Author: ![gdevenyi](https://discourse.itk.org/user_avatar/discourse.itk.org/gdevenyi/32/355_2.png) [@gdevenyi](https://discourse.itk.org/u/gdevenyi)
#### Post date: [August 7, 2018, 3:45pm UTC](https://discourse.itk.org/t/updating-itks-hdf5/472/19 "2018-08-07T15:45:22Z")

</div>

Paging @Vladimir_Fonov

---

<div class="post-metadata">

### Author: ![gdevenyi](https://discourse.itk.org/user_avatar/discourse.itk.org/gdevenyi/32/355_2.png) [@gdevenyi](https://discourse.itk.org/u/gdevenyi)
#### Post date: [August 7, 2018, 3:48pm UTC](https://discourse.itk.org/t/updating-itks-hdf5/472/20 "2018-08-07T15:48:29Z")

</div>

Oh, I see that HDF5 has bumped to “hdf5\_1\_10\_2”, that’s a big jump that libminc hasn’t been tested or patched against.

[Next page](https://discourse.itk.org/t/updating-itks-hdf5/472.md?page=2)
