OSGeo/homebrew-osgeo4mac

GDAL: Library not loaded: /usr/local/opt/hdf5/lib/libhdf5.103.dylib

palmerj opened this issue · 7 comments

  • I read
  • I checked the documentation and found no answer
  • I tried to install after following the suggestions
  • I am running the latest version (brew update twice?)
  • I checked to make sure that this issue has not already been filed
  • I uploaded logs: brew gist-logs formula

Describe the bug

When running GDAl commands I get a linking error:

$ ogrinfo --version
dyld: Library not loaded: /usr/local/opt/hdf5/lib/libhdf5.103.dylib
Referenced from: /usr/local/bin/ogrinfo
Reason: image not found
Abort trap: 6

Additional context

I tried reinstalling both hdf5 and then osgeo-gdal, but it didn't fix the issue

Running catalina

Here's what installed for hdf:

$ ll /usr/local/opt/hdf5/lib/

drwxr-xr-x  21 user  staff      672 29 Feb 10:52 .
drwxr-xr-x  10 user  staff      320  9 Mar 16:43 ..
lrwxr-xr-x   1 user  staff       25 29 Feb 10:52 libhdf5_fortran.dylib -> libhdf5_fortran.200.dylib
lrwxr-xr-x   1 user  staff       21 29 Feb 10:52 libhdf5_cpp.dylib -> libhdf5_cpp.200.dylib
-rw-r--r--   1 user  staff   168376 29 Feb 10:52 libhdf5hl_fortran.a
-rw-r--r--   1 user  staff   128492  9 Mar 16:43 libhdf5_hl.200.dylib
lrwxr-xr-x   1 user  staff       17 29 Feb 10:52 libhdf5.dylib -> libhdf5.200.dylib
lrwxr-xr-x   1 user  staff       20 29 Feb 10:52 libhdf5_hl.dylib -> libhdf5_hl.200.dylib
-r--r--r--   1 user  staff  5647448 29 Feb 10:52 libhdf5.a
-rw-r--r--   1 user  staff   147032  9 Mar 16:43 libhdf5hl_fortran.200.dylib
-r--r--r--   1 user  staff   405400 29 Feb 10:52 libhdf5_fortran.a
lrwxr-xr-x   1 user  staff       27 29 Feb 10:52 libhdf5hl_fortran.dylib -> libhdf5hl_fortran.200.dylib
-r--r--r--   1 user  staff   298416  9 Mar 16:43 libhdf5_fortran.200.dylib
lrwxr-xr-x   1 user  staff       19 29 Feb 10:52 libhdf5_hl_fortran.a -> libhdf5hl_fortran.a
-r--r--r--   1 user  staff   158168 29 Feb 10:52 libhdf5_hl.a
-r--r--r--   1 user  staff    11184 29 Feb 10:52 libhdf5_hl_cpp.a
-r--r--r--   1 user  staff   639896 29 Feb 10:52 libhdf5_cpp.a
-rw-r--r--   1 user  staff    29324  9 Mar 16:43 libhdf5_hl_cpp.200.dylib
-r--r--r--   1 user  staff   380268  9 Mar 16:43 libhdf5_cpp.200.dylib
-r--r--r--   1 user  staff  3342568  9 Mar 16:43 libhdf5.200.dylib
lrwxr-xr-x   1 user  staff       24 29 Feb 10:52 libhdf5_hl_cpp.dylib -> libhdf5_hl_cpp.200.dylib

For now the workaround is to symlink the old references:

ln -s /usr/local/opt/hdf5/lib/libhdf5.dylib /usr/local/opt/hdf5/lib/libhdf5.103.dylib
ln -s /usr/local/opt/hdf5/lib/libhdf5_hl.dylib /usr/local/opt/hdf5/lib/libhdf5_hl.100.dylib

ok that didn't work using using python binding

ImportError: dlopen(/xxx/env/lib/python3.7/site-packages/osgeo/_gdal.cpython-37m-darwin.so, 2): Symbol not found: _H5Literate

Hi @palmerj . It's because of an update of hdf5 formula in homebrew/core. The quickest solution would be to rebuild from source gdal and gdal_python (and the rest of formulas you are using and depend on it). As an example, you need to:

brew reinstall osgeo-gdal --build-from-source 

All formulas in OSGeo tap need to be rebuild as well, but next time we'll try to use an stable release so to avoid this kind of issues.

Ok thanks, I fallen back to building from source.

@palmerj Thank you for raising the issue. A small update has already been released.

Thanks heaps!