Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main branch fails to compile with hdf5-1.14.0 due to byterange code in libhdf5/H5FDhttp.c #2614

Closed
edwardhartnett opened this issue Feb 10, 2023 · 3 comments

Comments

@edwardhartnett
Copy link
Contributor

make[2]: Entering directory '/home/ed/netcdf-c/libhdf5'
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -I../include -I../include -I../oc2 -I../libnczarr -I/usr/local/hdf5-1.14.0/include  -fno-strict-aliasing -MT libnchdf5_la-H5FDhttp.lo -MD -MP -MF .deps/libnchdf5_la-H5FDhttp.Tpo -c -o libnchdf5_la-H5FDhttp.lo `test -f 'H5FDhttp.c' || echo './'`H5FDhttp.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I../include -I../include -I../oc2 -I../libnczarr -I/usr/local/hdf5-1.14.0/include -fno-strict-aliasing -MT libnchdf5_la-H5FDhttp.lo -MD -MP -MF .deps/libnchdf5_la-H5FDhttp.Tpo -c H5FDhttp.c  -fPIC -DPIC -o .libs/libnchdf5_la-H5FDhttp.o
H5FDhttp.c:166:5: warning: initialization of ‘unsigned int’ from ‘char *’ makes integer from pointer without a cast [-Wint-conversion]
  166 |     "http",                     /* name         */
      |     ^~~~~~
H5FDhttp.c:166:5: note: (near initialization for ‘H5FD_http_g.version’)
H5FDhttp.c:166:5: error: initializer element is not computable at load time
H5FDhttp.c:166:5: note: (near initialization for ‘H5FD_http_g.version’)
H5FDhttp.c:129:17: warning: overflow in conversion from ‘long unsigned int’ to ‘int’ changes value from ‘9223372036854775807’ to ‘-1’ [-Woverflow]
  129 | #define MAXADDR (((haddr_t)1<<(8*sizeof(file_offset_t)-1))-1)
      |                 ^
H5FDhttp.c:167:5: note: in expansion of macro ‘MAXADDR’
  167 |     MAXADDR,                    /* maxaddr      */
      |     ^~~~~~~
H5FDhttp.c:168:5: warning: initialization of ‘const char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  168 |     H5F_CLOSE_WEAK,             /* fc_degree    */
      |     ^~~~~~~~~~~~~~
H5FDhttp.c:168:5: note: (near initialization for ‘H5FD_http_g.name’)
H5FDhttp.c:170:5: warning: initialization of ‘long unsigned int’ from ‘herr_t (*)(void)’ {aka ‘int (*)(void)’} makes integer from pointer without a cast [-Wint-conversion]
  170 |     H5FD_http_term,             /* terminate    */
      |     ^~~~~~~~~~~~~~
H5FDhttp.c:170:5: note: (near initialization for ‘H5FD_http_g.maxaddr’)
H5FDhttp.c:172:5: error: incompatible types when initializing type ‘enum H5F_close_degree_t’ using type ‘void *’
  172 |     NULL,                       /* sb_size      */
      |     ^~~~
H5FDhttp.c:177:5: warning: initialization of ‘long unsigned int’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  177 |     NULL,                       /* fapl_copy    */
      |     ^~~~
H5FDhttp.c:177:5: note: (near initialization for ‘H5FD_http_g.fapl_size’)
H5FDhttp.c:181:5: warning: initialization of ‘long unsigned int’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  181 |     NULL,                       /* dxpl_free    */
      |     ^~~~
H5FDhttp.c:181:5: note: (near initialization for ‘H5FD_http_g.dxpl_size’)
H5FDhttp.c:182:5: warning: initialization of ‘void * (*)(const void *)’ from incompatible pointer type ‘H5FD_t * (*)(const char *, unsigned int,  hid_t,  haddr_t)’ {aka ‘struct H5FD_t * (*)(const char *, unsigned int,  long int,  long unsigned int)’} [-Wincompatible-pointer-types]
  182 |     H5FD_http_open,            /* open         */
      |     ^~~~~~~~~~~~~~
H5FDhttp.c:182:5: note: (near initialization for ‘H5FD_http_g.dxpl_copy’)
H5FDhttp.c:183:5: warning: initialization of ‘herr_t (*)(void *)’ {aka ‘int (*)(void *)’} from incompatible pointer type ‘herr_t (*)(H5FD_t *)’ {aka ‘int (*)(struct H5FD_t *)’} [-Wincompatible-pointer-types]
  183 |     H5FD_http_close,           /* close        */
      |     ^~~~~~~~~~~~~~~
H5FDhttp.c:183:5: note: (near initialization for ‘H5FD_http_g.dxpl_free’)
H5FDhttp.c:184:5: warning: initialization of ‘H5FD_t * (*)(const char *, unsigned int,  hid_t,  haddr_t)’ {aka ‘struct H5FD_t * (*)(const char *, unsigned int,  long int,  long unsigned int)’} from incompatible pointer type ‘int (*)(const H5FD_t *, const H5FD_t *)’ {aka ‘int (*)(const struct H5FD_t *, const struct H5FD_t *)’} [-Wincompatible-pointer-types]
  184 |     H5FD_http_cmp,             /* cmp          */
      |     ^~~~~~~~~~~~~
H5FDhttp.c:184:5: note: (near initialization for ‘H5FD_http_g.open’)
H5FDhttp.c:185:5: warning: initialization of ‘herr_t (*)(H5FD_t *)’ {aka ‘int (*)(struct H5FD_t *)’} from incompatible pointer type ‘herr_t (*)(const H5FD_t *, long unsigned int *)’ {aka ‘int (*)(const struct H5FD_t *, long unsigned int *)’} [-Wincompatible-pointer-types]
  185 |     H5FD_http_query,           /* query        */
      |     ^~~~~~~~~~~~~~~
H5FDhttp.c:185:5: note: (near initialization for ‘H5FD_http_g.close’)
H5FDhttp.c:187:5: warning: initialization of ‘herr_t (*)(const H5FD_t *, long unsigned int *)’ {aka ‘int (*)(const struct H5FD_t *, long unsigned int *)’} from incompatible pointer type ‘haddr_t (*)(H5FD_t *, H5FD_mem_t,  hid_t,  hsize_t)’ {aka ‘long unsigned int (*)(struct H5FD_t *, enum H5F_mem_t,  long int,  long unsigned int)’} [-Wincompatible-pointer-types]
  187 |     H5FD_http_alloc,           /* alloc        */
      |     ^~~~~~~~~~~~~~~
H5FDhttp.c:187:5: note: (near initialization for ‘H5FD_http_g.query’)
H5FDhttp.c:189:5: warning: initialization of ‘haddr_t (*)(H5FD_t *, H5FD_mem_t,  hid_t,  hsize_t)’ {aka ‘long unsigned int (*)(struct H5FD_t *, enum H5F_mem_t,  long int,  long unsigned int)’} from incompatible pointer type ‘haddr_t (*)(const H5FD_t *, H5FD_mem_t)’ {aka ‘long unsigned int (*)(const struct H5FD_t *, enum H5F_mem_t)’} [-Wincompatible-pointer-types]
  189 |     H5FD_http_get_eoa,         /* get_eoa      */
      |     ^~~~~~~~~~~~~~~~~
H5FDhttp.c:189:5: note: (near initialization for ‘H5FD_http_g.alloc’)
H5FDhttp.c:190:5: warning: initialization of ‘herr_t (*)(H5FD_t *, H5FD_mem_t,  hid_t,  haddr_t,  hsize_t)’ {aka ‘int (*)(struct H5FD_t *, enum H5F_mem_t,  long int,  long unsigned int,  long unsigned int)’} from incompatible pointer type ‘herr_t (*)(H5FD_t *, H5FD_mem_t,  haddr_t)’ {aka ‘int (*)(struct H5FD_t *, enum H5F_mem_t,  long unsigned int)’} [-Wincompatible-pointer-types]
  190 |     H5FD_http_set_eoa,         /* set_eoa      */
      |     ^~~~~~~~~~~~~~~~~
H5FDhttp.c:190:5: note: (near initialization for ‘H5FD_http_g.free’)
H5FDhttp.c:192:5: warning: initialization of ‘herr_t (*)(H5FD_t *, H5FD_mem_t,  haddr_t)’ {aka ‘int (*)(struct H5FD_t *, enum H5F_mem_t,  long unsigned int)’} from incompatible pointer type ‘herr_t (*)(H5FD_t *, hid_t,  void **)’ {aka ‘int (*)(struct H5FD_t *, long int,  void **)’} [-Wincompatible-pointer-types]
  192 |     H5FD_http_get_handle,      /* get_handle   */
      |     ^~~~~~~~~~~~~~~~~~~~
H5FDhttp.c:192:5: note: (near initialization for ‘H5FD_http_g.set_eoa’)
H5FDhttp.c:193:5: warning: initialization of ‘haddr_t (*)(const H5FD_t *, H5FD_mem_t)’ {aka ‘long unsigned int (*)(const struct H5FD_t *, enum H5F_mem_t)’} from incompatible pointer type ‘herr_t (*)(H5FD_t *, H5FD_mem_t,  hid_t,  haddr_t,  size_t,  void *)’ {aka ‘int (*)(struct H5FD_t *, enum H5F_mem_t,  long int,  long unsigned int,  long unsigned int,  void *)’} [-Wincompatible-pointer-types]
  193 |     H5FD_http_read,            /* read         */
      |     ^~~~~~~~~~~~~~
H5FDhttp.c:193:5: note: (near initialization for ‘H5FD_http_g.get_eof’)
H5FDhttp.c:194:5: warning: initialization of ‘herr_t (*)(H5FD_t *, hid_t,  void **)’ {aka ‘int (*)(struct H5FD_t *, long int,  void **)’} from incompatible pointer type ‘herr_t (*)(H5FD_t *, H5FD_mem_t,  hid_t,  haddr_t,  size_t,  const void *)’ {aka ‘int (*)(struct H5FD_t *, enum H5F_mem_t,  long int,  long unsigned int,  long unsigned int,  const void *)’} [-Wincompatible-pointer-types]
  194 |     H5FD_http_write,           /* write        */
      |     ^~~~~~~~~~~~~~~
H5FDhttp.c:194:5: note: (near initialization for ‘H5FD_http_g.get_handle’)
H5FDhttp.c:195:5: warning: initialization of ‘herr_t (*)(H5FD_t *, H5FD_mem_t,  hid_t,  haddr_t,  size_t,  void *)’ {aka ‘int (*)(struct H5FD_t *, enum H5F_mem_t,  long int,  long unsigned int,  long unsigned int,  void *)’} from incompatible pointer type ‘herr_t (*)(H5FD_t *, hid_t,  hbool_t)’ {aka ‘int (*)(struct H5FD_t *, long int,  _Bool)’} [-Wincompatible-pointer-types]
  195 |     H5FD_http_flush,           /* flush        */
      |     ^~~~~~~~~~~~~~~
H5FDhttp.c:195:5: note: (near initialization for ‘H5FD_http_g.read’)
H5FDhttp.c:197:5: warning: initialization of ‘herr_t (*)(H5FD_t *, hid_t,  uint32_t,  H5FD_mem_t *, haddr_t *, size_t *, void **)’ {aka ‘int (*)(struct H5FD_t *, long int,  unsigned int,  enum H5F_mem_t *, long unsigned int *, long unsigned int *, void **)’} from incompatible pointer type ‘herr_t (*)(H5FD_t *, hbool_t)’ {aka ‘int (*)(struct H5FD_t *, _Bool)’} [-Wincompatible-pointer-types]
  197 |     H5FD_http_lock,            /* lock         */
      |     ^~~~~~~~~~~~~~
H5FDhttp.c:197:5: note: (near initialization for ‘H5FD_http_g.read_vector’)
H5FDhttp.c:198:5: warning: initialization of ‘herr_t (*)(H5FD_t *, hid_t,  uint32_t,  H5FD_mem_t *, haddr_t *, size_t *, const void **)’ {aka ‘int (*)(struct H5FD_t *, long int,  unsigned int,  enum H5F_mem_t *, long unsigned int *, long unsigned int *, const void **)’} from incompatible pointer type ‘herr_t (*)(H5FD_t *)’ {aka ‘int (*)(struct H5FD_t *)’} [-Wincompatible-pointer-types]
  198 |     H5FD_http_unlock,          /* unlock       */
      |     ^~~~~~~~~~~~~~~~
H5FDhttp.c:198:5: note: (near initialization for ‘H5FD_http_g.write_vector’)
H5FDhttp.c:199:5: warning: braces around scalar initializer
  199 |     H5FD_FLMAP_DICHOTOMY       /* fl_map       */
      |     ^~~~~~~~~~~~~~~~~~~~
H5FDhttp.c:199:5: note: (near initialization for ‘H5FD_http_g.read_selection’)
In file included from /usr/local/hdf5-1.14.0/include/hdf5.h:45,
                 from H5FDhttp.c:37:
/usr/local/hdf5-1.14.0/include/H5FDdevelop.h:133:9: warning: initialization of ‘herr_t (*)(H5FD_t *, H5FD_mem_t,  hid_t,  size_t,  hid_t *, hid_t *, haddr_t *, size_t *, void **)’ {aka ‘int (*)(struct H5FD_t *, enum H5F_mem_t,  long int,  long unsigned int,  long int *, long int *, long unsigned int *, long unsigned int *, void **)’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  133 |         H5FD_MEM_SUPER,     /*default*/                                                                      \
      |         ^~~~~~~~~~~~~~
H5FDhttp.c:199:5: note: in expansion of macro ‘H5FD_FLMAP_DICHOTOMY’
  199 |     H5FD_FLMAP_DICHOTOMY       /* fl_map       */
      |     ^~~~~~~~~~~~~~~~~~~~
/usr/local/hdf5-1.14.0/include/H5FDdevelop.h:133:9: note: (near initialization for ‘H5FD_http_g.read_selection’)
  133 |         H5FD_MEM_SUPER,     /*default*/                                                                      \
      |         ^~~~~~~~~~~~~~
H5FDhttp.c:199:5: note: in expansion of macro ‘H5FD_FLMAP_DICHOTOMY’
  199 |     H5FD_FLMAP_DICHOTOMY       /* fl_map       */
      |     ^~~~~~~~~~~~~~~~~~~~
/usr/local/hdf5-1.14.0/include/H5FDdevelop.h:134:13: warning: excess elements in scalar initializer
  134 |             H5FD_MEM_SUPER, /*super*/                                                                        \
      |             ^~~~~~~~~~~~~~
H5FDhttp.c:199:5: note: in expansion of macro ‘H5FD_FLMAP_DICHOTOMY’
  199 |     H5FD_FLMAP_DICHOTOMY       /* fl_map       */
      |     ^~~~~~~~~~~~~~~~~~~~
/usr/local/hdf5-1.14.0/include/H5FDdevelop.h:134:13: note: (near initialization for ‘H5FD_http_g.read_selection’)
  134 |             H5FD_MEM_SUPER, /*super*/                                                                        \
      |             ^~~~~~~~~~~~~~
H5FDhttp.c:199:5: note: in expansion of macro ‘H5FD_FLMAP_DICHOTOMY’
  199 |     H5FD_FLMAP_DICHOTOMY       /* fl_map       */
      |     ^~~~~~~~~~~~~~~~~~~~
/usr/local/hdf5-1.14.0/include/H5FDdevelop.h:135:13: warning: excess elements in scalar initializer
  135 |             H5FD_MEM_SUPER, /*btree*/                                                                        \
      |             ^~~~~~~~~~~~~~
H5FDhttp.c:199:5: note: in expansion of macro ‘H5FD_FLMAP_DICHOTOMY’
  199 |     H5FD_FLMAP_DICHOTOMY       /* fl_map       */
      |     ^~~~~~~~~~~~~~~~~~~~
/usr/local/hdf5-1.14.0/include/H5FDdevelop.h:135:13: note: (near initialization for ‘H5FD_http_g.read_selection’)
  135 |             H5FD_MEM_SUPER, /*btree*/                                                                        \
      |             ^~~~~~~~~~~~~~
H5FDhttp.c:199:5: note: in expansion of macro ‘H5FD_FLMAP_DICHOTOMY’
  199 |     H5FD_FLMAP_DICHOTOMY       /* fl_map       */
      |     ^~~~~~~~~~~~~~~~~~~~
/usr/local/hdf5-1.14.0/include/H5FDdevelop.h:136:13: warning: excess elements in scalar initializer
  136 |             H5FD_MEM_DRAW,  /*draw*/                                                                         \
      |             ^~~~~~~~~~~~~
H5FDhttp.c:199:5: note: in expansion of macro ‘H5FD_FLMAP_DICHOTOMY’
  199 |     H5FD_FLMAP_DICHOTOMY       /* fl_map       */
      |     ^~~~~~~~~~~~~~~~~~~~
/usr/local/hdf5-1.14.0/include/H5FDdevelop.h:136:13: note: (near initialization for ‘H5FD_http_g.read_selection’)
  136 |             H5FD_MEM_DRAW,  /*draw*/                                                                         \
      |             ^~~~~~~~~~~~~
H5FDhttp.c:199:5: note: in expansion of macro ‘H5FD_FLMAP_DICHOTOMY’
  199 |     H5FD_FLMAP_DICHOTOMY       /* fl_map       */
      |     ^~~~~~~~~~~~~~~~~~~~
/usr/local/hdf5-1.14.0/include/H5FDdevelop.h:137:13: warning: excess elements in scalar initializer
  137 |             H5FD_MEM_DRAW,  /*gheap*/                                                                        \
      |             ^~~~~~~~~~~~~
H5FDhttp.c:199:5: note: in expansion of macro ‘H5FD_FLMAP_DICHOTOMY’
  199 |     H5FD_FLMAP_DICHOTOMY       /* fl_map       */
      |     ^~~~~~~~~~~~~~~~~~~~
/usr/local/hdf5-1.14.0/include/H5FDdevelop.h:137:13: note: (near initialization for ‘H5FD_http_g.read_selection’)
  137 |             H5FD_MEM_DRAW,  /*gheap*/                                                                        \
      |             ^~~~~~~~~~~~~
H5FDhttp.c:199:5: note: in expansion of macro ‘H5FD_FLMAP_DICHOTOMY’
  199 |     H5FD_FLMAP_DICHOTOMY       /* fl_map       */
      |     ^~~~~~~~~~~~~~~~~~~~
/usr/local/hdf5-1.14.0/include/H5FDdevelop.h:138:13: warning: excess elements in scalar initializer
  138 |             H5FD_MEM_SUPER, /*lheap*/                                                                        \
      |             ^~~~~~~~~~~~~~
H5FDhttp.c:199:5: note: in expansion of macro ‘H5FD_FLMAP_DICHOTOMY’
  199 |     H5FD_FLMAP_DICHOTOMY       /* fl_map       */
      |     ^~~~~~~~~~~~~~~~~~~~
/usr/local/hdf5-1.14.0/include/H5FDdevelop.h:138:13: note: (near initialization for ‘H5FD_http_g.read_selection’)
  138 |             H5FD_MEM_SUPER, /*lheap*/                                                                        \
      |             ^~~~~~~~~~~~~~
H5FDhttp.c:199:5: note: in expansion of macro ‘H5FD_FLMAP_DICHOTOMY’
  199 |     H5FD_FLMAP_DICHOTOMY       /* fl_map       */
      |     ^~~~~~~~~~~~~~~~~~~~
/usr/local/hdf5-1.14.0/include/H5FDdevelop.h:139:13: warning: excess elements in scalar initializer
  139 |             H5FD_MEM_SUPER  /*ohdr*/                                                                         \
      |             ^~~~~~~~~~~~~~
H5FDhttp.c:199:5: note: in expansion of macro ‘H5FD_FLMAP_DICHOTOMY’
  199 |     H5FD_FLMAP_DICHOTOMY       /* fl_map       */
      |     ^~~~~~~~~~~~~~~~~~~~
/usr/local/hdf5-1.14.0/include/H5FDdevelop.h:139:13: note: (near initialization for ‘H5FD_http_g.read_selection’)
  139 |             H5FD_MEM_SUPER  /*ohdr*/                                                                         \
      |             ^~~~~~~~~~~~~~
H5FDhttp.c:199:5: note: in expansion of macro ‘H5FD_FLMAP_DICHOTOMY’
  199 |     H5FD_FLMAP_DICHOTOMY       /* fl_map       */
      |     ^~~~~~~~~~~~~~~~~~~~
make[2]: *** [Makefile:715: libnchdf5_la-H5FDhttp.lo] Error 1
make[2]: Leaving directory '/home/ed/netcdf-c/libhdf5'
make[1]: *** [Makefile:764: all-recursive] Error 1
make[1]: Leaving directory '/home/ed/netcdf-c'
make: *** [Makefile:609: all] Error 2
ed@koko:~/netcdf-c$ 
@DennisHeimbigner
Copy link
Collaborator

Did a quick diff of the HDF5 source 12 vs 14 and the changes do not
look overwhelming.

DennisHeimbigner added a commit to DennisHeimbigner/netcdf-c that referenced this issue Feb 10, 2023
re: Unidata#2614

Most of the changes are minor comment changes.
But the dispatch table for H5FD has changed, requiring changes
to H5FDhttp.c, which is derived from the HDF5 source file H5FDstdio.c.
The patch is to conditionally modify the dispatch table
to conform to the HDF5-1.14.0 version.
I was able to build and successfully test 1.14 for a reasonable
set of (non-parallel) ./configure options.
@DennisHeimbigner
Copy link
Collaborator

Fixed(?) by PR #2615

DennisHeimbigner added a commit to DennisHeimbigner/netcdf-c that referenced this issue Feb 16, 2023
re: PR Unidata#2615
re: Issue Unidata#2614

H/T to Even Rouault for suggesting that Unidata get an assigned VFD id.

This PR insert the assigned VFD id into H5FDhttp.c.
DennisHeimbigner added a commit to DennisHeimbigner/netcdf-c that referenced this issue Feb 22, 2023
re: Issue Unidata#2634
re: PR Unidata#2615
re: Issue Unidata#2614

It turns out that the H5FD table change identified in
issue Unidata#2614
actually occurred in HDF5 version 1.13.2.
Since we do not test with 1.13.x, we did not catch this.
@edwardhartnett
Copy link
Contributor Author

I believe this has been fixed, so I will close this issue. Quick work @DennisHeimbigner !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants