Skip to content

Instantly share code, notes, and snippets.

@jctull
Created November 10, 2013 20:42
Show Gist options
  • Save jctull/7403665 to your computer and use it in GitHub Desktop.
Save jctull/7403665 to your computer and use it in GitHub Desktop.
FileGDB support in gdal for OS X 10.9 Mavericks
Here's what worked for me with some links to forums and such that helped me resolve this issue:
For gdal to be able to use FileGDB, I had to specify the use of gcc-4.9, and this has to be separately installed with 'brew install homebrew/versions/gcc49'.
I built netcdf as
brew install https://raw.github.com/nickrobison/homebrew-science/27713e03d8618983b44ba0b3ed21759eccae785b/netcdf.rb
I used a custom gdal formula linked in the install command below that doesn't force using netcdf from homebrew/science (if the above gets committed this patch is not needed) and adds 'cxxstdlib_check :skip' in the def install portion of the formula.
A solution for getting FileGDB support working with the current 1.3 api from ESRI is from this forum:
http://forums.arcgis.com/threads/95958-OS-X-Mavericks.
Once gcc-4.9 was installed ('brew install --enable-cxx homebrew/versions/gcc49'), I had to rebuild libdap with gcc-4.9 and then gdal with these commands to get a working gdal with FileGDB support:
brew install libdap --cc="gcc-4.9"
brew install https://gist.github.com/jctull/05cced0f6f82b7779f0a/raw/gdal.rb --enable-mdb --enable-unsupported --complete --enable-armadillo --with-postgres --with-postgresql -v --cc="gcc-4.9"
Finally, I had to run install_name_tool to point the FileGDB libs at the correct gcc-4.9 supplied libs:
install_name_tool -change /usr/lib/libstdc++.6.dylib /usr/local/Cellar/gcc49/4.9-20131103/lib/gcc/x86_64-apple-darwin13.0.0/4.9.0/libstdc++.dylib /usr/local/opt/FileGDB_API/lib/libFileGDBAPI.dylib
install_name_tool -change /usr/lib/libstdc++.6.dylib /usr/local/Cellar/gcc49/4.9-20131103/lib/gcc/x86_64-apple-darwin13.0.0/4.9.0/libstdc++.dylib /usr/local/opt/FileGDB_API/lib/libfgdbunixrtl.dylib
@smnorris
Copy link

smnorris commented Jan 1, 2014

Thanks for posting this. I thought I had it working as gdal compiled successfully, but ogrinfo on a .gdb bails with this message.

ogrinfo(45386,0x7fff74779310) malloc: *** error for object 0x10b49dde0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

I wonder if I should go back to 10.8!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment