Install GDAL on Mac OS X (Mavericks)

I have Quantum GIS on my Mac.

I also used to have GDAL – or rather, I do have GDAL, because QGIS does not work without GDAL?

However I’ve been unable to use GDAL recently.  So, I went to install it again. 

The first time, I think I went through Kyngchaos. Which was not easy. 

The second time, now, I’m going to use Homebrew. Because it is easier.  

Actually it’s outlined here: https://trac.osgeo.org/gdal/wiki/BuildingOnMac

Here’s what I did:

tjessel:~ apple$ brew install gdal

Then it does all this stuff:


 

==> Installing dependencies for gdal: giflib, lzlib, proj, libgeotiff, ge

==> Installing gdal dependency: giflib

==> Downloading https://downloads.sourceforge.net/project/giflib/giflib-4.x/gifl

######################################################################## 100.0%

==> ./configure –prefix=/usr/local/Cellar/giflib/4.1.6

==> make install

🍺  /usr/local/Cellar/giflib/4.1.6: 39 files, 720K, built in 69 seconds

==> Installing gdal dependency: lzlib

==> Downloading http://download.savannah.gnu.org/releases/lzip/lzlib-1.5.tar.gz

######################################################################## 100.0%

==> ./configure –prefix=/usr/local/Cellar/lzlib/1.5 CC=clang CFLAGS=

==> make

==> make check

==> make install

🍺  /usr/local/Cellar/lzlib/1.5: 9 files, 152K, built in 8 seconds

==> Installing gdal dependency: proj

==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/proj-4.8.0.

######################################################################## 100.0%

==> Pouring proj-4.8.0.mavericks.bottle.tar.gz

🍺  /usr/local/Cellar/proj/4.8.0: 47 files, 5.7M

==> Installing gdal dependency: libgeotiff

==> Downloading http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-1.4.0.ta

######################################################################## 100.0%

==> ./configure –prefix=/usr/local/Cellar/libgeotiff/1.4.0 –with-libtiff=/usr/

==> make

==> make install

🍺  /usr/local/Cellar/libgeotiff/1.4.0: 70 files, 5.8M, built in 37 seconds

==> Installing gdal dependency: geos

==> Downloading http://download.osgeo.org/geos/geos-3.4.2.tar.bz2

######################################################################## 100.0%

==> ./configure –prefix=/usr/local/Cellar/geos/3.4.2

==> make install


 

The installation stopped here for a while. 

 3:32 PM. Seems to be hung up.  Maybe I should give it some time? Seems to have finished up at 3:42 or so.

I’m pasting the rest here: 


 

🍺  /usr/local/Cellar/geos/3.4.2: 385 files, 8.4M, built in 10.4 minutes

==> Installing gdal dependency: freexl

==> Downloading http://www.gaia-gis.it/gaia-sins/freexl-1.0.0g.tar.gz

######################################################################## 100.0%

==> ./configure –prefix=/usr/local/Cellar/freexl/1.0.0g

==> make install

🍺  /usr/local/Cellar/freexl/1.0.0g: 10 files, 144K, built in 25 seconds

==> Installing gdal dependency: libxml2

==> Downloading ftp://xmlsoft.org/libxml2/libxml2-2.9.1.tar.gz

######################################################################## 100.0%

==> ./configure –prefix=/usr/local/Cellar/libxml2/2.9.1 –without-python

==> make

==> make install

==> python setup.py install –prefix=/usr/local/Cellar/libxml2/2.9.1

creating build/temp.macosx-10.9-intel-2.7

clang -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -D_REENTRANT=1 -I/usr/local/Cellar/libxml2/2.9.1/include/libxml2 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c libxml2-py.c -o build/temp.macosx-10.9-intel-2.7/libxml2-py.o

clang: error: unknown argument: ‘-mno-fused-madd’ [-Wunused-command-line-argument-hard-error-in-future]

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

error: command ‘clang’ failed with exit status 1

Error: Homebrew doesn’t know what compiler versions ship with your version

of Xcode (5.1.1). Please `brew update` and if that doesn’t help, file

an issue with the output of `brew –config`:

  https://github.com/Homebrew/homebrew/issues

Note that we only track stable, released versions of Xcode.

Thanks!

READ THIS: https://github.com/Homebrew/homebrew/wiki/troubleshooting


 

So that was a lot easier than I remember the Kyngchaos method… I hope that this works. I think I need to check the version. 

I think this is how you do it. 

http://www.gdal.org/gdal-config.html

It’s possible I missed a key step, because I typed “gdal-config –version” and did not get anything back… I dug through some old notes and found a link to this site:

https://sites.google.com/site/eospansite/installinggdalonmacosx

Which said a final step was to open the Terminal and type in:

export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH

Seems to have worked; I typed in gdal-config –version and got a result:

tjessel:~ apple$ gdal-config –version

1.10.1

Hopefully this means my GDAL installation is working again!

Advertisements

About Tanner Jessel

I am a recent M.S. in Information Science graduate from the University of Tennessee School of Information Science. I was formerly a graduate research assistant funded by DataONE (Data Observation Network for Earth). Prior, I worked for four years as a content lead and biodiversity scientist with the U.S. Geological Survey's Biodiversity Informatics Program. Building on my work experience in biodiversity and environmental informatics, my work with DataONE focused on exploring the nature of scientific collaborations necessary for scientific inquiry. I also conducted research concerning user experience and usability, and assisted in development of member nodes with an emphasis on spatial data and infrastructure. I assisted with research designed to understand sociocultural issues within collaborative research communities. Through August 1, 2014, I was based at the Center for Information and Communication Studies at the University of Tennessee School of Information Science in Knoxville, Tennessee.

Posted on August 13, 2014, in Personal Life, Research. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: