Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: configure fails on Sonoma: HDF5 C types failed check #46

Closed
barracuda156 opened this issue Oct 18, 2023 · 10 comments
Closed

[Bug]: configure fails on Sonoma: HDF5 C types failed check #46

barracuda156 opened this issue Oct 18, 2023 · 10 comments
Labels
bug Something isn't working

Comments

@barracuda156
Copy link

What happened?

Configure fails on Sonoma. Ventura (also on aarch64) seems to be fine: https://build.macports.org/builders/ports-13_arm64-builder/builds/38986/steps/install-port/logs/stdio

Relevant log output

--->  Configuring h5fortran
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_fortran_h5fortran/h5fortran/work/build" && /opt/local/bin/cmake -G "CodeBlocks - Unix Makefiles" -DCMAKE_BUILD_TYPE=MacPorts -DCMAKE_INSTALL_PREFIX="/opt/local" -DCMAKE_INSTALL_NAME_DIR="/opt/local/lib" -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr" -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_OBJC_COMPILER="$CC" -DCMAKE_OBJCXX_COMPILER="$CXX" -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_POLICY_DEFAULT_CMP0060=NEW -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DCMAKE_MODULE_PATH="/opt/local/share/cmake/Modules" -DCMAKE_PREFIX_PATH="/opt/local/share/cmake/Modules" -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON -DCMAKE_INSTALL_RPATH="/opt/local/lib" -Wno-dev -DBUILD_SHARED_LIBS=ON -Dh5fortran_BUILD_TESTING=ON -DHDF5_HAVE_PARALLEL=OFF -DPYTHON_EXECUTABLE=/opt/local/bin/python3.11 -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="14.0" -DCMAKE_OSX_SYSROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk" /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_fortran_h5fortran/h5fortran/work/h5fortran-4.10.3 
-- The C compiler identification is AppleClang 15.0.0.15000040
-- The Fortran compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether Fortran compiler has -isysroot
-- Checking whether Fortran compiler has -isysroot - yes
-- Checking whether Fortran compiler supports OSX deployment target flag
-- Checking whether Fortran compiler supports OSX deployment target flag - yes
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /opt/local/bin/gfortran-mp-13 - skipped
-- h5fortran 4.10.3 CMake 3.28.0-rc1 Toolchain 
-- checking that compilers can link together
-- checking that compilers can link together - OK
-- Performing Test HAVE_IEEE_ARITH
-- Performing Test HAVE_IEEE_ARITH - Success
-- Looking for H5_HAVE_FILTER_SZIP
-- Looking for H5_HAVE_FILTER_SZIP - found
-- Looking for H5_HAVE_FILTER_DEFLATE
-- Looking for H5_HAVE_FILTER_DEFLATE - found
-- Found ZLIB: /opt/local/lib/libz.dylib (found version "1.3")  
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Performing Test HDF5_C_links
-- Performing Test HDF5_C_links - Success
-- Performing Test HDF5_Fortran_links
-- Performing Test HDF5_Fortran_links - Success
-- Found HDF5: /opt/local/lib/libhdf5_hl.dylib;/opt/local/lib/libhdf5.dylib (found version "1.14.2") found components: Fortran 
-- Performing Test hdf5_c_types
-- Performing Test hdf5_c_types - Failed
CMake Error at cmake/CheckHDF5.cmake:42 (message):
  HDF5 C types failed check
Call Stack (most recent call first):
  cmake/CheckHDF5.cmake:96 (check_hdf5_c)
  CMakeLists.txt:49 (check_hdf5)


-- Configuring incomplete, errors occurred!
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_fortran_h5fortran/h5fortran/work/build" && /opt/local/bin/cmake -G "CodeBlocks - Unix Makefiles" -DCMAKE_BUILD_TYPE=MacPorts -DCMAKE_INSTALL_PREFIX="/opt/local" -DCMAKE_INSTALL_NAME_DIR="/opt/local/lib" -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr" -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_OBJC_COMPILER="$CC" -DCMAKE_OBJCXX_COMPILER="$CXX" -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_POLICY_DEFAULT_CMP0060=NEW -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DCMAKE_MODULE_PATH="/opt/local/share/cmake/Modules" -DCMAKE_PREFIX_PATH="/opt/local/share/cmake/Modules" -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON -DCMAKE_INSTALL_RPATH="/opt/local/lib" -Wno-dev -DBUILD_SHARED_LIBS=ON -Dh5fortran_BUILD_TESTING=ON -DHDF5_HAVE_PARALLEL=OFF -DPYTHON_EXECUTABLE=/opt/local/bin/python3.11 -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="14.0" -DCMAKE_OSX_SYSROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk" /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_fortran_h5fortran/h5fortran/work/h5fortran-4.10.3 
Exit code: 1
@barracuda156 barracuda156 added the bug Something isn't working label Oct 18, 2023
@barracuda156
Copy link
Author

Also fails with LLVM clang-15:

-- The C compiler identification is Clang 15.0.7
-- The Fortran compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/local/bin/clang-mp-15 - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether Fortran compiler has -isysroot
-- Checking whether Fortran compiler has -isysroot - yes
-- Checking whether Fortran compiler supports OSX deployment target flag
-- Checking whether Fortran compiler supports OSX deployment target flag - yes
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /opt/local/bin/gfortran-mp-13 - skipped
-- h5fortran 4.10.3 CMake 3.28.0-rc1 Toolchain 
-- checking that compilers can link together
-- checking that compilers can link together - OK
-- Performing Test HAVE_IEEE_ARITH
-- Performing Test HAVE_IEEE_ARITH - Success
-- Looking for H5_HAVE_FILTER_SZIP
-- Looking for H5_HAVE_FILTER_SZIP - found
-- Looking for H5_HAVE_FILTER_DEFLATE
-- Looking for H5_HAVE_FILTER_DEFLATE - found
-- Found ZLIB: /opt/local/lib/libz.dylib (found version "1.3")  
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Performing Test HDF5_C_links
-- Performing Test HDF5_C_links - Success
-- Performing Test HDF5_Fortran_links
-- Performing Test HDF5_Fortran_links - Success
-- Found HDF5: /opt/local/lib/libhdf5_hl.dylib;/opt/local/lib/libhdf5.dylib (found version "1.14.2") found components: Fortran 
-- Performing Test hdf5_c_types
-- Performing Test hdf5_c_types - Failed
CMake Error at cmake/CheckHDF5.cmake:42 (message):
  HDF5 C types failed check
Call Stack (most recent call first):
  cmake/CheckHDF5.cmake:96 (check_hdf5_c)
  CMakeLists.txt:49 (check_hdf5)

@scivision
Copy link
Member

scivision commented Oct 23, 2023

I wonder if this is a Macports packaging issue with the new Xcode 15 linker. I use similar AppleClang and Gfortran versions with Homebrew and don't have any issue.

I tried with CMake 3.27.7 and CMake 3.28.0-rc2

 cmake -Bbuild
-- The C compiler identification is AppleClang 15.0.0.15000040
-- The Fortran compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether Fortran compiler has -isysroot
-- Checking whether Fortran compiler has -isysroot - yes
-- Checking whether Fortran compiler supports OSX deployment target flag
-- Checking whether Fortran compiler supports OSX deployment target flag - yes
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /opt/homebrew/bin/gfortran - skipped
-- h5fortran 4.10.3 CMake 3.27.7 Toolchain 
-- Performing Test HAVE_IEEE_ARITH
-- Performing Test HAVE_IEEE_ARITH - Success
-- Looking for H5_HAVE_FILTER_SZIP
-- Looking for H5_HAVE_FILTER_SZIP - found
-- Looking for H5_HAVE_FILTER_DEFLATE
-- Looking for H5_HAVE_FILTER_DEFLATE - found
-- Looking for H5_HAVE_PARALLEL
-- Looking for H5_HAVE_PARALLEL - not found
-- Found ZLIB: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/lib/libz.tbd (found version "1.2.12")  
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Performing Test HDF5_C_links
-- Performing Test HDF5_C_links - Success
-- Performing Test HDF5_Fortran_links
-- Performing Test HDF5_Fortran_links - Success
-- Found HDF5: /opt/homebrew/Cellar/hdf5/1.14.2/lib/libhdf5_hl.dylib;/opt/homebrew/Cellar/hdf5/1.14.2/lib/libhdf5.dylib (found version "1.14.2") found components: Fortran 

@scivision
Copy link
Member

scivision commented Oct 23, 2023

If you look at ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeConfigureLog.yaml near the bottom you will probably see errors about unknown linker flags. If that is the case, a generic workaround currently needed by many project since Xcode 15 is:

