Skip to content

Instantly share code, notes, and snippets.

@jctull
Last active June 10, 2017 23:59
Show Gist options
  • Save jctull/f4d620cd5f1560577d17 to your computer and use it in GitHub Desktop.
Save jctull/f4d620cd5f1560577d17 to your computer and use it in GitHub Desktop.
Homebrew qgis on 10.9 notes
Mavericks QGIS
Last revised 10 November 2013
As of this writing, I am able to build many of the required dependencies for QGIS, but some add-on functionalilty is missing (i.e., gdal drivers and saga-gis as noted below). QGIS requires a flag to skip the libc++ check as in the qgis.rb linked below.
These notes assume you are starting with a clean (i.e., new) homebrew on OS X 10.9 Mavericks. Rather than trying to work through the complexity of tracking library compatibility problems when migrating homebrew from 10.8 to 10.9, it is simple to start from scratch. Be sure to copy your postgresql database and restore it if you rely on that for data needs (i.e., 'pg_dumpall > yourdata' followed by 'psql -f yourdata postgres' after you've reinstalled postgresql/postgis and created your new, empty postgres with 'initdb /usr/local/var/postgres -E utf8').
Additional build issues and requirements that I encountered:
I had to build a custom qt per the issue with Mavericks noted https://github.com/mxcl/homebrew/pull/23793. For newer machines, the --without-ssse3 command may be required, and qt trunk has to be built as Maverick-related patches are incorporated there but not in a release yet.
brew install https://raw.github.com/cliffrowley/homebrew/patched_qt_libcpp/Library/Formula/qt.rb --HEAD
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. There were several failed deps for additional gdal or qgis functionality, including:
I built netcdf as:
brew install https://raw.github.com/nickrobison/homebrew-science/27713e03d8618983b44ba0b3ed21759eccae785b/netcdf.rb
I used a custom gdal formula linked in this command that doesn't force using netcdf from homebrew/science (if the above netcdf formula 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 contained in the ESRI forum linked above. Once gcc-4.9 was installed ('brew install --enable-cxx homebrew/versions/gcc49'), I had to rebuild several dependencies with gcc-4.9 and 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"
Then, I had to run install_name_tool to point the FileGDB libs at these 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
I made a custom saga-gis that works for me:
brew install --disable-gui https://gist.github.com/jctull/de304349418067969ab0/raw/saga-gis.rb
To get globe working, a number of patches from dakcarto provide a working solution:
brew install open-scene-graph
brew install https://raw.github.com/dakcarto/homebrew/b303c1756df75844892a4911311f046dca8cbdf9/Library/Formula/minizip.rb
brew install --with-minizip --HEAD https://raw.github.com/dakcarto/homebrew/b46d8372a379f7f55c5bb3ca2484fc47a518ed0c/Library/Formula/osgearth.rb
For python, you need to use ‘pip install’ for psycopg2, numpy and scipy – and you have to install gfortran from homebrew as it is required by one of these (numpy?) to build. Mavericks Python is version 2.7, so no need to install Hombrew Python as it is the same version.
Finally, install QGIS:
brew install --with-grass --with-postgis -v --HEAD https://gist.github.com/jctull/9e9f81074a9ed2dfac22/raw/qgis.rb
If you want globe functionality, add the '--with-globe' option to the brew install command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment