error in compiling


#1

Hi, an error occurs when I am compling HdF5-1.10.8
My system is:
Linux version 4.18.0-80.el8.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 8.2.1 20180905 (Red Hat 8.2.1-3) (GCC)) #1 SMP Tue Jun 4 09:19:46 UTC 2019
I am sorry as a newer I can’t upload the config.log.

Now the config.log is uploaded:
config.log (67.2 KB)

The error information are copy as following:

checking for a BSD-compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking for a thread-safe mkdir -p… /usr/bin/mkdir -p
checking for gawk… gawk
checking whether make sets $(MAKE)… yes
checking whether make supports nested variables… yes
checking whether make supports nested variables… (cached) yes
checking whether to enable maintainer-specific portions of Makefiles… no
checking build system type… x86_64-unknown-linux-gnu
checking host system type… x86_64-unknown-linux-gnu
checking shell variables initial values… done
checking if basename works… yes
checking if xargs works… yes
checking for cached host… none
checking for config x86_64-unknown-linux-gnu… no
checking for config x86_64-unknown-linux-gnu… no
checking for config unknown-linux-gnu… no
checking for config unknown-linux-gnu… no
checking for config x86_64-linux-gnu… no
checking for config x86_64-linux-gnu… no
checking for config x86_64-unknown… no
checking for config linux-gnu… found
compiler ‘gcc’ is GNU gcc-8.2.1
compiler ‘gfortran’ is GNU gfortran-8.2.1
compiler ‘g++’ is GNU g+±8.2.1
checking for config ./config/site-specific/host-node01… no
checking for clang sanitizer checks… checking build mode… production
checking for gcc… gcc
checking whether the C compiler works… yes
checking for C compiler default output file name… a.out
checking for suffix of executables…
checking whether we are cross compiling… no
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether gcc accepts -g… yes
checking for gcc option to accept ISO C89… none needed
checking whether gcc understands -c and -o together… yes
checking for style of include used by make… GNU
checking dependency style of gcc… gcc3
checking if unsupported combinations of configure options are allowed… no
checking how to run the C preprocessor… gcc -E
checking for grep that handles long lines and -e… /usr/bin/grep
checking for egrep… /usr/bin/grep -E
checking for ANSI C header files… yes
checking for sys/types.h… yes
checking for sys/stat.h… yes
checking for stdlib.h… yes
checking for string.h… yes
checking for memory.h… yes
checking for strings.h… yes
checking for inttypes.h… yes
checking for stdint.h… yes
checking for unistd.h… yes
checking for off_t… yes
checking for size_t… yes
checking for ssize_t… yes
checking for ptrdiff_t… yes
checking whether byte ordering is bigendian… no
checking size of char… 1
checking size of short… 2
checking size of int… 4
checking size of unsigned… 4
checking size of long… 8
checking size of long long… 8
checking size of __int64… 0
checking size of float… 4
checking size of double… 8
checking size of long double… 16
checking size of __float128… 16
checking size of _Quad… 0
checking quadmath.h usability… yes
checking quadmath.h presence… yes
checking for quadmath.h… yes
checking maximum decimal precision for C… configure: error: C program fails to build or run!


#2

We probably don’t need the whole config.log, but can you send us the section of config.log around the error checking maximum decimal precision for C… configure: error: C program fails to build or run!? As the error message says, it’s trying to compile and run a test program, and that fails. config.log should tell us whether it’s the build or the execution that’s the problem, and some clues as to why. You can also gzip the config.log and send me an email.

G.


#3

1.10.8 I think still used the file output for some checks - this has been eliminated since then. Might be a permission or access error for writing that file. Any chance you could use the latest 1.10.9 release?


#4

Thanks for your reply. Now the config.log is uploaded.


#5

Thanks. I will try as your suggestion.


#6

I have tried 1.10.9, and the same error occurs as well.


#7

The error appears to be around line 1856:

configure:6641: gcc -o conftest       conftest.c  >&5
conftest.c: In function 'main':
conftest.c:52:36: error: 'DECIMAL_DIG' undeclared (first use in this function)
                 #define C_LDBL_DIG DECIMAL_DIG
                                    ^~~~~~~~~~~
conftest.c:63:46: note: in expansion of macro 'C_LDBL_DIG'
                   fprintf(pFile, "%d\n%d\n", C_LDBL_DIG, C_FLT128_DIG);
                                              ^~~~~~~~~~
conftest.c:52:36: note: each undeclared identifier is reported only once for each function it appears in
                 #define C_LDBL_DIG DECIMAL_DIG
                                    ^~~~~~~~~~~
conftest.c:63:46: note: in expansion of macro 'C_LDBL_DIG'
                   fprintf(pFile, "%d\n%d\n", C_LDBL_DIG, C_FLT128_DIG);
                                              ^~~~~~~~~~
configure:6641: $? = 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.10.8"
| #define PACKAGE_STRING "HDF5 1.10.8"
| #define PACKAGE_BUGREPORT "help@hdfgroup.org"
| #define PACKAGE_URL ""
| #define PACKAGE "hdf5"
| #define VERSION "1.10.8"
| #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
| /* end confdefs.h.  */
| 
| 
|                 #include <float.h>
|                 #include <stdio.h>
|                 #define CHECK_FLOAT128 16
|                 #if CHECK_FLOAT128!=0
|                 # if 1!=0
|                 #include <quadmath.h>
|                 # endif
|                 # ifdef FLT128_DIG
|                 #define C_FLT128_DIG FLT128_DIG
|                 # else
|                 #define C_FLT128_DIG 0
|                 # endif
|                 #else
|                 #define C_FLT128_DIG 0
|                 #endif
|                 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|                 #define C_LDBL_DIG DECIMAL_DIG
|                 #else
|                 #define C_LDBL_DIG LDBL_DIG
|                 #endif
| 
| int
| main ()
| {
| 
|                   FILE * pFile;
|                   pFile = fopen("pac_Cconftest.out","w");
|                   fprintf(pFile, "%d\n%d\n", C_LDBL_DIG, C_FLT128_DIG);
| 
|   ;
|   return 0;
| }
| 
configure:6653: error: C program fails to build or run!

It can’t find the DECIMAL_DIG macro. This could be an issue with your compiler installation. Can you try a different compiler? GCC 8.2.1 is not ancient, but not exactly current either…

G.


#8

Thanks a lot. But I am on a cluster, and I am not the root user. Thus, can I compile a new gcc compiler successfully? Or can I try an older version of HDF5?


#9

I have tried the old version of HDF5 1.10.4, however it dosen’t work. Maybe a newest GCC can solve the problem?


#10

I looked at the config.log and noticed a lot of “missing” autoconf/automake/* messages - maybe that’s not properly installed?
Also have you thought of using CMake?