Make hdf5-1.14.0 on Debian: conflicting types for ‘ssize_t’

I have tried building HDF5 from source, on a virtual machine Linux #1 SMP Debian 5.10.140-1 (2022-09-02). I followed the basic instructions:

         gunzip < hdf5-1.14.0.tar.gz | tar xf -
         cd hdf5-1.14.0
         ./configure --prefix=/usr/local/hdf5 
         make
         make check                # run test suite.
         make install
         make check-install        # verify installation

The configure step runs successfully (after removing the unwanted newline characters \r in the files which caused errors, as explained in 1) but the make command returns the following errors:

Making all in src
make[1]: entrata nella directory «/home/myname/hdf5-1.14.0/src»
make  all-am
make[2]: entrata nella directory «/home/myname/hdf5-1.14.0/src»
  CC       H5.lo
In file included from H5private.h:36,
                 from H5.c:21:
/usr/include/stdio.h:77:19: error: conflicting types for ‘ssize_t’
   77 | typedef __ssize_t ssize_t;
      |                   ^~~~~~~
In file included from H5private.h:26,
                 from H5.c:21:
H5public.h:273:13: note: previous declaration of ‘ssize_t’ was here
  273 | typedef int ssize_t;
      |             ^~~~~~~
In file included from H5.c:21:
H5private.h:438: warning: "LOCK_SH" redefined
  438 | #define LOCK_SH 0x01
      | 
In file included from /usr/include/x86_64-linux-gnu/bits/fcntl.h:61,
                 from /usr/include/fcntl.h:35,
                 from H5private.h:31,
                 from H5.c:21:
/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h:237: note: this is the location of the previous definition
  237 | # define LOCK_SH 1 /* Shared lock.  */
      | 
In file included from H5.c:21:
H5private.h:439: warning: "LOCK_EX" redefined
  439 | #define LOCK_EX 0x02
      | 
In file included from /usr/include/x86_64-linux-gnu/bits/fcntl.h:61,
                 from /usr/include/fcntl.h:35,
                 from H5private.h:31,
                 from H5.c:21:
/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h:238: note: this is the location of the previous definition
  238 | # define LOCK_EX 2 /* Exclusive lock.  */
      | 
In file included from H5.c:21:
H5private.h:440: warning: "LOCK_NB" redefined
  440 | #define LOCK_NB 0x04
      | 
In file included from /usr/include/x86_64-linux-gnu/bits/fcntl.h:61,
                 from /usr/include/fcntl.h:35,
                 from H5private.h:31,
                 from H5.c:21:
/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h:239: note: this is the location of the previous definition
  239 | # define LOCK_NB 4 /* Or'd with one of the above to prevent
      | 
In file included from H5.c:21:
H5private.h:441: warning: "LOCK_UN" redefined
  441 | #define LOCK_UN 0x08
      | 
In file included from /usr/include/x86_64-linux-gnu/bits/fcntl.h:61,
                 from /usr/include/fcntl.h:35,
                 from H5private.h:31,
                 from H5.c:21:
/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h:241: note: this is the location of the previous definition
  241 | # define LOCK_UN 8 /* Remove lock.  */
      | 
make[2]: *** [Makefile:1737: H5.lo] Errore 1
make[2]: uscita dalla directory «/home/myname/hdf5-1.14.0/src»
make[1]: *** [Makefile:1201: all] Errore 2
make[1]: uscita dalla directory «/home/myname/hdf5-1.14.0/src»
make: *** [Makefile:729: all-recursive] Errore 1

Upvotes: 0

Views: 254

Answers (1)

Dana Robinson
Dana Robinson

Reputation: 4364

HDF5 defines several POSIX things for platforms like Windows, including ssize_t. If it is getting re-defined on Linux, it's probably because the header is being mis-parsed.

Why are you getting Windows line endings on Linux? Where are you getting the source tarball?

Upvotes: 1

Related Questions