Homebrew / homebrew-core

🍻 Default formulae for the missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
13.67k stars 12.38k forks source link

gdal - linked with incorrect libdap - Big Sur #68049

Closed dwcaress closed 3 years ago

dwcaress commented 3 years ago

Bug report

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

What you were trying to do (and why)

Install and use gmt on MacBook Pro running up-to-date Big Sur.

What happened (include command output)

caress@Haxby ~ % gmt dyld: Library not loaded: /usr/local/opt/libdap/lib/libdap.25.dylib Referenced from: /usr/local/opt/gdal/lib/libgdal.28.dylib Reason: image not found zsh: abort gmt

caress@Haxby ~ % gdalwarp
dyld: Library not loaded: /usr/local/opt/libdap/lib/libdap.25.dylib

Referenced from: /usr/local/bin/gdalwarp Reason: image not found zsh: abort gdalwarp

It appears that gdal is linked with an incorrect version of libdap, as the libdap actually installed is: caress@Haxby ~ % ls -l /usr/local/opt/libdap/lib/libdap* -r--r--r-- 1 caress staff 1547192 Dec 30 13:04 /usr/local/opt/libdap/lib/libdap.27.dylib -r--r--r-- 1 caress staff 2949784 Dec 29 11:05 /usr/local/opt/libdap/lib/libdap.a lrwxr-xr-x 1 caress staff 15 Dec 29 11:05 /usr/local/opt/libdap/lib/libdap.dylib -> libdap.27.dylib -rw-r--r-- 1 caress staff 269920 Dec 30 13:04 /usr/local/opt/libdap/lib/libdapclient.6.dylib -r--r--r-- 1 caress staff 373536 Dec 29 11:05 /usr/local/opt/libdap/lib/libdapclient.a lrwxr-xr-x 1 caress staff 20 Dec 29 11:05 /usr/local/opt/libdap/lib/libdapclient.dylib -> libdapclient.6.dylib -r--r--r-- 1 caress staff 99368 Dec 30 13:04 /usr/local/opt/libdap/lib/libdapserver.7.dylib -r--r--r-- 1 caress staff 65648 Dec 29 11:05 /usr/local/opt/libdap/lib/libdapserver.a lrwxr-xr-x 1 caress staff 20 Dec 29 11:05 /usr/local/opt/libdap/lib/libdapserver.dylib -> libdapserver.7.dylib

What you expected to happen

Gmt and gdalwarp to execute normally

Step-by-step reproduction instructions (by running brew install commands)

Output of 'brew config':

HOMEBREW_VERSION: 2.7.1 ORIGIN: https://github.com/Homebrew/brew HEAD: fdb71a5cb3029da2ef74d7e09c40575bbfb4ec72 Last commit: 2 days ago Core tap ORIGIN: https://github.com/Homebrew/homebrew-core Core tap HEAD: dd0275f67740fa2011b0ee85bbaab57e1c83ee59 Core tap last commit: 17 minutes ago Core tap branch: master HOMEBREW_PREFIX: /usr/local HOMEBREW_CASK_OPTS: [] HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.DWcvQ6pvgn/org.macosforge.xquartz:0 HOMEBREW_MAKE_JOBS: 8 Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby CPU: octa-core 64-bit kabylake Clang: 12.0 build 1200 Git: 2.24.3 => /Library/Developer/CommandLineTools/usr/bin/git Curl: 7.64.1 => /usr/bin/curl Java: 1.8.192.12, 1.8.0_192 macOS: 11.1-x86_64 CLT: 12.3.0.0.1.1607026830 Xcode: 12.3 XQuartz: 2.7.11 => /opt/X11

Series of commands and results using 'brew doctor':

Last login: Wed Dec 30 12:30:20 on ttys000 caress@Haxby ~ % gmt dyld: Library not loaded: /usr/local/opt/gdal/lib/libgdal.28.dylib Referenced from: /usr/local/bin/gmt Reason: image not found zsh: abort gmt caress@Haxby ~ % caress@Haxby ~ % caress@Haxby ~ % brew update Already up-to-date. caress@Haxby ~ % brew doctor Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue. If everything you use Homebrew for is working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: You have unlinked kegs in your Cellar. Leaving kegs unlinked can lead to build-trouble and cause brews that depend on those kegs to fail to run properly once built. Run brew link on these: gdal

Warning: Broken symlinks were found. Remove them with brew cleanup: /usr/local/opt/gdal caress@Haxby ~ % brew cleanup Warning: Skipping gdal: most recent version 3.2.0_1 not installed Pruned 1 symbolic links and 5 directories from /usr/local caress@Haxby ~ % gmt dyld: Library not loaded: /usr/local/opt/gdal/lib/libgdal.28.dylib Referenced from: /usr/local/bin/gmt Reason: image not found zsh: abort gmt caress@Haxby ~ % brew doctor Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue. If everything you use Homebrew for is working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: You have unlinked kegs in your Cellar. Leaving kegs unlinked can lead to build-trouble and cause brews that depend on those kegs to fail to run properly once built. Run brew link on these: gdal caress@Haxby ~ % brew link gdal Linking /usr/local/Cellar/gdal/3.2.0_1.reinstall... 210 symlinks created caress@Haxby ~ % gmt dyld: Library not loaded: /usr/local/opt/libdap/lib/libdap.25.dylib Referenced from: /usr/local/opt/gdal/lib/libgdal.28.dylib Reason: image not found zsh: abort gmt caress@Haxby ~ % brew doctor Your system is ready to brew. caress@Haxby ~ % gdalwarp dyld: Library not loaded: /usr/local/opt/libdap/lib/libdap.25.dylib Referenced from: /usr/local/bin/gdalwarp Reason: image not found zsh: abort gdalwarp caress@Haxby ~ % ls -l /usr/local/opt/libdap/lib/libdap* -r--r--r-- 1 caress staff 1547192 Dec 30 13:04 /usr/local/opt/libdap/lib/libdap.27.dylib -r--r--r-- 1 caress staff 2949784 Dec 29 11:05 /usr/local/opt/libdap/lib/libdap.a lrwxr-xr-x 1 caress staff 15 Dec 29 11:05 /usr/local/opt/libdap/lib/libdap.dylib -> libdap.27.dylib -rw-r--r-- 1 caress staff 269920 Dec 30 13:04 /usr/local/opt/libdap/lib/libdapclient.6.dylib -r--r--r-- 1 caress staff 373536 Dec 29 11:05 /usr/local/opt/libdap/lib/libdapclient.a lrwxr-xr-x 1 caress staff 20 Dec 29 11:05 /usr/local/opt/libdap/lib/libdapclient.dylib -> libdapclient.6.dylib -r--r--r-- 1 caress staff 99368 Dec 30 13:04 /usr/local/opt/libdap/lib/libdapserver.7.dylib -r--r--r-- 1 caress staff 65648 Dec 29 11:05 /usr/local/opt/libdap/lib/libdapserver.a lrwxr-xr-x 1 caress staff 20 Dec 29 11:05 /usr/local/opt/libdap/lib/libdapserver.dylib -> libdapserver.7.dylib caress@Haxby ~ % brew gist-logs gdal Error: No logs. caress@Haxby ~ % brew gist-logs libdap Error: No logs. caress@Haxby ~ % brew gist-logs gmt Error: No logs. caress@Haxby ~ %

dwcaress commented 3 years ago

On a Mac running Catalina with an existing, working homebrew installation including gmt and gdal, I did 'brew upgrade'. This resulted in updating libdap to the version referenced above. This then forced a re-installation of gdal, which was built from source rather than installed from a bottle. The updated gdal installation works, and gmt still works. Perhaps the problem is with the gdal bottle for Big Sur?

dwcaress commented 3 years ago

Going back to my Big Sur machine, I did: brew uninstall gmt gdal brew install --build-from-source gdal brew install gmt

This succeeded. Therefore the problem likely does reside in the construction of the gdal bottle for Big Sur (and perhaps the bottles for other MacOs variants as well).

carlocab commented 3 years ago

Thanks for the bug report, @dwcaress. I've opened a pull request (#68039) to rebuild the gdal bottle.

carlocab commented 3 years ago

This should be fixed now.

dwcaress commented 3 years ago

Yes, the problem is fixed. Thank you.

torchingloom commented 3 years ago

I'm sorry, but I have the same problem with osgeo-gdal after today brew upgrade

MacOS BigSur 11.2 Beta (20D5042d)


gdalwarp
dyld: Library not loaded: /usr/local/opt/libdap/lib/libdap.25.dylib
  Referenced from: /usr/local/opt/osgeo-gdal/bin/gdalwarp
  Reason: image not found

brew config
HOMEBREW_VERSION: 2.7.5-39-ge8667b6
ORIGIN: https://github.com/Homebrew/brew
HEAD: e8667b609cb7fe2f6baa72ae9798fd01bd40498b
Last commit: 42 minutes ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 1cf17e5879833fe3849aec7328b22063af72870b
Core tap last commit: 70 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_EDITOR: subl
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_MAKE_JOBS: 16
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: 16-core 64-bit kabylake
Clang: 12.0 build 1200
Git: 2.30.0 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 15.0.1, 1.8.261.12, 1.8.0_275
macOS: 11.2-x86_64
CLT: N/A
Xcode: 12.3

brew info osgeo-gdal
osgeo/osgeo4mac/osgeo-gdal: stable 3.1.2 (bottled), HEAD
GDAL: Geospatial Data Abstraction Library
https://www.gdal.org/
/usr/local/Cellar/osgeo-gdal/3.1.2_2 (227 files, 58.8MB) *
  Poured from bottle on 2021-01-18 at 14:35:58
/usr/local/Cellar/osgeo-gdal/3.1.2_2.reinstall (227 files, 58.8MB)
  Poured from bottle on 2021-01-18 at 14:35:30
From: https://github.com/osgeo/homebrew-osgeo4mac/blob/HEAD/Formula/osgeo-gdal.rb
==> Dependencies
Build: pkg-config ✔, openjdk ✔
Required: armadillo ✔, ant ✔, curl-openssl ✔, expat ✔, freexl ✔, geos ✔, giflib ✔, json-c ✔, mdbtools ✔, numpy ✔, libiconv ✔, osgeo-libkml ✔, libpq ✔, osgeo-libspatialite ✔, libzip ✔, pcre ✔, openssl ✔, qhull ✔, sfcgal ✔, sqlite ✔, swig ✔, zlib ✔, cfitsio ✔, epsilon ✔, osgeo-hdf4 ✔, hdf5 ✔, jpeg-turbo ✔, jasper ✔, libdap ✔, libpng ✔, libxml2 ✔, osgeo-netcdf ✔, openjpeg ✔, webp ✔, zstd ✔, unixodbc ✔, xerces-c ✔, xz ✔, osgeo-proj ✔, osgeo-postgresql ✔
==> Requirements
Required: Unlinked ✔
==> Options
--with-pg10
    Build with PostgreSQL 10 client
--with-pg11
    Build with PostgreSQL 11 client
--HEAD
    Install HEAD version
==> Caveats
Plugins for this version of GDAL/OGR, generated by other formulae, should
be symlinked to the following directory:

  /usr/local/lib/gdalplugins/3.1

You may need to set the following enviroment variable:

  export GDAL_DRIVER_PATH=/usr/local/lib/gdalplugins

PYTHON BINDINGS are now built in a separate formula: osgeo-gdal-python

brew info libdap
libdap: stable 3.20.7 (bottled), HEAD
Framework for scientific data networking
https://www.opendap.org/
/usr/local/Cellar/libdap/3.20.7 (163 files, 6.7MB) *
  Poured from bottle on 2021-01-18 at 12:22:04
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libdap.rb
License: LGPL-2.1-or-later
==> Dependencies
Build: bison ✘, pkg-config ✔
Required: libxml2 ✔, openssl@1.1 ✔
==> Options
--HEAD
    Install HEAD version```
carlocab commented 3 years ago

osgeo-gdal is not a homebrew/core formula. You'll need to report this at https://github.com/OSGeo/homebrew-osgeo4mac.

torchingloom commented 3 years ago

osgeo-gdal is not a homebrew/core formula. You'll need to report this at https://github.com/OSGeo/homebrew-osgeo4mac.

@carlocab Sorry, thank you