homebrew-core icon indicating copy to clipboard operation
homebrew-core copied to clipboard

hdf5 hdf5-mpi 1.14.4.3

Open chenrui333 opened this issue 1 year ago • 7 comments

  • [x] Have you followed the guidelines for contributing?
  • [x] Have you ensured that your commits follow the commit style guide?
  • [x] Have you checked that there aren't other open pull requests for the same formula update/change?
  • [x] Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • [x] Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • [ ] Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

chenrui333 avatar May 06 '24 18:05 chenrui333

  /bin/sh ../libtool  --tag=CC   --mode=link mpicc -std=c99  -Wall -Warray-bounds -Wcast-qual -Wconversion -Wdouble-promotion -Wextra -Wformat=2 -Wframe-larger-than=16384 -Wimplicit-fallthrough -Wnull-dereference -Wunused-const-variable -Wwrite-strings -Wpedantic -Wvolatile-register-var -Wno-c++-compat     -Wbad-function-cast -Wimplicit-function-declaration -Wincompatible-pointer-types -Wmissing-declarations -Wpacked -Wshadow -Wswitch -Wno-error=incompatible-pointer-types-discards-qualifiers -Wunused-function -Wunused-variable -Wunused-parameter -Wcast-align -Wformat -Wno-missing-noreturn -O3  -L/usr/local/opt/libaec/lib   -o chunk_info chunk_info.o libh5test.la ../src/libhdf5.la -lsz -lz -ldl -lm 
  Undefined symbols for architecture x86_64:
    "___truncxfhf2", referenced from:
        _test_conv_flt_1 in dt_arith.o
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)

chenrui333 avatar May 06 '24 19:05 chenrui333

  /bin/sh ../libtool  --tag=CC   --mode=link mpicc -std=c99  -Wall -Warray-bounds -Wcast-qual -Wconversion -Wdouble-promotion -Wextra -Wformat=2 -Wframe-larger-than=16384 -Wimplicit-fallthrough -Wnull-dereference -Wunused-const-variable -Wwrite-strings -Wpedantic -Wvolatile-register-var -Wno-c++-compat     -Wbad-function-cast -Wimplicit-function-declaration -Wincompatible-pointer-types -Wmissing-declarations -Wpacked -Wshadow -Wswitch -Wno-error=incompatible-pointer-types-discards-qualifiers -Wunused-function -Wunused-variable -Wunused-parameter -Wcast-align -Wformat -Wno-missing-noreturn -O3  -L/usr/local/opt/libaec/lib   -o chunk_info chunk_info.o libh5test.la ../src/libhdf5.la -lsz -lz -ldl -lm 
  Undefined symbols for architecture x86_64:
    "___truncxfhf2", referenced from:
        _test_conv_flt_1 in dt_arith.o
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)

exact issue described in https://github.com/HDFGroup/hdf5/issues/4208

chenrui333 avatar May 06 '24 22:05 chenrui333

I could extract this from the vtk logs:

ld: library 'hdf5_hl-shared' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libvtkexodusII-9.3.9.3.dylib] Error 1
make[1]: *** [ThirdParty/exodusII/vtkexodusII/CMakeFiles/exodusII.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

Looks related to https://gitlab.kitware.com/vtk/vtk/-/issues/17878, I'll notify upstream about this

iMichka avatar Aug 18 '24 14:08 iMichka

Since vtk builds with current hdf5 (e.g. #181564), seems to be from change in 1.14.4

cho-m avatar Aug 18 '24 16:08 cho-m

Rebased for #179129

iMichka avatar Aug 20 '24 21:08 iMichka

I have a fix for netcdf-cxx: #181937

iMichka avatar Aug 22 '24 21:08 iMichka

Fix for netcdf-fortran: #182440

iMichka avatar Aug 25 '24 13:08 iMichka

Are we going to have to rebase for the Sequoia bottles? If so, maybe after Linux finishes and hopefully can get cached (and hopefully "no conflicts" label prevents merging new Sequoia bottles otherwise will end up having trouble merging during mass bottling).

cho-m avatar Sep 10 '24 15:09 cho-m

hopefully can get cached

cache is unlikely as lots of formulae are changing.

I suggest just merging master into here in the case of conflicts (and dropping any bottle changes from master in the merge). Merge is preferable to rebase so we don't destroy commit status information.

carlocab avatar Sep 10 '24 15:09 carlocab

Dep tests were skipped so need to run that with https://github.com/Homebrew/homebrew-core/labels/CI-no-fail-fast-deps

octave failure on Linux (EDIT: maybe parallelization?):

  c32_apply_type_test.c:19:10: fatal error: config.h: No such file or directory
     19 | #include <config.h>
        |          ^~~~~~~~~~

vtk failure on 12-x86_64 may be slow runner:

  ==> /usr/local/Cellar/vtk/9.3.1_2/bin/vtkpython Distance2BetweenPoints.py
  Killing child processes...
  Error: vtk: failed
  Error: vtk: failed
  An exception occurred within a child process:
    Timeout::Error: execution expired

cho-m avatar Sep 10 '24 18:09 cho-m

We can wait a little bit until the Sequoia bottling slows down. It's never the best period to ship big updates like this one. This leaves me a little bit of time to investigate the octave failure.

iMichka avatar Sep 11 '24 22:09 iMichka

Can probably continue this. Only the qt dependents aren't bottled, which are unlikely to be for some time as qt needs upstream fix (rewrite for ScreenCaptureKit).

cho-m avatar Sep 14 '24 13:09 cho-m

Here is the octave error:

libtool: compile:  gcc-11 -DHAVE_CONFIG_H -I. -I.. -fvisibility=hidden -Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits -Wno-unsuffixed-float-constants -g -O2 -c c32_apply_type_test.c  -fPIC -DPIC -o .libs/libgnu_la-c32_apply_type_test.o
  config.status: creating config.h
  libtool: compile:  gcc-11 -DHAVE_CONFIG_H -I. -I.. -fvisibility=hidden -Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits -Wno-unsuffixed-float-constants -g -O2 -c c32_get_type_test.c  -fPIC -DPIC -o .libs/libgnu_la-c32_get_type_test.o
  /bin/bash ../libtool  --tag=CC   --mode=compile gcc-11 -DHAVE_CONFIG_H -I. -I..    -fvisibility=hidden -Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits -Wno-unsuffixed-float-constants -g -O2 -c -o libgnu_la-c32isalpha.lo `test -f 'c32isalpha.c' || echo './'`c32isalpha.c
  c32_apply_type_test.c:19:10: fatal error: config.h: No such file or directory
     19 | #include <config.h>
        |          ^~~~~~~~~~
  compilation terminated.
  make[3]: *** [Makefile:4312: libgnu_la-c32_apply_type_test.lo] Error 1
  make[3]: *** Waiting for unfinished jobs....
  libtool: compile:  gcc-11 -DHAVE_CONFIG_H -I. -I.. -fvisibility=hidden -Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits -Wno-unsuffixed-float-constants -g -O2 -c c32isalnum.c  -fPIC -DPIC -o .libs/libgnu_la-c32isalnum.o
  /bin/bash ./build-aux/mk-octave-config-h.sh config.h > octave-config.h-t && \
      if [ -s octave-config.h-t ]; then /bin/bash ./build-aux/move-if-change octave-config.h-t octave-config.h; else echo "octave-config.h-t is empty!" 1>&2; rm -f octave-config.h-t; exit 1; fi
  libtool: compile:  gcc-11 -DHAVE_CONFIG_H -I. -I.. -fvisibility=hidden -Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits -Wno-unsuffixed-float-constants -g -O2 -c c32isalpha.c  -fPIC -DPIC -o .libs/libgnu_la-c32isalpha.o
  make[3]: Leaving directory '/tmp/octave-20240910-418209-7ja7ph/octave-9.2.0/libgnu'
  make[2]: *** [Makefile:6280: all-recursive] Error 1
  make[2]: Leaving directory '/tmp/octave-20240910-418209-7ja7ph/octave-9.2.0/libgnu'
  make[1]: *** [Makefile:3659: all] Error 2
  make[1]: Leaving directory '/tmp/octave-20240910-418209-7ja7ph/octave-9.2.0/libgnu'
  make: *** [Makefile:31380: libgnu/libgnu.la] Error 2

iMichka avatar Sep 14 '24 14:09 iMichka

Isn't config.h usually generated during ./configure? Not sure how that would end up missing. Should have been found with -I. -I..

Probably will need to either repro or see if anything else in logs.


EDIT: Does show as generated in logs. Though the specific config.h may be created during make so could be parallelization issue.

  libtool: compile:  gcc-11 -DHAVE_CONFIG_H -I. -I.. -fvisibility=hidden -Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits -Wno-unsuffixed-float-constants -g -O2 -c c32_apply_type_test.c  -fPIC -DPIC -o .libs/libgnu_la-c32_apply_type_test.o
  config.status: creating config.h
  libtool: compile:  gcc-11 -DHAVE_CONFIG_H -I. -I.. -fvisibility=hidden -Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits -Wno-unsuffixed-float-constants -g -O2 -c c32_get_type_test.c  -fPIC -DPIC -o .libs/libgnu_la-c32_get_type_test.o

cho-m avatar Sep 14 '24 15:09 cho-m

I'm going to push a new version with ENV.deparallelize to see if it helps.

iMichka avatar Sep 15 '24 20:09 iMichka

Sadly the Sequoia run failed. May have been trying to grab non-existent bottle cache. EDIT: Same for deps test. Probably have to do run with cache disabled.

On side note, Octave passed so parallelization seems likely culprit.


Added https://github.com/Homebrew/homebrew-core/labels/no%20long%20build%20conflict so we hopefully merge after one last run.

cho-m avatar Sep 16 '24 14:09 cho-m

This is blocking multiple PRs, so removing https://github.com/Homebrew/homebrew-core/labels/no%20long%20build%20conflict

carlocab avatar Sep 22 '24 00:09 carlocab

==> Downloading https://code.mpimet.mpg.de/attachments/download/29646/cdo-2.4.4.tar.gz curl: (56) The requested URL returned error: 404 ==> Retrying download in 2s... (2 tries left) ==> Downloading https://code.mpimet.mpg.de/attachments/download/29646/cdo-2.4.4.tar.gz curl: (56) The requested URL returned error: 404 ==> Retrying download in 4s... (1 try left) ==> Downloading https://code.mpimet.mpg.de/attachments/download/29646/cdo-2.4.4.tar.gz curl: (56) The requested URL returned error: 404

iMichka avatar Sep 24 '24 19:09 iMichka

Fix for cdo: #191796

iMichka avatar Sep 24 '24 20:09 iMichka

This should be good now

iMichka avatar Sep 26 '24 18:09 iMichka

:robot: An automated task has requested bottles to be published to this PR.

github-actions[bot] avatar Sep 27 '24 10:09 github-actions[bot]

I strongly suspect this update, and particularly this line https://github.com/Homebrew/homebrew-core/pull/170959/files#diff-6dfd5ae69b1543e3bc621830b31efbf791e147e7030a37366f37038a7569141aR54, to be the cause of this build failure in the GDAL CI test suite: https://github.com/OSGeo/gdal/actions/runs/11071728335/job/30768851063?pr=10884:

 ld: library not found for -lhdf5_hl

We haven't changed anything in our code related to HDF5/netCDF lately and that build configuration has just started failing today (and only the Homebrew one. We do link against libhdf5 & libnetcdf provided by other packaging systems). I've no local access to a Mac so it is not practical for me to inspect further.

rouault avatar Sep 27 '24 15:09 rouault

You can try undoing it with doing something like

sed -i .bak 's/hdf5_hl;hdf5;/hdf5_hl-shared;hdf5-shared;/g' \
    "$(brew --prefix netcdf)/lib/cmake/netCDF/netCDFTargets.cmake"

to see if it will help.

But I'm sceptical that that's the line at fault. I suggest building with CMAKE_VERBOSE_MAKEFILE=ON so we can get a better look at the failing compiler invocation. It might also help to build serially (i.e. -j 1) to make tracking down the exact command easier.

carlocab avatar Sep 27 '24 15:09 carlocab

@carlocab Thanks for both suggestions!

  • your sed trick did the job: https://github.com/rouault/gdal/actions/runs/11074368125/job/30773000210 is a green build
  • CMAKE_VERBOSE_MAKEFILE=ON in https://github.com/rouault/gdal/actions/runs/11074368805/job/30773002569. I'm just putting here the relevant part of the offending linking line as GDAL is a huge library linking the whole world... So what appears is that a -lhdf5_hl is inserted there whereas GDAL itself only explicitly needs the -lhdf5 one (it uses the CMake FindHDF5 module with the COMPONENTS "C" to retrieve the library)
``` /Applications/Xcode_14.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -Werror -fvisibility=hidden -arch arm64 -isysroot /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -dynamiclib -Wl,-headerpad_max_install_names -compatibility_version 35.0.0 -current_version 35.3.10 -o libgdal.35.3.10.0.dylib -install_name @rpath/libgdal.35.dylib [... tons of GDAL .cpp.o files there] -Wl,-rpath,/opt/homebrew/lib -lm /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libz.tbd /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libz.tbd /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libcurl.tbd /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libxml2.tbd /opt/homebrew/Cellar/openssl@3/3.3.2/lib/libcrypto.dylib /opt/homebrew/Cellar/openssl@3/3.3.2/lib/libssl.dylib /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/liblzma.tbd /opt/homebrew/lib/liblz4.dylib /opt/homebrew/Cellar/qhull/2020.2/lib/libqhull_r.dylib /opt/homebrew/Cellar/sfcgal/1.5.2_1/lib/libSFCGAL.dylib /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libz.tbd /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libexpat.tbd /opt/homebrew/lib/libxerces-c.dylib /opt/homebrew/lib/libjpeg.dylib /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libz.tbd /opt/homebrew/lib/libjpeg.dylib /opt/homebrew/lib/libtiff.dylib /opt/homebrew/lib/libgeotiff.dylib /opt/homebrew/lib/libjpeg.dylib /opt/homebrew/lib/libtiff.dylib /opt/homebrew/lib/libgeotiff.dylib /opt/homebrew/lib/libtiff.dylib /opt/homebrew/Cellar/libheif/1.18.2/lib/libheif.dylib /opt/homebrew/lib/libjpeg.dylib /opt/homebrew/lib/libpng.dylib /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libz.tbd /opt/homebrew/lib/libLerc.dylib /opt/homebrew/lib/libzstd.1.5.6.dylib /opt/homebrew/lib/libpng.dylib /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libz.tbd /opt/homebrew/lib/libaec.dylib /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libz.tbd /opt/homebrew/lib/libjpeg.dylib /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libz.tbd /opt/homebrew/Cellar/poppler/24.04.0_1/lib/libpoppler.dylib /opt/homebrew/lib/libpng.dylib /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libz.tbd /opt/homebrew/lib/libgif.dylib /opt/homebrew/lib/libnetcdf.19.dylib /opt/homebrew/Cellar/cfitsio/4.4.1/lib/libcfitsio.dylib /opt/homebrew/lib/libhdf5.310.4.0.dylib /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libcurl.tbd /opt/homebrew/Cellar/webp/1.4.0/lib/libwebp.dylib /opt/homebrew/opt/sqlite/lib/libsqlite3.dylib /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libz.tbd /opt/homebrew/lib/postgresql@14/libpq.dylib /opt/homebrew/Cellar/openjpeg/2.5.2/lib/libopenjp2.dylib /opt/homebrew/Cellar/openexr/3.2.4/lib/libOpenEXR.dylib /opt/homebrew/Cellar/openexr/3.2.4/lib/libOpenEXRUtil.dylib /opt/homebrew/lib/libImath.dylib /opt/homebrew/Cellar/openexr/3.2.4/lib/libIex.dylib /opt/homebrew/Cellar/jpeg-xl/0.11.0/lib/libjxl.dylib /opt/homebrew/Cellar/jpeg-xl/0.11.0/lib/libjxl_threads.dylib /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libexpat.tbd /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libexpat.tbd /opt/homebrew/lib/libxerces-c.dylib /opt/homebrew/opt/sqlite/lib/libsqlite3.dylib /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libexpat.tbd /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libexpat.tbd /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libexpat.tbd /opt/homebrew/lib/libxerces-c.dylib /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libexpat.tbd /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libexpat.tbd /opt/homebrew/lib/libxerces-c.dylib /opt/homebrew/opt/sqlite/lib/libsqlite3.dylib /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libpcre2-8.tbd /opt/homebrew/Cellar/libspatialite/5.1.0_1/lib/libspatialite.dylib /opt/homebrew/opt/sqlite/lib/libsqlite3.dylib /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libexpat.tbd /opt/homebrew/opt/sqlite/lib/libsqlite3.dylib /opt/homebrew/opt/sqlite/lib/libsqlite3.dylib /opt/homebrew/opt/sqlite/lib/libsqlite3.dylib /opt/homebrew/opt/sqlite/lib/libsqlite3.dylib /opt/homebrew/lib/libxerces-c.dylib /opt/homebrew/lib/postgresql@14/libpq.dylib /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libexpat.tbd /opt/homebrew/Cellar/freexl/2.0.0/lib/libfreexl.dylib /opt/homebrew/lib/libarrow_dataset.1700.0.0.dylib /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libexpat.tbd /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libexpat.tbd /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libxml2.tbd /opt/homebrew/lib/libgeos_c.1.19.0.dylib /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libcurl.tbd /opt/homebrew/lib/libproj.25.9.5.0.dylib /opt/homebrew/lib/libjson-c.5.4.0.dylib -lm /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libiconv.tbd /opt/homebrew/Cellar/openssl@3/3.3.2/lib/libcrypto.dylib -framework OpenCL -lhdf5_hl -lhdf5 /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/lib/libm.tbd /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/lib/libz.tbd /opt/homebrew/lib/libzstd.dylib /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/lib/libbz2.tbd /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/lib/libcurl.tbd /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/lib/libxml2.tbd /opt/homebrew/lib/libparquet.1700.0.0.dylib /opt/homebrew/lib/libarrow_acero.1700.0.0.dylib /opt/homebrew/lib/libarrow.1700.0.0.dylib 2024-09-27T16:46:50.0705450Z ld: library not found for -lhdf5_hl ```

rouault avatar Sep 27 '24 17:09 rouault

hdf5_hl (i.e. -lhdf5_hl) should work in some environments but it doesn't guarantee the directory is on lookup path (i.e. -L#{HOMEBREW_PREFIX}/lib or -L#{HOMEBREW_PREFIX}/opt/hdf5/lib).

Original logic for hdf5_hl-shared is to pick up the CMake target, e.g.

  • hdf5-targets.cmake
    # Create imported target hdf5_hl-shared
    add_library(hdf5_hl-shared SHARED IMPORTED)
    
    set_target_properties(hdf5_hl-shared PROPERTIES
      INTERFACE_COMPILE_DEFINITIONS "H5_BUILT_AS_DYNAMIC_LIB"
      INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${_IMPORT_PREFIX}/include"
      INTERFACE_LINK_LIBRARIES "hdf5-shared"
    )
    
  • hdf5-targets-release.cmake:
    # Import target "hdf5_hl-shared" for configuration "Release"
    set_property(TARGET hdf5_hl-shared APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
    set_target_properties(hdf5_hl-shared PROPERTIES
      IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libhdf5_hl.310.0.4.dylib"
      IMPORTED_SONAME_RELEASE "@rpath/libhdf5_hl.310.dylib"
      )
    

The exact situation is a bit trickier as both HDF5 and NetCDF have issues in their CMake/pkg-config files in current releases. There are some fixes in HEAD for each.

cho-m avatar Sep 27 '24 18:09 cho-m

Thanks for the update, @rouault. I've opened a PR to remove the workaround at #192118.

carlocab avatar Sep 27 '24 18:09 carlocab

Incidentally, adding -L"$(brew --prefix netcdf)/lib" to your LDFLAGS is also likely to fix that build failure.

carlocab avatar Sep 27 '24 19:09 carlocab