netcdf4-python icon indicating copy to clipboard operation
netcdf4-python copied to clipboard

Compiling with GCC 14

Open papoteur-mga opened this issue 1 year ago • 0 comments

Hello, I'm trying to build netcdf4 -python in for Mageia Cauldron. I get this errors:

 gcc -fno-strict-overflow -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wformat -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -m64 -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fPIC -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -DNC_COMPLEX_NO_EXPORT=1 -I/usr/include -I/usr/lib64/python3.12/site-packages/numpy/_core/include -Iinclude -Iexternal/nc_complex/include -Iexternal/nc_complex/include/generated_fallbacks -I/usr/include/python3.12 -c external/nc_complex/src/nc_complex.c -o build/temp.linux-x86_64-cpython-312/external/nc_complex/src/nc_complex.o
  gcc -fno-strict-overflow -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wformat -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -m64 -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fPIC -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -DNC_COMPLEX_NO_EXPORT=1 -I/usr/include -I/usr/lib64/python3.12/site-packages/numpy/_core/include -Iinclude -Iexternal/nc_complex/include -Iexternal/nc_complex/include/generated_fallbacks -I/usr/include/python3.12 -c src/netCDF4/_netCDF4.c -o build/temp.linux-x86_64-cpython-312/src/netCDF4/_netCDF4.o
  In file included from include/mpi-compat.h:7,
                   from src/netCDF4/_netCDF4.c:1285:
  include/netcdf-compat.h:183:19: error: static declaration of ‘nc_def_var_bzip2’ follows non-static declaration
    183 | static inline int nc_def_var_bzip2(int ncid, int varid, int level) { return NC_EINVAL; }
        |                   ^~~~~~~~~~~~~~~~
  In file included from include/netcdf-compat.h:132:
  /usr/include/netcdf_filter.h:103:13: note: previous declaration of ‘nc_def_var_bzip2’ with type ‘int(int,  int,  int)’
    103 | EXTERNL int nc_def_var_bzip2(int ncid, int varid, int level);
        |             ^~~~~~~~~~~~~~~~
  include/netcdf-compat.h:184:19: error: static declaration of ‘nc_inq_var_bzip2’ follows non-static declaration
    184 | static inline int nc_inq_var_bzip2(int ncid, int varid, int* hasfilterp, int *levelp) { return NC_EINVAL; }
        |                   ^~~~~~~~~~~~~~~~
  /usr/include/netcdf_filter.h:104:13: note: previous declaration of ‘nc_inq_var_bzip2’ with type ‘int(int,  int,  int *, int *)’
    104 | EXTERNL int nc_inq_var_bzip2(int ncid, int varid, int* hasfilterp, int *levelp);
        |             ^~~~~~~~~~~~~~~~
  include/netcdf-compat.h:194:19: error: static declaration of ‘nc_def_var_blosc’ follows non-static declaration
    194 | static inline int nc_def_var_blosc(int ncid, int varid, unsigned subcompressor, unsigned level, unsigned blocksize, unsigned addshuffle) {
        |                   ^~~~~~~~~~~~~~~~
  /usr/include/netcdf_filter.h:110:13: note: previous declaration of ‘nc_def_var_blosc’ with type ‘int(int,  int,  unsigned int,  unsigned int,  unsigned int,  unsigned int)’
    110 | EXTERNL int nc_def_var_blosc(int ncid, int varid, unsigned subcompressor, unsigned level, unsigned blocksize, unsigned addshuffle);
        |             ^~~~~~~~~~~~~~~~
  include/netcdf-compat.h:197:19: error: static declaration of ‘nc_inq_var_blosc’ follows non-static declaration
    197 | static inline int nc_inq_var_blosc(int ncid, int varid, int* hasfilterp, unsigned* subcompressorp, unsigned* levelp, unsigned* blocksizep, unsigned* addshufflep) {
        |                   ^~~~~~~~~~~~~~~~
  /usr/include/netcdf_filter.h:111:13: note: previous declaration of ‘nc_inq_var_blosc’ with type ‘int(int,  int,  int *, unsigned int *, unsigned int *, unsigned int *, unsigned int *)’
    111 | EXTERNL int nc_inq_var_blosc(int ncid, int varid, int* hasfilterp, unsigned* subcompressorp, unsigned* levelp, unsigned* blocksizep, unsigned* addshufflep);
        |             ^~~~~~~~~~~~~~~~
  src/netCDF4/_netCDF4.c: In function ‘__pyx_pf_7netCDF4_8_netCDF4_7_MemBuf_4__dealloc__’:
  src/netCDF4/_netCDF4.c:13578:20: warning: passing argument 1 of ‘free’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  13578 |   free(__pyx_v_self->memory);
        |        ~~~~~~~~~~~~^~~~~~~~
  In file included from /usr/include/python3.12/Python.h:23,
                   from src/netCDF4/_netCDF4.c:65:
  /usr/include/stdlib.h:687:25: note: expected ‘void *’ but argument is of type ‘const void *’
    687 | extern void free (void *__ptr) __THROW;
        |                   ~~~~~~^~~~~
  src/netCDF4/_netCDF4.c: In function ‘__pyx_f_7netCDF4_8_netCDF4__read_compound’:
  src/netCDF4/_netCDF4.c:87425:33: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
  87425 |   for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_9; __pyx_t_2+=1) {
        |                                 ^
  src/netCDF4/_netCDF4.c: In function ‘__pyx_f_7netCDF4_8_netCDF4__read_enum’:
  src/netCDF4/_netCDF4.c:91641:33: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
  91641 |   for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_13; __pyx_t_2+=1) {
        |                                 ^
  src/netCDF4/_netCDF4.c: In function ‘__pyx_pymod_exec__netCDF4’:
  src/netCDF4/_netCDF4.c:117173:18: error: implicit declaration of function ‘nc_rc_set’ [-Wimplicit-function-declaration]
  117173 |     __pyx_t_6 = (nc_rc_set(((char *)"HTTP.SSL.CAINFO"), __pyx_t_5) != 0);
         |                  ^~~~~~~~~

This is with: GCC 14 numpy 2.1.0 cython 3.0.11

papoteur-mga avatar Aug 21 '24 13:08 papoteur-mga