Configuring HDF-5 1.14.4-2 @ macOS 14.4.1 with Apple M2

I need help please. I’m trying to install parallel HDF-5 onto my Mac. I’m using OpenMPI with GNU compiler toolchain (v.12.3.0). Here are configuration options that I use:

--prefix=/opt/hdf5-1.14.4-2 --enable-shared --enable-parallel --enable-fortran --with-zlib --with-szlib=/opt/local/include,/opt/local/lib

However, configure crashes with the following error:

error: cannot compute sizeof (off_t)

I would be grateful for any hints on how to overcome this error.

cannot compute sizeof (off_t) probably means that a configure test is failing in an unexpected way, completely unrelated to type sizes. My recent experience with this error (NOT on HDF5) turned out to be a defect in the way a dependency library was constructed for Mac. The broken library caused hidden failures when detecting earlier characteristics. The failures were not noticeable until the type size tests were run. Broken library is not the only thing that could cause this kind of failure.

Please post the entire console log and config.log as attachments, for further analysis.

Please find console log and config.log file attached:
c.txt (13.4 KB)
config.log (325.2 KB)

config.log shows the actual error that causes the sizeof (off_t) test to fail.

configure:29448: checking size of int8_t
configure:29454: /opt/local/bin/mpicc -o conftest  -std=c99  -Wall -Wcast-qual -Wconversion -Wextra -Wfloat-equal -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-include-dirs -Wshadow -Wundef -Wwrite-strings -pedantic -Wno-c++-compat -Wlarger-than=2560 -Wlogical-op -Wframe-larger-than=16384 -Wpacked-bitfield-compat -Wsync-nand -Wno-unsuffixed-float-constants -Wdouble-promotion -Wtrampolines -Wstack-usage=8192 -Wmaybe-uninitialized -Wdate-time -Warray-bounds=2 -Wc99-c11-compat -Wduplicated-cond -Whsa -Wnormalized -Wnull-dereference -Wunused-const-variable -Walloca -Walloc-zero -Wduplicated-branches -Wformat-overflow=2 -Wformat-truncation=1 -Wattribute-alias -Wshift-overflow=2 -Wattribute-alias=2 -Wmissing-profile -Wc11-c2x-compat -fstdarg-opt   -m64        conftest.c -ldl -lm  >&5
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/_stdio.h:68,
                 from /opt/local/lib/gcc12/gcc/arm64-apple-darwin23/12.3.0/include-fixed/stdio.h:78,
                 from conftest.c:88:
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:30: error: missing ')' after "__has_attribute"
  554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)
      |                              ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:31: error:  ':' without preceding '?'
  554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)
      |                               ^

This is some kind of problem between the selected C compiler, and a system library from Apple XCode. I do not recognize this particular problem.

It appears that you are using MPI and the MPI compiler wrappers from MacPorts. MacPorts has a rule about your $PATH to prevent mixing of compiler tools with MacPorts versions. See documentation about MacPorts and the Shell.

I can not tell for sure what is going on. However, here is something to try, a fairly easy experiment.

  1. In your $PATH, put the three /opt/local addresses in front of /usr/local/bin, not behind as is now shown in config.log.

  2. Reinstall the MPI port. port uninstall, then port install. I think this will regenerate compiler wrappers such as mpicc.

  3. Retry HDF5 configure.

There are other recent reports of the same problem.
MacPorts #69632
Apple Developer #747762