export LDFLAGS="$LDFLAGS -Wl,-ld_classic"

You need a fresh build directory as LDFLAGS is only considered by CMake on the first project configure.

@tsiayigong
Copy link

Hi! When I try to build it on Ubuntu 20.04 via GNU GCC 13.2.0, I got a same error. Is there a solution? My cmake version is 3.27.7 and hdf5 version is 1.12.2.

cmake -B build -DCMAKE_PREFIX_PATH=/public/mathlib/hdf5/gcc/1.12.2 -DCMAKE_INSTALL_PREFIX=$HOME/test/111
-- The C compiler identification is GNU 13.2.0
-- The Fortran compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /public/compiler/gcc/13.2.0/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /public/compiler/gcc/13.2.0/bin/gfortran - skipped
-- h5fortran 4.10.4 CMake 3.27.7 Toolchain 
-- Performing Test HAVE_IEEE_ARITH
-- Performing Test HAVE_IEEE_ARITH - Success
-- Looking for H5_HAVE_FILTER_SZIP
-- Looking for H5_HAVE_FILTER_SZIP - not found
-- Looking for H5_HAVE_FILTER_DEFLATE
-- Looking for H5_HAVE_FILTER_DEFLATE - found
-- Looking for H5_HAVE_PARALLEL
-- Looking for H5_HAVE_PARALLEL - not found
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.3")  
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Performing Test HDF5_C_links
-- Performing Test HDF5_C_links - Success
-- Performing Test HDF5_Fortran_links
-- Performing Test HDF5_Fortran_links - Success
-- Found HDF5: /public/mathlib/hdf5/gcc/1.12.2/lib/libhdf5_hl.so;/public/mathlib/hdf5/gcc/1.12.2/lib/libhdf5.so (found version "1.12.2") found components: Fortran 
-- Performing Test hdf5_c_types
-- Performing Test hdf5_c_types - Failed
CMake Error at cmake/CheckHDF5.cmake:42 (message):
  HDF5 C types failed check
Call Stack (most recent call first):
  cmake/CheckHDF5.cmake:96 (check_hdf5_c)
  CMakeLists.txt:43 (check_hdf5)


-- Configuring incomplete, errors occurred!

@barracuda156
Copy link
Author

@scivision Thank you, I will check the linker issue. It might be the case, since we had it with some other ports.
However, given that Ubuntu is affected, according to the comment above, the problem may be elsewhere.

@barracuda156
Copy link
Author

The error only happens on Sonoma by the way: https://ports.macports.org/port/h5fortran/details
Everything else builds fine (well, 10.6–10.7 x86 are broken on buildbots with Clangs, but everything 10.8+ builds – up to Ventura).

@barracuda156
Copy link
Author

4.10.4 still fails.

@tsiayigong
Copy link

In my attempt 4.10.3 can be complie with gfortran 13.2.0, however 4.10.4 can not.

@barracuda156
Copy link
Author

barracuda156 commented Oct 28, 2023

In my attempt 4.10.3 can be complie with gfortran 13.2.0, however 4.10.4 can not.

What error did you get? It worked for me with gcc13 (on 10.6).

@Dave-Allured
Copy link

The original issue is now RESOLVED for 4.10.4 on Macports.
https://trac.macports.org/ticket/68499

  • The original error message "Performing Test hdf5_c_types - Failed" is not accurate.
  • The actual error was a configuration test failure under the hood, not related to type checking.
  • The Cmake configuration log revealed the actual error from hdf5_c_types:
ld: duplicate LC_RPATH '/opt/local/lib/libgcc' in '/opt/local/lib/libhdf5_fortran.310.dylib'
clang: error: linker command failed with exit code 1
  • This was due to Macports update to Xcode 15 / Clang 15 on Sonoma.
  • Xcode 15 includes a new linker with a new strict rule against duplicate LC_RPATH in dynamic libraries.
  • The Macports HDF5 fortran libraries were previously built with duplicate LC_RPATH's, due to old habits. That is a long story. Therefore, the error after the Xcode 15 update.
  • As of 2023 December 28, Macports HDF5 fortran libraries are now rebuilt with duplicate LC_RPATHS eliminated. Problem solved.

I predict that this problem can also happen on Ventura when updated to Xcode 15, and older HDF5 fortran library builds.

If you are satisfied, please close this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants