Repository: spack/spack

Issue:
Adios does not build with HDF5 1.10
The `adios` variant `+hdf5` is broken. The error is

```
In file included from /xfs1/eschnetter/src/spack/opt/spack/linux-Ubuntu14-x86_64/gcc-6.1.1/hdf5-1.10.0-patch1-ijwvzsvpcbne33bffg6nrefdwgguofji/include/H5public.h:145:0,
                 from /xfs1/eschnetter/src/spack/opt/spack/linux-Ubuntu14-x86_64/gcc-6.1.1/hdf5-1.10.0-patch1-ijwvzsvpcbne33bffg6nrefdwgguofji/include/hdf5.h:24,
                 from bp2h5.c:39:
bp2h5.c:46:13: error: two or more data types in declaration specifiers
 typedef int bool;
             ^
bp2h5.c:46:1: warning: useless type name in empty declaration
 typedef int bool;
 ^~~~~~~
bp2h5.c: In function ‘main’:
bp2h5.c:173:17: warning: implicit declaration of function ‘H5LTmake_dataset’ [-Wimplicit-function-declaration]
                 H5LTmake_dataset(HDF5_FILE,h5name,1,count,h5_type_id,v->value);
                 ^~~~~~~~~~~~~~~~
make[3]: *** [bp2h5-bp2h5.o] Error 1
make[3]: Leaving directory `/tmp/eschnetter/spack-stage/spack-stage-0LLmsR/ADIOS-1.10.0/utils/bp2h5'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/tmp/eschnetter/spack-stage/spack-stage-0LLmsR/ADIOS-1.10.0/utils'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/eschnetter/spack-stage/spack-stage-0LLmsR/ADIOS-1.10.0'
```

It seems that Adios expects `bool` to be undefined, but it is already defined. It might be that HDF5 1.10 includes `<stdbool.h>`.



Discussion:
@ax3l @robertdfrench do you know if adios supports HDF5 1.10?

Good question, have to ask @pnorbert upstream on that.


Resolving patch:
diff --git a/var/spack/repos/builtin/packages/adios/package.py b/var/spack/repos/builtin/packages/adios/package.py
--- a/var/spack/repos/builtin/packages/adios/package.py
+++ b/var/spack/repos/builtin/packages/adios/package.py
@@ -36,6 +36,8 @@ class Adios(Package):
     homepage = "http://www.olcf.ornl.gov/center-projects/adios/"
     url      = "https://github.com/ornladios/ADIOS/archive/v1.10.0.tar.gz"
 
+    version('develop', git='https://github.com/ornladios/ADIOS.git',
+            branch='master')
     version('1.10.0', 'eff450a4c0130479417cfd63186957f3')
     version('1.9.0', '310ff02388bbaa2b1c1710ee970b5678')
 
@@ -48,14 +50,14 @@ class Adios(Package):
     variant('mpi', default=True, description='Enable MPI support')
     variant('infiniband', default=False, description='Enable infiniband support')
 
+    # transforms
     variant('zlib', default=True, description='Enable szip transform support')
     variant('szip', default=False, description='Enable szip transform support')
-    variant('hdf5', default=False, description='Enable HDF5 transport support')
-    variant('netcdf', default=False, description='Enable NetCDF transport support')
+    # transports and serial file converters
+    variant('hdf5', default=False, description='Enable parallel HDF5 transport and serial bp2h5 converter')
 
     # Lots of setting up here for this package
     # module swap PrgEnv-intel PrgEnv-$COMP
-    # module load cray-netcdf/4.3.3.1
     # module load cray-hdf5/1.8.14
     # module load python/2.7.10
 
@@ -69,9 +71,13 @@ class Adios(Package):
     # optional transformations
     depends_on('zlib', when='+zlib')
     depends_on('szip', when='+szip')
-    # optional transports
-    depends_on('hdf5', when='+hdf5')
-    depends_on('netcdf', when='+netcdf')
+    # optional transports & file converters
+    depends_on('hdf5@1.8:+mpi', when='+hdf5')
+
+    # Fix ADIOS <=1.10.0 compile error on HDF5 1.10+
+    #   https://github.com/ornladios/ADIOS/commit/3b21a8a41509
+    #   https://github.com/LLNL/spack/issues/1683
+    patch('adios_1100.patch', when='@:1.10.0^hdf5@1.10:')
 
     def validate(self, spec):
         """
@@ -114,9 +120,7 @@ def install(self, spec, prefix):
         if '+szip' in spec:
             extra_args.append('--with-szip=%s' % spec['szip'].prefix)
         if '+hdf5' in spec:
-            extra_args.append('--with-hdf5=%s' % spec['hdf5'].prefix)
-        if '+netcdf' in spec:
-            extra_args.append('--with-netcdf=%s' % spec['netcdf'].prefix)
+            extra_args.append('--with-phdf5=%s' % spec['hdf5'].prefix)
 
         sh = which('sh')
         sh('./autogen.sh')


Test patch: