Error in configure with gcc-10


#1

Hi,

I’m trying to build HDF5 from source, something I’ve done numerous times in the past. I am however using a new Centos server where I am required to use gcc-10 with a proprietary version of OpenMPI. Details:

OS: Centos 8.2.2004
Compiler: gcc 10.1.0

I am running the following configure command:

./configure --prefix=$PWD/build --enable-shared --enable-cxx --enable-fortran --enable-parallel CC=$(which mpicc) CXX=$(which mpic++) FC=$(which mpif90)

Here is the last few lines of the output:

checking for io.h... no
checking winsock2.h usability... no
checking winsock2.h presence... no
checking for winsock2.h... no
checking sys/timeb.h usability... yes
checking sys/timeb.h presence... yes
checking for sys/timeb.h... yes
checking if libtool needs -no-undefined flag to build shared libraries... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking size of int8_t... 0
checking size of uint8_t... 0
checking size of int_least8_t... 0
checking size of uint_least8_t... 0
checking size of int_fast8_t... 0
checking size of uint_fast8_t... 0
checking size of int16_t... 0
checking size of uint16_t... 0
checking size of int_least16_t... 0
checking size of uint_least16_t... 0
checking size of int_fast16_t... 0
checking size of uint_fast16_t... 0
checking size of int32_t... 0
checking size of uint32_t... 0
checking size of int_least32_t... 0
checking size of uint_least32_t... 0
checking size of int_fast32_t... 0
checking size of uint_fast32_t... 0
checking size of int64_t... 0
checking size of uint64_t... 0
checking size of int_least64_t... 0
checking size of uint_least64_t... 0
checking size of int_fast64_t... 0
checking size of uint_fast64_t... 0
checking size of size_t... configure: error: in `/mnt/central/users/samouyal/usr/test_new_ompi/hdf5-1.12.0':
configure: error: cannot compute sizeof (size_t)
See `config.log' for more details

Looking in the configure file, I see that all the macros in conftest.c are being ignored by the compiler for some reason, macros which define the sizeof multiple types, including size_t. I believe this is the cause of the error:

configure:26293: result: 0
configure:26308: checking size of size_t
configure:26313: /mnt/central/spack/opt/spack/linux-centos8-cascadelake/gcc-10.1.0/gcc-10.1.0-5egpuvj3i7kbpcexylxvqhlbtj6vfys6/bi
conftest.c:11: warning: macro "STDC_HEADERS" is not used [-Wunused-macros]
   11 | #define STDC_HEADERS 1
      |
conftest.c:20: warning: macro "HAVE_UNISTD_H" is not used [-Wunused-macros]
   20 | #define HAVE_UNISTD_H 1
      |
conftest.c:13: warning: macro "HAVE_SYS_STAT_H" is not used [-Wunused-macros]
   13 | #define HAVE_SYS_STAT_H 1
      |
conftest.c:12: warning: macro "HAVE_SYS_TYPES_H" is not used [-Wunused-macros]
   12 | #define HAVE_SYS_TYPES_H 1
      |
conftest.c:19: warning: macro "HAVE_STDINT_H" is not used [-Wunused-macros]
   19 | #define HAVE_STDINT_H 1
      |
In file included from /usr/include/sys/stat.h:446,
                 from conftest.c:90:
/mnt/central/spack/opt/spack/linux-centos8-cascadelake/gcc-10.1.0/gcc-10.1.0-5egpuvj3i7kbpcexylxvqhlbtj6vfys6/lib/gcc/x86_64-pc-l
   38 | #if __glibc_has_include ("__linux__/stat.h")
      |                         ^
conftest.c:118:17: warning: function declaration isn't a prototype [-Wstrict-prototypes]
  118 | static long int longval () { return (long int) (sizeof (size_t)); }
      |                 ^~~~~~~
conftest.c: In function 'longval':
conftest.c:118:17: warning: old-style function definition [-Wold-style-definition]
conftest.c: At top level:
conftest.c:119:26: warning: function declaration isn't a prototype [-Wstrict-prototypes]
  119 | static unsigned long int ulongval () { return (long int) (sizeof (size_t)); }
      |                          ^~~~~~~~
conftest.c: In function 'ulongval':
conftest.c:119:26: warning: old-style function definition [-Wold-style-definition]
conftest.c: At top level:
conftest.c:123:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
  123 | main ()
      | ^~~~
conftest.c: In function 'main':
conftest.c:123:1: warning: old-style function definition [-Wold-style-definition]
conftest.c: At top level:
conftest.c:30: warning: macro "SIZEOF_LONG_DOUBLE" is not used [-Wunused-macros]
   30 | #define SIZEOF_LONG_DOUBLE 16
      |
conftest.c:26: warning: macro "SIZEOF_LONG_LONG" is not used [-Wunused-macros]
   26 | #define SIZEOF_LONG_LONG 8
      |
conftest.c:62: warning: macro "SIZEOF_INT_LEAST8_T" is not used [-Wunused-macros]
   62 | #define SIZEOF_INT_LEAST8_T 0
      |
conftest.c:73: warning: macro "SIZEOF_UINT32_T" is not used [-Wunused-macros]
   73 | #define SIZEOF_UINT32_T 0
      |
conftest.c:35: warning: macro "PAC_C_MAX_REAL_PRECISION" is not used [-Wunused-macros]
   35 | #define PAC_C_MAX_REAL_PRECISION 33
      |
conftest.c:77: warning: macro "SIZEOF_UINT_FAST32_T" is not used [-Wunused-macros]
   77 | #define SIZEOF_UINT_FAST32_T 0
      |
conftest.c:74: warning: macro "SIZEOF_INT_LEAST32_T" is not used [-Wunused-macros]
   74 | #define SIZEOF_INT_LEAST32_T 0
      |
conftest.c:82: warning: macro "SIZEOF_INT_FAST64_T" is not used [-Wunused-macros]
   82 | #define SIZEOF_INT_FAST64_T 0
      |
conftest.c:5: warning: macro "PACKAGE_STRING" is not used [-Wunused-macros]
    5 | #define PACKAGE_STRING "HDF5 1.12.0"
      |
conftest.c:61: warning: macro "SIZEOF_UINT8_T" is not used [-Wunused-macros]
   61 | #define SIZEOF_UINT8_T 0
      |
conftest.c:54: warning: macro "HAVE_DIRENT_H" is not used [-Wunused-macros]
   54 | #define HAVE_DIRENT_H 1
      |
conftest.c:3: warning: macro "PACKAGE_TARNAME" is not used [-Wunused-macros]
    3 | #define PACKAGE_TARNAME "hdf5"
      |
conftest.c:33: warning: macro "HAVE_QUADMATH_H" is not used [-Wunused-macros]
   33 | #define HAVE_QUADMATH_H 1
      |
conftest.c:14: warning: macro "HAVE_STDLIB_H" is not used [-Wunused-macros]
   14 | #define HAVE_STDLIB_H 1
      |
conftest.c:48: warning: macro "HAVE_SYS_SOCKET_H" is not used [-Wunused-macros]
   48 | #define HAVE_SYS_SOCKET_H 1
      |
conftest.c:57: warning: macro "HAVE_SYS_TIMEB_H" is not used [-Wunused-macros]
   57 | #define HAVE_SYS_TIMEB_H 1
      |
conftest.c:32: warning: macro "SIZEOF__QUAD" is not used [-Wunused-macros]
   32 | #define SIZEOF__QUAD 0
      |
conftest.c:29: warning: macro "SIZEOF_DOUBLE" is not used [-Wunused-macros]
   29 | #define SIZEOF_DOUBLE 8
      |
conftest.c:46: warning: macro "HAVE_SYS_IOCTL_H" is not used [-Wunused-macros]
   46 | #define HAVE_SYS_IOCTL_H 1
      |
conftest.c:67: warning: macro "SIZEOF_UINT16_T" is not used [-Wunused-macros]
   67 | #define SIZEOF_UINT16_T 0
      |
conftest.c:6: warning: macro "PACKAGE_BUGREPORT" is not used [-Wunused-macros]
    6 | #define PACKAGE_BUGREPORT "help@hdfgroup.org"
      |
conftest.c:31: warning: macro "SIZEOF___FLOAT128" is not used [-Wunused-macros]
   31 | #define SIZEOF___FLOAT128 16
      |
conftest.c:23: warning: macro "SIZEOF_INT" is not used [-Wunused-macros]
   23 | #define SIZEOF_INT 4
      |
conftest.c:75: warning: macro "SIZEOF_UINT_LEAST32_T" is not used [-Wunused-macros]
   75 | #define SIZEOF_UINT_LEAST32_T 0
      |
conftest.c:24: warning: macro "SIZEOF_UNSIGNED" is not used [-Wunused-macros]
   24 | #define SIZEOF_UNSIGNED 4
      |
conftest.c:22: warning: macro "SIZEOF_SHORT" is not used [-Wunused-macros]
   22 | #define SIZEOF_SHORT 2
      |
conftest.c:76: warning: macro "SIZEOF_INT_FAST32_T" is not used [-Wunused-macros]
   76 | #define SIZEOF_INT_FAST32_T 0
      |
conftest.c:71: warning: macro "SIZEOF_UINT_FAST16_T" is not used [-Wunused-macros]
   71 | #define SIZEOF_UINT_FAST16_T 0
      |
conftest.c:21: warning: macro "SIZEOF_CHAR" is not used [-Wunused-macros]
   21 | #define SIZEOF_CHAR 1
      |
conftest.c:43: warning: macro "HAVE_SYS_RESOURCE_H" is not used [-Wunused-macros]
   43 | #define HAVE_SYS_RESOURCE_H 1
      |
conftest.c:68: warning: macro "SIZEOF_INT_LEAST16_T" is not used [-Wunused-macros]
   68 | #define SIZEOF_INT_LEAST16_T 0
      |
conftest.c:51: warning: macro "HAVE_STDDEF_H" is not used [-Wunused-macros]
   51 | #define HAVE_STDDEF_H 1
      |
conftest.c:36: warning: macro "INCLUDE_HL" is not used [-Wunused-macros]
   36 | #define INCLUDE_HL 1
      |
conftest.c:79: warning: macro "SIZEOF_UINT64_T" is not used [-Wunused-macros]
   79 | #define SIZEOF_UINT64_T 0
      |
conftest.c:78: warning: macro "SIZEOF_INT64_T" is not used [-Wunused-macros]
   78 | #define SIZEOF_INT64_T 0
      |
conftest.c:4: warning: macro "PACKAGE_VERSION" is not used [-Wunused-macros]
    4 | #define PACKAGE_VERSION "1.12.0"
      |
conftest.c:2: warning: macro "PACKAGE_NAME" is not used [-Wunused-macros]
    2 | #define PACKAGE_NAME "HDF5"
      |
conftest.c:44: warning: macro "HAVE_SYS_TIME_H" is not used [-Wunused-macros]
   44 | #define HAVE_SYS_TIME_H 1
      |
conftest.c:8: warning: macro "PACKAGE" is not used [-Wunused-macros]
    8 | #define PACKAGE "hdf5"
      |
conftest.c:25: warning: macro "SIZEOF_LONG" is not used [-Wunused-macros]
   25 | #define SIZEOF_LONG 8
      |
conftest.c:38: warning: macro "LT_OBJDIR" is not used [-Wunused-macros]
   38 | #define LT_OBJDIR ".libs/"
      |
conftest.c:34: warning: macro "HAVE_FLOAT128" is not used [-Wunused-macros]
   34 | #define HAVE_FLOAT128 1
      |
conftest.c:28: warning: macro "SIZEOF_FLOAT" is not used [-Wunused-macros]
   28 | #define SIZEOF_FLOAT 4
      |
conftest.c:83: warning: macro "SIZEOF_UINT_FAST64_T" is not used [-Wunused-macros]
   83 | #define SIZEOF_UINT_FAST64_T 0
      |
conftest.c:63: warning: macro "SIZEOF_UINT_LEAST8_T" is not used [-Wunused-macros]
   63 | #define SIZEOF_UINT_LEAST8_T 0
      |
conftest.c:39: warning: macro "HAVE_LIBM" is not used [-Wunused-macros]
   39 | #define HAVE_LIBM 1
      |
conftest.c:80: warning: macro "SIZEOF_INT_LEAST64_T" is not used [-Wunused-macros]
   80 | #define SIZEOF_INT_LEAST64_T 0
      |
conftest.c:69: warning: macro "SIZEOF_UINT_LEAST16_T" is not used [-Wunused-macros]
   69 | #define SIZEOF_UINT_LEAST16_T 0
      |
conftest.c:10: warning: macro "DEBUG_BUILD" is not used [-Wunused-macros]
   10 | #define DEBUG_BUILD 1
      |
conftest.c:70: warning: macro "SIZEOF_INT_FAST16_T" is not used [-Wunused-macros]
   70 | #define SIZEOF_INT_FAST16_T 0
      |
conftest.c:37: warning: macro "HAVE_DLFCN_H" is not used [-Wunused-macros]
   37 | #define HAVE_DLFCN_H 1
      |
conftest.c:56: warning: macro "HAVE_STDBOOL_H" is not used [-Wunused-macros]
   56 | #define HAVE_STDBOOL_H 1
      |
conftest.c:60: warning: macro "SIZEOF_INT8_T" is not used [-Wunused-macros]
   60 | #define SIZEOF_INT8_T 0
      |
conftest.c:53: warning: macro "HAVE_FEATURES_H" is not used [-Wunused-macros]
   53 | #define HAVE_FEATURES_H 1
      |
conftest.c:81: warning: macro "SIZEOF_UINT_LEAST64_T" is not used [-Wunused-macros]
   81 | #define SIZEOF_UINT_LEAST64_T 0
      |
conftest.c:52: warning: macro "HAVE_SETJMP_H" is not used [-Wunused-macros]
   52 | #define HAVE_SETJMP_H 1
      |
conftest.c:64: warning: macro "SIZEOF_INT_FAST8_T" is not used [-Wunused-macros]
   64 | #define SIZEOF_INT_FAST8_T 0
      |
conftest.c:50: warning: macro "HAVE_SYS_FILE_H" is not used [-Wunused-macros]
   50 | #define HAVE_SYS_FILE_H 1
      |
conftest.c:42: warning: macro "TIME_WITH_SYS_TIME" is not used [-Wunused-macros]
conftest.c:72: warning: macro "SIZEOF_INT32_T" is not used [-Wunused-macros]
   72 | #define SIZEOF_INT32_T 0
      |
conftest.c:66: warning: macro "SIZEOF_INT16_T" is not used [-Wunused-macros]
   66 | #define SIZEOF_INT16_T 0
      |
conftest.c:40: warning: macro "HAVE_LIBDL" is not used [-Wunused-macros]
   40 | #define HAVE_LIBDL 1
      |
conftest.c:27: warning: macro "SIZEOF___INT64" is not used [-Wunused-macros]
   27 | #define SIZEOF___INT64 0
      |
conftest.c:9: warning: macro "VERSION" is not used [-Wunused-macros]
    9 | #define VERSION "1.12.0"
      |
conftest.c:65: warning: macro "SIZEOF_UINT_FAST8_T" is not used [-Wunused-macros]
   65 | #define SIZEOF_UINT_FAST8_T 0
      |
conftest.c:7: warning: macro "PACKAGE_URL" is not used [-Wunused-macros]
    7 | #define PACKAGE_URL ""
      |
configure:26313: $? = 1
configure: program exited with status 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "HDF5"
| #define PACKAGE_TARNAME "hdf5"
| #define PACKAGE_VERSION "1.12.0"
| #define PACKAGE_STRING "HDF5 1.12.0"
| #define PACKAGE_BUGREPORT "help@hdfgroup.org"
| #define PACKAGE_URL ""
| #define PACKAGE "hdf5"
| #define VERSION "1.12.0"
| #define DEBUG_BUILD 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define SIZEOF_CHAR 1
| #define SIZEOF_SHORT 2
| #define SIZEOF_INT 4
| #define SIZEOF_UNSIGNED 4
| #define SIZEOF_LONG 8
| #define SIZEOF_LONG_LONG 8
| #define SIZEOF___INT64 0
| #define SIZEOF_FLOAT 4
| #define SIZEOF_DOUBLE 8
| #define SIZEOF_LONG_DOUBLE 16
| #define SIZEOF___FLOAT128 16
| #define SIZEOF__QUAD 0
| #define HAVE_QUADMATH_H 1
| #define HAVE_FLOAT128 1
| #define PAC_C_MAX_REAL_PRECISION 33
| #define INCLUDE_HL 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define HAVE_LIBM 1
| #define HAVE_LIBDL 1
| #define STDC_HEADERS 1
| #define TIME_WITH_SYS_TIME 1
| #define HAVE_SYS_RESOURCE_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_SYS_IOCTL_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_SYS_SOCKET_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_FILE_H 1
| #define HAVE_STDDEF_H 1
| #define HAVE_SETJMP_H 1
| #define HAVE_FEATURES_H 1
| #define HAVE_DIRENT_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_STDBOOL_H 1
| #define HAVE_SYS_TIMEB_H 1
| #include <sys/types.h>
| #include <stdint.h>
| #define SIZEOF_INT8_T 0
| #define SIZEOF_UINT8_T 0
| #define SIZEOF_INT_LEAST8_T 0
| #define SIZEOF_UINT_LEAST8_T 0
| #define SIZEOF_INT_FAST8_T 0
| #define SIZEOF_UINT_FAST8_T 0
| #define SIZEOF_INT16_T 0
| #define SIZEOF_UINT16_T 0
| #define SIZEOF_INT_LEAST16_T 0
| #define SIZEOF_UINT_LEAST16_T 0
| #define SIZEOF_INT_FAST16_T 0
| #define SIZEOF_UINT_FAST16_T 0
| #define SIZEOF_INT32_T 0
| #define SIZEOF_UINT32_T 0
| #define SIZEOF_INT_LEAST32_T 0
| #define SIZEOF_UINT_LEAST32_T 0
| #define SIZEOF_INT_FAST32_T 0
| #define SIZEOF_UINT_FAST32_T 0
| #define SIZEOF_INT64_T 0
| #define SIZEOF_UINT64_T 0
| #define SIZEOF_INT_LEAST64_T 0
| #define SIZEOF_UINT_LEAST64_T 0
| #define SIZEOF_INT_FAST64_T 0
| #define SIZEOF_UINT_FAST64_T 0
| /* end confdefs.h.  */
| #include <stdio.h>
| #ifdef HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #ifdef HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #ifdef STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # ifdef HAVE_STDLIB_H
| #  include <stdlib.h>
| # endif
| #endif
| #ifdef HAVE_STRING_H
| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
| #  include <memory.h>
| # endif
| # include <string.h>
| #endif
| #ifdef HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #ifdef HAVE_INTTYPES_H
| # include <inttypes.h>
| #endif
| #ifdef HAVE_STDINT_H
| # include <stdint.h>
| #endif
| #ifdef HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| static long int longval () { return (long int) (sizeof (size_t)); }
| static unsigned long int ulongval () { return (long int) (sizeof (size_t)); }
| #include <stdio.h>
| #include <stdlib.h>
| int
| main ()
| {
|
|   FILE *f = fopen ("conftest.val", "w");
|   if (! f)
|     return 1;
|   if (((long int) (sizeof (size_t))) < 0)
|     {
|       long int i = longval ();
|       if (i != ((long int) (sizeof (size_t))))
|   return 1;
|       fprintf (f, "%ld", i);
|     }
|   else
|     {
|       unsigned long int i = ulongval ();
|       if (i != ((long int) (sizeof (size_t))))
|   return 1;
|       fprintf (f, "%lu", i);
|     }
|   /* Do not output a trailing newline, as this causes \r\n confusion
|      on some platforms.  */
|   return ferror (f) || fclose (f) != 0;
|
|   ;
|   return 0;
| }
configure:26317: error: in `/mnt/central/users/samouyal/usr/test_new_ompi/hdf5-1.12.0':
configure:26319: error: cannot compute sizeof (size_t)
See `config.log' for more details

I appreciate the help. Thanks,

Solal Amouyal