Build tests failing on HDF5-2.2.0 for aarch64

I’m attempting to build hdf5-2.2.0 on aarch64 Ubuntu 24.04.4, but the build fails when running some of the tests.

What I’ve done:

  1. Downloaded the .tar.gz from Github (hdf5-2.2.0.tar.gz)
  2. As root, untarred into a directory under /root
  3. cd hdf5-2.2.0
  4. Invoke the build: cmake --workflow --preset ci-StdShar-GNUC --fresh
  5. Build fails with
The following tests FAILED:
        2866 - JUnit-TestH5Fbasic (Failed)

Looking through the output, it looks as if testH5Fopen_read_only failed:

There was 1 failure:
1) testH5Fopen_read_only(test.TestH5Fbasic)
java.lang.AssertionError: Expected exception: hdf.hdf5lib.exceptions.HDF5LibraryException
	at org.junit.internal.runners.statements.ExpectException.evaluate(ExpectException.java:34)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.junit.runners.Suite.runChild(Suite.java:128)
	at org.junit.runners.Suite.runChild(Suite.java:27)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
	at org.junit.runner.JUnitCore.runMain(JUnitCore.java:77)
	at org.junit.runner.JUnitCore.main(JUnitCore.java:36)

FAILURES!!!
Tests run: 16,  Failures: 1

I’m building on a local disk, so no NFS mounts. I’m a little lost as to what exactly to do to troubleshoot from here.

I was able to resolve my issue browsing the HDF5 Github: Failing JUnit-TestH5Fbasic · Issue #6338 · HDFGroup/hdf5 · GitHub

It sounds as if the issue in my case came down to building as root, which it’s mentioned in the above thread that building as sudo shouldn’t be done, which I’d assume extends to building when logged in as root.

My objective was to build HDF5 and install it in a system-wide accessibly location to use w/ other system packages.

As an unprivileged user, I untar’d the .tar.gz from Github, ran the following:

cd hdf5
mkdir build
cmake --preset ci-StdShar-GNUC --fresh -DCMAKE_INSTALL_PREFIX=/opt/hdf5 -G "Unix Makefiles" -B build/
cd build
make
ctest . --parallel
sudo make install

Here, /opt/hdf5 is the system-wide location I want to install under.

This process worked for me.