OSGeo / homebrew-osgeo4mac

Mac homebrew tap for maintaining a stable work environment for the OSGeo.org geospatial toolset
https://git.io/fhh3X
BSD 3-Clause "New" or "Revised" License
364 stars 111 forks source link

libproj library not loaded #174

Closed Jmuccigr closed 8 years ago

Jmuccigr commented 8 years ago

I use homebrew to install gdal. Recently I switched from the 1.11 version on the main branch to OSGeo's 2.1. I thought everything was still working, but I noticed today that I'm getting an error. For example, if I try just a ogr2ogr -version, I get:

dyld: Library not loaded: /usr/local/lib/libproj.9.dylib
  Referenced from: /usr/local/bin/ogr2ogr
  Reason: image not found
Trace/BPT trap: 5

Any thoughts? (Or is there a Google group or something to direct these kinds of questions to?)

ecerrillo commented 8 years ago

Same here. When launching qgis-214 I get:

`Dyld Error Message: Library not loaded: /usr/local/opt/proj/lib/libproj.9.dylib Referenced from: /usr/local/opt/gdal-20/lib/libgdal.20.dylib Reason: image not found``

I have re-installed from source gdal2with no success.

dakcarto commented 8 years ago

Hi @Jmuccigr, thanks for reporting.

/usr/local/bin/ogr2ogr indicates an issue with the hombrew-core gdal formula, not the gdal 2.x formulae here, which are 'keg-only' and not symlinked to HOMEBREW_PREFIX, e.g. /usr/local in your install. You need to either brew update && brew upgrade gdal, if available, or re-compile gdal to account for the changed underlying dependency.

Note: any GDAL/OGR command line utility for the keg-only gdal2 or gdal-20 formulae will need to located by adding its bin to your PATH prior to the HOMEBREW_PREFIX (for example):

export PATH=$(brew --prefix)/opt/gdal2/bin:$(brew --prefix)/bin:$PATH

(assuming $(brew --prefix)/bin is not already part of PATH, which it should be)

Please reopen issue if this does not fix the problem.

dakcarto commented 8 years ago

@ecerrillo wrote:

Same here. When launching qgis-214 I get:

Dyld Error Message: Library not loaded: /usr/local/opt/proj/lib/libproj.9.dylib Referenced from: /usr/local/opt/gdal-20/lib/libgdal.20.dylib Reason: image not found`

I have re-installed from source ´gdal2´with no success.

Please note that until pre-migration to homebrew-geospatial is complete, gdal-20 and gdal2 are separate formulae, both of which are keg-only.

dakcarto commented 8 years ago

@ecerrillo, also, currently qgis-214 still references the gdal-20 formula (I am working on linking new qgis formulae to gdal2's libs). So, in your case, you will need to re-compile gdal-20.

Jmuccigr commented 8 years ago

@dakcarto, right now the symlinks in /usr/local point to the gdal-20 versions of things, and I see that I did a brew link gdal-20 after I installed it, which explains that.

Will brew link not work for gdal-20 then?

Thanks!

dakcarto commented 8 years ago

@Jmuccigr wrote:

Will brew link not work for gdal-20 then?

That works fine, as your active linking shows. Just realize that when you force linking of a keg-only formula you are overriding the anticipated install state with regards to other formulae (who may expect it to be gdal not gdal-20, for example). Generally, if a formula is keg-only, there is a good reason for that and you should really have a better reason for overriding that expected state.

One example for forcing the linking of keg-only is on Travis CI, where you may wish to build software against such formulae and want them to be linked. Since the build is temporary this is usually OK. However, in a day-to-day Homebrew setup, where you intend to get work done and frequently brew update, I recommend against force linking any keg-only formulae.

Jmuccigr commented 8 years ago

Sorry, I meant: is the linking of gdal-20 causing the problem, and the answer appears to be no, because when I brew unlink gdal-20 and try /usr/local/opt/gdal-20/bin/ogr2ogr -version, I still get the same thing:

> /usr/local/opt/gdal-20/bin/ogr2ogr -version
dyld: Library not loaded: /usr/local/lib/libproj.9.dylib
  Referenced from: /usr/local/opt/gdal-20/bin/ogr2ogr
  Reason: image not found
Trace/BPT trap: 5

I see now that my copy of proj was just updated on Oct 3, so I wonder whether the version of libproj also was updated then?

Trying the same symlink approach as at #90 seems to fix it, as long as I include gdal-20 in the path. Haven't re-linked it via homebrew (yet).

Jmuccigr commented 8 years ago

WRT the symlink approach, is there a reason to require a specific version of the dylib?

Getting a little out of my depth here, but I thought that libproj.dylib was linked to the latest version (now libproj.12.dylib) partly to avoid these kinds of problems. (And this is a general approach, no? Again, getting out of my expertise.)

dakcarto commented 7 years ago

@Jmuccigr wrote:

I see now that my copy of proj was just updated on Oct 3, so I wonder whether the version of libproj also was updated then?

Yes, as noted above. Update to libproj.dylib is the result of upgrading proj.

Trying the same symlink approach as at #90 seems to fix it, as long as I include gdal-20 in the path. Haven't re-linked it via homebrew (yet).

Please don't do this. Recompile gdal-20 instead, e.g. brew rm gdal-20 && brew install gdal-20 --build-from-source or maybe just brew reinstall gdal-20 --build-from-source.

The linking from your current libgdal.dylib to libproj.*.dylib will not be updated until gdal-20 is recompiled.

WRT the symlink approach, is there a reason to require a specific version of the dylib?

Getting a little out of my depth here, but I thought that libproj.dylib was linked to the latest version (now libproj.12.dylib) partly to avoid these kinds of problems. (And this is a general approach, no? Again, getting out of my expertise.)

The problem stems from GDAL/OGR linking that often resolves that base symlink to the versioned lib. It would be much better if libgdal.dylib (or any of its plugin drivers) always referenced the $(brew --prefix/opt/<formula>/lib/<base>.dylib) location for the linked install name instead. Homebrew currently supports fixing up the opt/ path, but GDAL/OGR itself needs to stop resolving the symlink, if this is indeed something that needs avoided (opinions vary on this topic, as versioning is important).

Ultimately, GDAL/OGR should be completely redesigned to offer all drivers as plugins, instead of compiled into one library. This always leads to issues whenever any of it dependencies are updated, which then require a rebuild of the base libgdal.dylib.

You can see that it uses the versioned lib for all linked libs (not just proj), which can be quite a few if adding more driver support:

$ otool -L /usr/local/opt/gdal-20/lib/libgdal.dylib 
/usr/local/opt/gdal-20/lib/libgdal.dylib:
    /usr/local/opt/gdal-20/lib/libgdal.20.dylib (compatibility version 22.0.0, current version 22.0.0)
    /usr/local/opt/proj/lib/libproj.9.dylib (compatibility version 11.0.0, current version 11.0.0)
    /usr/local/opt/json-c/lib/libjson-c.2.dylib (compatibility version 3.0.0, current version 3.1.0)
    /usr/local/opt/freexl/lib/libfreexl.1.dylib (compatibility version 3.0.0, current version 3.0.0)
    /usr/local/opt/geos/lib/libgeos_c.1.dylib (compatibility version 11.0.0, current version 11.0.0)
    /usr/local/opt/sqlite/lib/libsqlite3.0.dylib (compatibility version 9.0.0, current version 9.6.0)
    /usr/lib/libexpat.1.dylib (compatibility version 7.0.0, current version 8.0.0)
    /usr/local/opt/giflib/lib/libgif.4.dylib (compatibility version 6.0.0, current version 6.7.0)
    /usr/local/opt/jpeg/lib/libjpeg.8.dylib (compatibility version 13.0.0, current version 13.0.0)
    /usr/local/opt/libgeotiff/lib/libgeotiff.2.dylib (compatibility version 4.0.0, current version 4.1.0)
    /usr/local/opt/libtiff/lib/libtiff.5.dylib (compatibility version 8.0.0, current version 8.4.0)
    /usr/local/opt/libpng/lib/libpng16.16.dylib (compatibility version 38.0.0, current version 38.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    /usr/local/opt/libspatialite/lib/libspatialite.7.dylib (compatibility version 9.0.0, current version 9.0.0)
    /usr/local/opt/pcre/lib/libpcre.1.dylib (compatibility version 4.0.0, current version 4.6.0)
    /usr/lib/libcurl.4.dylib (compatibility version 7.0.0, current version 8.0.0)
    /usr/local/opt/libxml2/lib/libxml2.2.dylib (compatibility version 12.0.0, current version 12.3.0)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
    /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)

Any upgrade of underlying libs will break GDAL/OGR, requiring a recompile. Generally, the linked version should be the major version, but this breakage happens often with GDAL/OGR.

Jmuccigr commented 7 years ago

OK, I followed your advice and uninstalled what I had and did brew install gdal-20 --build-from-source which worked (though took a while of course).

Note that I got a bunch of Calling SoftwareSpec#sha1 is deprecated errors.

Jmuccigr commented 6 years ago

This just came back for me, now with an updated error. Started on March 3, when proj was updated:

dyld: Library not loaded: /usr/local/opt/proj/lib/libproj.12.dylib

I tried the solution that worked before, of installing gdal2 with --brew-from-source, but that failed (output at the bottom of this post), so I reverted to manually putting in a symlink into /usr/local/opt/proj/lib/, which I realize is not recommended:

> ln -s libproj.13.dylib libproj.12.dylib

Errors from attempt to install gdal2 from source:

Last 15 lines from /Users/john_muccigrosso/Library/Logs/Homebrew/gdal2/02.make:
/bin/sh /private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/libtool --mode=compile --tag=CXX clang++ -std=gnu++11 -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/port -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/gcore -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/alg -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/ogr -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/ogr/ogrsf_frmts -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/gnm -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/apps -arch x86_64 -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2  -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -Wunused-private-field -Wmissing-prototypes -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wimplicit-fallthrough  -DGNM_ENABLED -I/usr/local/Cellar/gdal2/2.2.3/include -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/port -I/usr/local -I/usr/local/include -I/usr/local -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/libpng -I/usr/local/opt/libpng/include -I/usr -I/usr/include  -DGDAL_COMPILATION -c -o ../o/terragendataset.lo terragendataset.cpp
libtool: compile:  clang++ -std=gnu++11 -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/port -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/gcore -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/alg -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/ogr -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/ogr/ogrsf_frmts -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/gnm -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/apps -arch x86_64 -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2 -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -Wunused-private-field -Wmissing-prototypes -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wimplicit-fallthrough -DGNM_ENABLED -I/usr/local/Cellar/gdal2/2.2.3/include -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/port -I/usr/local -I/usr/local/include -I/usr/local -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/libpng -I/usr/local/opt/libpng/include -I/usr -I/usr/include -DGDAL_COMPILATION -c terragendataset.cpp  -fno-common -DPIC -o ../o/.libs/terragendataset.o
libtool: compile:  clang++ -std=gnu++11 -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/port -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/gcore -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/alg -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/ogr -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/ogr/ogrsf_frmts -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/gnm -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/apps -arch x86_64 -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2 -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -Wunused-private-field -Wmissing-prototypes -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wimplicit-fallthrough -DGNM_ENABLED -I/usr/local/Cellar/gdal2/2.2.3/include -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/port -I/usr/local -I/usr/local/include -I/usr/local -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/libpng -I/usr/local/opt/libpng/include -I/usr -I/usr/include -DGDAL_COMPILATION -c tsxdataset.cpp -o ../o/tsxdataset.o >/dev/null 2>&1
libtool: compile:  clang++ -std=gnu++11 -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/port -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/gcore -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/alg -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/ogr -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/ogr/ogrsf_frmts -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/gnm -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/apps -arch x86_64 -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2 -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -Wunused-private-field -Wmissing-prototypes -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wimplicit-fallthrough -I../raw -I../vrt -I../../ogr/ogrsf_frmts/geojson -I/usr/local/opt/json-c/include/json-c -DGNM_ENABLED -I/usr/local/Cellar/gdal2/2.2.3/include -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/port -I/usr/local -I/usr/local/include -I/usr/local -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/libpng -I/usr/local/opt/libpng/include -I/usr -I/usr/include -DGDAL_COMPILATION -c vicardataset.cpp -o ../o/vicardataset.o >/dev/null 2>&1
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C blx install-obj
/bin/sh /private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/libtool --mode=compile --tag=CXX clang++ -std=gnu++11 -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/port -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/gcore -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/alg -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/ogr -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/ogr/ogrsf_frmts -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/gnm -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/apps -arch x86_64 -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2  -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -Wunused-private-field -Wmissing-prototypes -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wimplicit-fallthrough  -I. -DGDALDRIVER  -DGNM_ENABLED -I/usr/local/Cellar/gdal2/2.2.3/include -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/port -I/usr/local -I/usr/local/include -I/usr/local -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/libpng -I/usr/local/opt/libpng/include -I/usr -I/usr/include  -DGDAL_COMPILATION -c -o ../o/blxdataset.lo blxdataset.cpp
libtool: compile:  clang++ -std=gnu++11 -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/port -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/gcore -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/alg -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/ogr -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/ogr/ogrsf_frmts -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/gnm -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/apps -arch x86_64 -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2 -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -Wunused-private-field -Wmissing-prototypes -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wimplicit-fallthrough -I. -DGDALDRIVER -DGNM_ENABLED -I/usr/local/Cellar/gdal2/2.2.3/include -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/port -I/usr/local -I/usr/local/include -I/usr/local -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/libpng -I/usr/local/opt/libpng/include -I/usr -I/usr/include -DGDAL_COMPILATION -c blxdataset.cpp  -fno-common -DPIC -o ../o/.libs/blxdataset.o
libtool: compile:  clang++ -std=gnu++11 -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/port -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/gcore -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/alg -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/ogr -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/ogr/ogrsf_frmts -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/gnm -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/apps -arch x86_64 -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2 -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -Wunused-private-field -Wmissing-prototypes -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wimplicit-fallthrough -DGNM_ENABLED -I/usr/local/Cellar/gdal2/2.2.3/include -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/port -I/usr/local -I/usr/local/include -I/usr/local -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/libpng -I/usr/local/opt/libpng/include -I/usr -I/usr/include -DGDAL_COMPILATION -c terragendataset.cpp -o ../o/terragendataset.o >/dev/null 2>&1
/bin/sh /private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/libtool --mode=compile --tag=CC clang -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/port -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/gcore -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/alg -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/ogr -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/ogr/ogrsf_frmts -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/gnm -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/apps -arch x86_64 -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -I/usr/local/opt/sqlite/include  -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync  -I. -DGDALDRIVER  -DGNM_ENABLED -I/usr/local/Cellar/gdal2/2.2.3/include -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/port -I/usr/local -I/usr/local/include -I/usr/local -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/libpng -I/usr/local/opt/libpng/include -I/usr -I/usr/include  -DGDAL_COMPILATION -c -o ../o/blx.lo blx.c
libtool: compile:  clang -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/port -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/gcore -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/alg -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/ogr -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/ogr/ogrsf_frmts -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/gnm -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/apps -arch x86_64 -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -I/usr/local/opt/sqlite/include -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -I. -DGDALDRIVER -DGNM_ENABLED -I/usr/local/Cellar/gdal2/2.2.3/include -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/port -I/usr/local -I/usr/local/include -I/usr/local -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/libpng -I/usr/local/opt/libpng/include -I/usr -I/usr/include -DGDAL_COMPILATION -c blx.c  -fno-common -DPIC -o ../o/.libs/blx.o
libtool: compile:  clang++ -std=gnu++11 -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/port -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/gcore -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/alg -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/ogr -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/ogr/ogrsf_frmts -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/gnm -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/apps -arch x86_64 -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2 -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -Wunused-private-field -Wmissing-prototypes -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wimplicit-fallthrough -I. -DGDALDRIVER -DGNM_ENABLED -I/usr/local/Cellar/gdal2/2.2.3/include -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/port -I/usr/local -I/usr/local/include -I/usr/local -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/libpng -I/usr/local/opt/libpng/include -I/usr -I/usr/include -DGDAL_COMPILATION -c blxdataset.cpp -o ../o/blxdataset.o >/dev/null 2>&1
make[1]: *** [pds-install-obj] Error 2
make[1]: *** Waiting for unfinished jobs....
libtool: compile:  clang -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/port -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/gcore -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/alg -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/ogr -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/ogr/ogrsf_frmts -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/gnm -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/apps -arch x86_64 -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -I/usr/local/opt/sqlite/include -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -I. -DGDALDRIVER -DGNM_ENABLED -I/usr/local/Cellar/gdal2/2.2.3/include -I/private/tmp/gdal2-20180307-86847-gjip7r/gdal-2.2.3/port -I/usr/local -I/usr/local/include -I/usr/local -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/libpng -I/usr/local/opt/libpng/include -I/usr -I/usr/include -DGDAL_COMPILATION -c blx.c -o ../o/blx.o >/dev/null 2>&1
make: *** [frmts-target] Error 2

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/osgeo/homebrew-osgeo4mac/issues

These open issues may also help:
Update gdal2-python.rb https://github.com/OSGeo/homebrew-osgeo4mac/pull/319
gdal2-python: creating gdal2-python.pth. https://github.com/OSGeo/homebrew-osgeo4mac/pull/314
gdal2 MDB configure error https://github.com/OSGeo/homebrew-osgeo4mac/issues/293
gdal2-python.rb is required to install site-packages/gdal2-python.pth additionally https://github.com/OSGeo/homebrew-osgeo4mac/issues/312
gdal2 installation problem under 10.11.6 https://github.com/OSGeo/homebrew-osgeo4mac/issues/307
Update gdal2-python to support building with GDAL trunk https://github.com/OSGeo/homebrew-osgeo4mac/pull/311
gdal2 --with-swig-java option sets old java source https://github.com/OSGeo/homebrew-osgeo4mac/issues/294
Using osgeo4mac's gdal2 with homebrew core's postgis https://github.com/OSGeo/homebrew-osgeo4mac/issues/185
gdal1-mrsid and gdal2-mrsid fails to build https://github.com/OSGeo/homebrew-osgeo4mac/issues/213
lamy199 commented 3 years ago

Urgent, Urgent, urgent please I have this issue can you help me pleaaaase, I have a mac Mojave ERROR 1: dlopen(/Library/Application Support/GDAL/3.2/PlugIns/gdal_MrSID.dylib, 1): Library not loaded: @loader_path/../Libraries/libltidsdk.9.dylib Referenced from: /Library/Application Support/GDAL/3.2/PlugIns/gdal_MrSID.dylib Reason: image not found ERROR 1: dlopen(/Library/Application Support/GDAL/3.2/PlugIns/gdal_MrSID.dylib, 1): Library not loaded: @loader_path/../Libraries/libltidsdk.9.dylib Referenced from: /Library/Application Support/GDAL/3.2/PlugIns/gdal_MrSID.dylib Reason: image not found ERROR 1: dlopen(/Library/Application Support/GDAL/3.2/PlugIns/gdal_ECW_JP2ECW.dylib, 1): Library not loaded: /Library/Application Support/GDAL/3.2/Libraries/libNCSEcw.dylib Referenced from: /Library/Application Support/GDAL/3.2/PlugIns/gdal_ECW_JP2ECW.dylib Reason: image not found ERROR 1: dlopen(/Library/Application Support/GDAL/3.2/PlugIns/gdal_ECW_JP2ECW.dylib, 1): Library not loaded: /Library/Application Support/GDAL/3.2/Libraries/libNCSEcw.dylib Referenced from: /Library/Application Support/GDAL/3.2/PlugIns/gdal_ECW_JP2ECW.dylib Reason: image not found ERROR 1: dlopen(/Library/Application Support/GDAL/3.2/PlugIns/gdal_MG4Lidar.dylib, 1): Library not loaded: @loader_path/../Libraries/liblti_lidar_dsdk.1.dylib Referenced from: /Library/Application Support/GDAL/3.2/PlugIns/gdal_MG4Lidar.dylib Reason: image not found ERROR 1: dlopen(/Library/Application Support/GDAL/3.2/PlugIns/gdal_MG4Lidar.dylib, 1): Library not loaded: @loader_path/../Libraries/liblti_lidar_dsdk.1.dylib Referenced from: /Library/Application Support/GDAL/3.2/PlugIns/gdal_MG4Lidar.dylib Reason: image not found