[gdal-dev] Macintosh GDAL library looks for UnixImageIO framework in default location only?
William Kyngesburye
woklist at kyngchaos.com
Mon Jan 26 20:17:22 PST 2015
My email should be in the GDAL installer readme.
Anyways, yes, the whole batch of frameworks is set up for absolue paths. So not only does GDAL reference UnixImageIO (and SQLite3), when you compile an app linked to them, it will also link absolute paths to the frameworks.
The standard way to change this in your app and in any bundled frameworks is to use install_name_tool with the -change option and a special relative path keyword, @loader_path:
install_name_tool -change /original/path @loader_path/relative/path /path/to/bundled/framework/binary
/original/path will be the /Library/Frameworks path to the binary file of the framework.
the relative path is relative from the binary file in the framework, so you will need to back out with a few ../
Of course, your app should know how to redirect GDAL to the bundled copies of its support files, or it will try to find them in the compiled in /Library/Frameworks path. The UnixImageIO framework also has support files for the geotiff library that will have to be redirected if used.
On Jan 26, 2015, at 6:07 PM, Michael Katz - NOAA Affiliate <michael.katz at noaa.gov> wrote:
> I am using the GDAL 1.11 Complete build for Mac found here: http://www.kyngchaos.com/software/frameworks.
>
> I am installing my .app bundle in /Applications (or rather the user is installing it there via a drag-and-drop .dmg), and I don't want the user to have to install anything to /Library/Frameworks.
>
> However, it appears that something inside the GDAL library is referencing /Library/Frameworks/UnixImageIO.framework as an absolute path, and I haven't been able to find a way to tell it to reference that framework from its location within my .app bundle instead.
>
> The result is that certain files, such as .tif files, are not handled correctly (e.g., I cannot get the bounding world rect of a georeferenced .tif file when /Library/Frameworks/UnixImageIO.framework is not present, but can get it when /Library/Frameworks/UnixImageIO.framework is present).
>
> I looked at the QGIS installer, but that requires you to install GDAL plus UnixImageIO to /Library/Frameworks explicitly, so that didn't help.
>
> I understand this Mac build of GDAL is done by William Kyngesburye, and is not part of the official GDAL build, but I couldn't find a way to get in touch with Kyngesburye directly and I thought someone on this list might have faced this problem.
>
> Thanks for any help.
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/
Earth: "Mostly harmless"
- revised entry in the HitchHiker's Guide to the Galaxy
More information about the gdal-dev
mailing list