Repository: spack/spack

Issue:
openpmd-api fails to build
Having trouble building package `openpmd-api` on all of the following x86_64 systems with `gcc@7.3.0` and `gcc@7.4.0`:
1. CentOS 7
2. CentOS 8
3. RHEL 7
4. RHEL 8
5. Ubuntu 18.04

Using develop at commit 471f23e456e3b26a (14-March-2020)

```
$> spack install openpmd-api
...
==> Error: Failed to install openpmd-api due to ChildError: ProcessError: Command exited with status 2:
    'make' '-j8'
4 errors found in build log:
     137    /home/walker/spack/lib/spack/env/gcc/g++  -DopenPMD_EXPORTS -DopenPMD_USE_VERIFY=1 -I/tmp/walker/spack-stage/spack-stage-openpmd-api-0.11.0-tzwey7v2bmofo4qriul4vybqefimrmpx/spack-src/include -I/tmp/walker/spack
            -stage/spack-stage-openpmd-api-0.11.0-tzwey7v2bmofo4qriul4vybqefimrmpx/spack-build/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/nlohmann-json-3.7.2-dt2yaxrxnaksgjto4lxcsklice
            3k3tua/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/hdf5-1.12.0-6dge5tfvm4sqeuumuqn4do7npsfkjbwa/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.
            4.0/zlib-1.2.11-o2viq7yriiaw6nwqpaa7ltpyzqkaonhb/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/mpark-variant-1.4.0-xoqx2ok47eoqhm2spapxdexund3kzzai/include -isystem /home/walk
            er/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/mpich-3.2.1-om2ebndbpaksaykav76dtc6xoqcyekqr/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/adios2-2.5.0-ttdhw5awwkih5nxv4
            itbwzu35m5qbkeh/include  -Wall -Wextra -Wpedantic -Wshadow -Woverloaded-virtual -Wunreachable-code -O2 -g -DNDEBUG -fPIC   -o CMakeFiles/openPMD.dir/src/IO/HDF5/ParallelHDF5IOHandler.cpp.o -c /tmp/walker/spack-
            stage/spack-stage-openpmd-api-0.11.0-tzwey7v2bmofo4qriul4vybqefimrmpx/spack-src/src/IO/HDF5/ParallelHDF5IOHandler.cpp
     138    [ 78%] Building CXX object CMakeFiles/openPMD.dir/src/IO/JSON/JSONIOHandler.cpp.o
     139    /home/walker/spack/lib/spack/env/gcc/g++  -DopenPMD_EXPORTS -DopenPMD_USE_VERIFY=1 -I/tmp/walker/spack-stage/spack-stage-openpmd-api-0.11.0-tzwey7v2bmofo4qriul4vybqefimrmpx/spack-src/include -I/tmp/walker/spack
            -stage/spack-stage-openpmd-api-0.11.0-tzwey7v2bmofo4qriul4vybqefimrmpx/spack-build/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/nlohmann-json-3.7.2-dt2yaxrxnaksgjto4lxcsklice
            3k3tua/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/hdf5-1.12.0-6dge5tfvm4sqeuumuqn4do7npsfkjbwa/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.
            4.0/zlib-1.2.11-o2viq7yriiaw6nwqpaa7ltpyzqkaonhb/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/mpark-variant-1.4.0-xoqx2ok47eoqhm2spapxdexund3kzzai/include -isystem /home/walk
            er/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/mpich-3.2.1-om2ebndbpaksaykav76dtc6xoqcyekqr/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/adios2-2.5.0-ttdhw5awwkih5nxv4
            itbwzu35m5qbkeh/include  -Wall -Wextra -Wpedantic -Wshadow -Woverloaded-virtual -Wunreachable-code -O2 -g -DNDEBUG -fPIC   -o CMakeFiles/openPMD.dir/src/IO/JSON/JSONIOHandler.cpp.o -c /tmp/walker/spack-stage/sp
            ack-stage-openpmd-api-0.11.0-tzwey7v2bmofo4qriul4vybqefimrmpx/spack-src/src/IO/JSON/JSONIOHandler.cpp
     140    [ 81%] Building CXX object CMakeFiles/openPMD.dir/src/IO/JSON/JSONIOHandlerImpl.cpp.o
     141    /home/walker/spack/lib/spack/env/gcc/g++  -DopenPMD_EXPORTS -DopenPMD_USE_VERIFY=1 -I/tmp/walker/spack-stage/spack-stage-openpmd-api-0.11.0-tzwey7v2bmofo4qriul4vybqefimrmpx/spack-src/include -I/tmp/walker/spack
            -stage/spack-stage-openpmd-api-0.11.0-tzwey7v2bmofo4qriul4vybqefimrmpx/spack-build/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/nlohmann-json-3.7.2-dt2yaxrxnaksgjto4lxcsklice
            3k3tua/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/hdf5-1.12.0-6dge5tfvm4sqeuumuqn4do7npsfkjbwa/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.
            4.0/zlib-1.2.11-o2viq7yriiaw6nwqpaa7ltpyzqkaonhb/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/mpark-variant-1.4.0-xoqx2ok47eoqhm2spapxdexund3kzzai/include -isystem /home/walk
            er/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/mpich-3.2.1-om2ebndbpaksaykav76dtc6xoqcyekqr/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/adios2-2.5.0-ttdhw5awwkih5nxv4
            itbwzu35m5qbkeh/include  -Wall -Wextra -Wpedantic -Wshadow -Woverloaded-virtual -Wunreachable-code -O2 -g -DNDEBUG -fPIC   -o CMakeFiles/openPMD.dir/src/IO/JSON/JSONIOHandlerImpl.cpp.o -c /tmp/walker/spack-stag
            e/spack-stage-openpmd-api-0.11.0-tzwey7v2bmofo4qriul4vybqefimrmpx/spack-src/src/IO/JSON/JSONIOHandlerImpl.cpp
     142    /tmp/walker/spack-stage/spack-stage-openpmd-api-0.11.0-tzwey7v2bmofo4qriul4vybqefimrmpx/spack-src/src/IO/HDF5/HDF5IOHandler.cpp: In member function 'virtual void openPMD::HDF5IOHandlerImpl::listAttributes(openP
            MD::Writable*, openPMD::Parameter<(openPMD::Operation)17>&)':
  >> 143    /tmp/walker/spack-stage/spack-stage-openpmd-api-0.11.0-tzwey7v2bmofo4qriul4vybqefimrmpx/spack-src/src/IO/HDF5/HDF5IOHandler.cpp:1537:47: error: too few arguments to function 'herr_t H5Oget_info3(hid_t, H5O_info
            2_t*, unsigned int)'
     144         status = H5Oget_info(node_id, &object_info);
     145                                                   ^
     146    In file included from /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/hdf5-1.12.0-6dge5tfvm4sqeuumuqn4do7npsfkjbwa/include/H5Apublic.h:22:0,
     147                     from /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/hdf5-1.12.0-6dge5tfvm4sqeuumuqn4do7npsfkjbwa/include/hdf5.h:23,
     148                     from /tmp/walker/spack-stage/spack-stage-openpmd-api-0.11.0-tzwey7v2bmofo4qriul4vybqefimrmpx/spack-src/include/openPMD/IO/HDF5/HDF5IOHandlerImpl.hpp:26,
     149                     from /tmp/walker/spack-stage/spack-stage-openpmd-api-0.11.0-tzwey7v2bmofo4qriul4vybqefimrmpx/spack-src/src/IO/HDF5/HDF5IOHandler.cpp:22:

     ...

     156    /home/walker/spack/lib/spack/env/gcc/g++  -DopenPMD_EXPORTS -DopenPMD_USE_VERIFY=1 -I/tmp/walker/spack-stage/spack-stage-openpmd-api-0.11.0-tzwey7v2bmofo4qriul4vybqefimrmpx/spack-src/include -I/tmp/walker/spack
            -stage/spack-stage-openpmd-api-0.11.0-tzwey7v2bmofo4qriul4vybqefimrmpx/spack-build/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/nlohmann-json-3.7.2-dt2yaxrxnaksgjto4lxcsklice
            3k3tua/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/hdf5-1.12.0-6dge5tfvm4sqeuumuqn4do7npsfkjbwa/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.
            4.0/zlib-1.2.11-o2viq7yriiaw6nwqpaa7ltpyzqkaonhb/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/mpark-variant-1.4.0-xoqx2ok47eoqhm2spapxdexund3kzzai/include -isystem /home/walk
            er/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/mpich-3.2.1-om2ebndbpaksaykav76dtc6xoqcyekqr/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/adios2-2.5.0-ttdhw5awwkih5nxv4
            itbwzu35m5qbkeh/include  -Wall -Wextra -Wpedantic -Wshadow -Woverloaded-virtual -Wunreachable-code -O2 -g -DNDEBUG -fPIC   -o CMakeFiles/openPMD.dir/src/IO/ADIOS/ADIOS2IOHandler.cpp.o -c /tmp/walker/spack-stage
            /spack-stage-openpmd-api-0.11.0-tzwey7v2bmofo4qriul4vybqefimrmpx/spack-src/src/IO/ADIOS/ADIOS2IOHandler.cpp
     157    [ 89%] Building CXX object CMakeFiles/openPMD.dir/src/IO/ADIOS/ADIOS2Auxiliary.cpp.o
     158    /home/walker/spack/lib/spack/env/gcc/g++  -DopenPMD_EXPORTS -DopenPMD_USE_VERIFY=1 -I/tmp/walker/spack-stage/spack-stage-openpmd-api-0.11.0-tzwey7v2bmofo4qriul4vybqefimrmpx/spack-src/include -I/tmp/walker/spack
            -stage/spack-stage-openpmd-api-0.11.0-tzwey7v2bmofo4qriul4vybqefimrmpx/spack-build/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/nlohmann-json-3.7.2-dt2yaxrxnaksgjto4lxcsklice
            3k3tua/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/hdf5-1.12.0-6dge5tfvm4sqeuumuqn4do7npsfkjbwa/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.
            4.0/zlib-1.2.11-o2viq7yriiaw6nwqpaa7ltpyzqkaonhb/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/mpark-variant-1.4.0-xoqx2ok47eoqhm2spapxdexund3kzzai/include -isystem /home/walk
            er/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/mpich-3.2.1-om2ebndbpaksaykav76dtc6xoqcyekqr/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/adios2-2.5.0-ttdhw5awwkih5nxv4
            itbwzu35m5qbkeh/include  -Wall -Wextra -Wpedantic -Wshadow -Woverloaded-virtual -Wunreachable-code -O2 -g -DNDEBUG -fPIC   -o CMakeFiles/openPMD.dir/src/IO/ADIOS/ADIOS2Auxiliary.cpp.o -c /tmp/walker/spack-stage
            /spack-stage-openpmd-api-0.11.0-tzwey7v2bmofo4qriul4vybqefimrmpx/spack-src/src/IO/ADIOS/ADIOS2Auxiliary.cpp
     159    [ 91%] Building CXX object CMakeFiles/openPMD.dir/src/IO/InvalidatableFile.cpp.o
     160    /home/walker/spack/lib/spack/env/gcc/g++  -DopenPMD_EXPORTS -DopenPMD_USE_VERIFY=1 -I/tmp/walker/spack-stage/spack-stage-openpmd-api-0.11.0-tzwey7v2bmofo4qriul4vybqefimrmpx/spack-src/include -I/tmp/walker/spack
            -stage/spack-stage-openpmd-api-0.11.0-tzwey7v2bmofo4qriul4vybqefimrmpx/spack-build/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/nlohmann-json-3.7.2-dt2yaxrxnaksgjto4lxcsklice
            3k3tua/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/hdf5-1.12.0-6dge5tfvm4sqeuumuqn4do7npsfkjbwa/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.
            4.0/zlib-1.2.11-o2viq7yriiaw6nwqpaa7ltpyzqkaonhb/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/mpark-variant-1.4.0-xoqx2ok47eoqhm2spapxdexund3kzzai/include -isystem /home/walk
            er/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/mpich-3.2.1-om2ebndbpaksaykav76dtc6xoqcyekqr/include -isystem /home/walker/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/adios2-2.5.0-ttdhw5awwkih5nxv4
            itbwzu35m5qbkeh/include  -Wall -Wextra -Wpedantic -Wshadow -Woverloaded-virtual -Wunreachable-code -O2 -g -DNDEBUG -fPIC   -o CMakeFiles/openPMD.dir/src/IO/InvalidatableFile.cpp.o -c /tmp/walker/spack-stage/spa
            ck-stage-openpmd-api-0.11.0-tzwey7v2bmofo4qriul4vybqefimrmpx/spack-src/src/IO/InvalidatableFile.cpp
     161    CMakeFiles/openPMD.dir/build.make:403: recipe for target 'CMakeFiles/openPMD.dir/src/IO/HDF5/HDF5IOHandler.cpp.o' failed
  >> 162    make[2]: *** [CMakeFiles/openPMD.dir/src/IO/HDF5/HDF5IOHandler.cpp.o] Error 1
     163    make[2]: *** Waiting for unfinished jobs....
     164    make[2]: Leaving directory '/tmp/walker/spack-stage/spack-stage-openpmd-api-0.11.0-tzwey7v2bmofo4qriul4vybqefimrmpx/spack-build'
     165    CMakeFiles/Makefile2:107: recipe for target 'CMakeFiles/openPMD.dir/all' failed
  >> 166    make[1]: *** [CMakeFiles/openPMD.dir/all] Error 2
     167    make[1]: Leaving directory '/tmp/walker/spack-stage/spack-stage-openpmd-api-0.11.0-tzwey7v2bmofo4qriul4vybqefimrmpx/spack-build'
     168    Makefile:132: recipe for target 'all' failed
  >> 169    make: *** [all] Error 2

See build log for details:
  /tmp/walker/spack-stage/spack-stage-openpmd-api-0.11.0-tzwey7v2bmofo4qriul4vybqefimrmpx/spack-build-out.txt
```

Here is the full build log: 
[openpmd-api.txt](https://github.com/spack/spack/files/4335013/openpmd-api.txt)


@ax3l @tylerjereddy 



Discussion:
Thank you for the detailed report!

Which version of HDF5 did it use?

I'll be back tomorrow and can take a look at it.

Thanks,
Axel
In the meantime, you could disable HDF5 support via

spack install openpmd-api ~hdf5

This will leave the JSON and ADIOS2 backend enabled.

Alternativly, try an older version of HDF5 via

```
spack versions hdf5
# pick and older one

spack install openpmd-api +hdf5 ^hdf5@olderVersionHere
```
It is using `hdf5@1.12.0` -- looks like this version was added to Spack only a few days ago. I am trying the build now with the second most recent version `hdf5@1.10.6` and will report the results here. I also noticed `petsc` stopped building recently, also complaining about hdf5, so I suspect it is the new version.

**Update @ 1400 on 15-March-2020:**

`openpmd-api` building just fine with `hdf5@1.10.6`, as is `petsc`.

`$> spack install openpmd-api ^hdf5@1.10.6` ==> **builds**

@ax3l 
Urgh, looks really like HDF 1.12.0 has a couple of breaking changes. Dang, semantic version is not a thing in HDF5, they also had breakage before in minor release numbers.

I'll work on this tomorrow and release a bugfix version to add compatibility. Yes until then just use HDF5 1.10.6 as indicated above please.

On March 15, 2020 3:56:20 PM EST, eugeneswalker <notifications@github.com> wrote:
>It is using `hdf5@1.12.0` -- looks like this version was added to Spack
>only a few days ago. I am trying the build now with the second most
>recent version `hdf5@1.10.6` and will report the results here. I also
>noticed `petsc` stopped building recently, also complaining about hdf5,
>so I suspect it is the new version. @ax3l 
>
>-- 
>You are receiving this because you were mentioned.
>Reply to this email directly or view it on GitHub:
>https://github.com/spack/spack/issues/15502#issuecomment-599263527

Linking issues here: it looks like the HDF5 update (https://github.com/spack/spack/pull/15430) also broke silo (https://github.com/spack/spack/pull/15495)
@ax3l It looks like HDF5 *does* provide an option for building 1.12 with a 1.10-compatible API , or (alternatively) defining compatibility variables in downstream projects.

https://portal.hdfgroup.org/display/HDF5/Migrating+from+HDF5+1.10+to+HDF5+1.12

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/openpmd-api/package.py b/var/spack/repos/builtin/packages/openpmd-api/package.py
--- a/var/spack/repos/builtin/packages/openpmd-api/package.py
+++ b/var/spack/repos/builtin/packages/openpmd-api/package.py
@@ -55,6 +55,10 @@ class OpenpmdApi(CMakePackage):
 
     extends('python', when='+python')
 
+    # Fix breaking HDF5 1.12.0 API
+    # https://github.com/openPMD/openPMD-api/pull/696
+    patch('hdf5-1.12.0.patch', when='@:0.11.0 +hdf5')
+
     def cmake_args(self):
         spec = self.spec
 


Test patch: