[gdal-dev] Macintosh GDAL library looks for UnixImageIO framework in default location only?

Michael Katz - NOAA Affiliate michael.katz at noaa.gov
Tue Jan 27 14:41:56 PST 2015


We have resolved the  issue.

My problem statement was misleading. Our program was not having trouble
finding a library, but rather the libgeotiff library was having trouble
finding its data files, which came out in opensnoop as failures to open:

1698751227   2095 MARPLOT_server  39
/Library/Frameworks/UnixImageIO.framework/Versions/E/Resources/epsg_csv/pcs.override.csv
1698751227   2095 MARPLOT_server  39
/Library/Frameworks/UnixImageIO.framework/Versions/E/Resources/epsg_csv/pcs.csv
1698751227   2095 MARPLOT_server  39
/Library/Frameworks/UnixImageIO.framework/Versions/E/Resources/epsg_csv/projop_wparm.csv

So I learned that in the build of UnixImageIO.framework, in
buildfw-uiio.sh, it uses a hard-coded path to /Library/Frameworks as the
prefix for the --data-dir parameter used in building geotiff, which becomes
CSV_DATA_DIR in geotiff's cpl_csv_c. But that file also shows that the
environment variable GEOTIFF_CSV can be defined to override CSV_DATA_DIR,
so we are doing that now with a setenv() call, and it works.

So for users like me who want to bundle GDAL into a standalone app, it
would help include a note about this gotcha, perhaps in the UnixImageIO
section of your "Unix Compatibility Frameworks" page.



On Mon, Jan 26, 2015 at 8:17 PM, William Kyngesburye <woklist at kyngchaos.com>
wrote:

> 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
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20150127/cfa7cd40/attachment-0001.html>


More information about the gdal-dev mailing list