Skip to content
Permalink
Browse files
OS X install update - osgearth and globe plugin
  • Loading branch information
kyngchaos committed Apr 7, 2012
1 parent 59a08c4 commit eca69c2cf3fcc464c887dca759c7609f67b29e9d
Showing with 398 additions and 100 deletions.
  1. +123 −36 INSTALL
  2. +155 −39 doc/INSTALL.html
  3. +120 −25 doc/osx.t2t
159 INSTALL
@@ -1,10 +1,10 @@
Quantum GIS (QGIS)
Building QGIS from source - step by step
Wednesday April 04, 2012
Saturday April 07, 2012


Last Updated: Wednesday April 04, 2012
Last Change : Monday December 26, 2011
Last Updated: Saturday April 07, 2012
Last Change : Saturday April 07, 2012


1. Introduction
@@ -26,8 +26,8 @@ Last Change : Monday December 26, 2011
5. Building on MacOS X
5.1. Install Developer Tools
5.2. Install Qt4 from disk image
5.3. Install development frameworks for QGIS dependencies
5.4. Install CMake for OSX
5.3. Install CMake for OSX
5.4. Install development frameworks for QGIS dependencies
5.5. QGIS source
5.6. Configure the build
5.7. Building
@@ -1245,7 +1245,25 @@ may need some help by adding '-L/usr/local/lib' to CMAKE_SHARED_LINKER_FLAGS,
CMAKE_MODULE_LINKER_FLAGS and CMAKE_EXE_LINKER_FLAGS in the cmake build.


5.3. Install development frameworks for QGIS dependencies
5.3. Install CMake for OSX
==========================

Get the latest source release from here:

http://www.cmake.org/cmake/resources/software.html

Binary installers are available for OS X, but they are not recommended
(2.4 versions install in /usr instead of /usr/local, and 2.6+ versions are a
strange application). Instead, download the source.
NOTE: 2.8.5 is broken for detecting part of Qt. Fixed in 2.8.6.
Double-click the source tarball, then cd to the source folder and:

./bootstrap --docdir=/share/doc/CMake --mandir=/share/man
make
sudo make install


5.4. Install development frameworks for QGIS dependencies
=========================================================

Download William Kyngesburye's excellent GDAL Complete package that includes
@@ -1271,7 +1289,7 @@ Old versions of these packages for older systems are available in the
software archive section.


5.3.1. Additional Dependencies: General compatibility note
5.4.1. Additional Dependencies: General compatibility note
==========================================================

There are some additional dependencies that, at the time of writing, are not
@@ -1286,7 +1304,7 @@ Stable release versions are preferred. Beta and other development versions may
have problems and you are on your own with those.


5.3.2. Additional Dependencies: Expat
5.4.2. Additional Dependencies: Expat
=====================================

Snow Leopard+ note: Snow Leopard includes a usable expat, so this step is
@@ -1304,7 +1322,7 @@ source folder and:
sudo make install


5.3.3. Additional Dependencies: Python
5.4.3. Additional Dependencies: Python
======================================

Leopard+ note: Starting with Leopard a usable Python is included
@@ -1321,7 +1339,7 @@ Python 3 is a major change, and may have compatibility issues, so try it at
your own risk.


5.3.4. Additional Dependencies: SIP
5.4.4. Additional Dependencies: SIP
===================================

Retrieve the python bindings toolkit SIP from
@@ -1380,7 +1398,7 @@ Then continue with compilation and installation:
sudo make install


5.3.5. Additional Dependencies: PyQt
5.4.5. Additional Dependencies: PyQt
====================================

Retrieve the python bindings toolkit for Qt from
@@ -1435,7 +1453,7 @@ QtOpenGL/makefile and add -undefined dynamic_lookup to LFLAGS.
Then make again.


5.3.6. Additional Dependencies: Qwt
5.4.6. Additional Dependencies: Qwt
===================================

The GPS tracking feature uses Qwt.
@@ -1461,7 +1479,7 @@ The Qwt shared library is now installed in /usr/local/qwt-5.x.x (x.x is
the minor.point version). Remember this for QGIS configuration.


5.3.7. Additional Dependencies: Bison
5.4.7. Additional Dependencies: Bison
=====================================

The version of bison available by default on Mac OS X is too old so you
@@ -1477,23 +1495,92 @@ tarball to unpack it, then cd to the source folder and:
sudo make install


5.4. Install CMake for OSX
==========================
5.4.8. Additional Dependencies: OSG & osgEarth
==============================================

Get the latest source release from here:
If you want the Globe plugin in QGIS (default OFF), OSG and osgEarth are needed.

http://www.cmake.org/cmake/resources/software.html
First, OpenSceneGraph. The main site is:

Binary installers are available for OS X, but they are not recommended
(2.4 versions install in /usr instead of /usr/local, and 2.6+ versions are a
strange application). Instead, download the source.
NOTE: 2.8.5 is broken for detecting part of Qt. Fixed in 2.8.6.
Double-click the source tarball, then cd to the source folder and:
http://www.openscenegraph.org/

./bootstrap --docdir=/share/doc/CMake --mandir=/share/man
Get the tarball (or zip) for the the latest 3.x version.
Binary availability is unknown at this time as the site is down.

Another place to get the source is github:

http://github.com/openscenegraph/osg/tags

Download the latest 3.1 version (you can select a tarball when you hover over
the entry). Double-click the source tarball to unpack it.
(There is a version numbering oddity in the source, but since we'll be
bundling OSG as it's meant to be, it really doesn't matter).

Installation is a bit out of touch with OS X standards, so we'll stage it to a
temporary location first. You could stage it to the folder that the OSG source
folder is in, or a common staging area like /Users/Shared/unix/osg. Pick a
folder not hidden and that doesn't need admin permissions to write to for simplicity.

In a new Terminal cd to the source folder and:

mkdir build
cd build
cmake -D CMAKE_INSTALL_PREFIX=/path/to/some/staging/folder \
-D OSG_COMPILE_FRAMEWORKS=ON \
-D OSG_PLUGIN_SEARCH_INSTALL_DIR_FOR_PLUGINS=OFF \
..
make
make install
sudo mkdir -p "/Library/Application Support/OpenSceneGraph/PlugIns"

Enter the staging path you chose for the CMAKE_INSTALL_PREFIX option above.

Now move all .frameworks from the lib/ folder in the staging area to /Library/Frameworks. Move the files in the osgPlugins folder in the lib/ folder
to /Library/Application Support/OpenSceneGraph/PlugIns. The bin/ executables
can be left where they are, we don't need them.

Next up is libzip. Get the latest tarball at:

http://nih.at/libzip/

Double-click the source tarball to unpack it.
In a new Terminal cd to the source folder and:

./configure --disable-dependency-tracking --disable-shared CFLAGS=-Os
make
sudo make install

Then it's time for osgEarth. Downloads are also on github:

http://github.com/gwaldron/osgearth/tags

Download a tarball for the latest stable release (sorting can be confusing here).
Double-click the source tarball to unpack it.

This one also needs an intermediate staging area. Choose a folder similar to OSG.

In a new Terminal cd to the source folder and:

mkdir build
cd build
export PATH="/path/to/osg/staging/folder/bin:$PATH"
cmake -D CMAKE_INSTALL_PREFIX=/path/to/some/staging/folder \
-D CMAKE_BUILD_TYPE=MinSizeRel \
-D OSGEARTH_BUILD_FRAMEWORKS=true \
..
make
make install
sudo mkdir -p "/Library/Application Support/OpenSceneGraph/Headers"

Enter the staging path you chose for the CMAKE_INSTALL_PREFIX option above.
Also enter the OSG staging path /bin folder in the export above.

Move all the .frameworks from the lib/ folder to /Library/Frameworks.
Move the files in the osgPlugins folder in the lib/ folder to
/Library/Application Support/OpenSceneGraph/PlugIns. Move the osgEarthDrivers
folder in the include/ folder to /Library/Application Support/OpenSceneGraph/Headers. And as for OSG, you can leave the bin/
executables where they are.


5.5. QGIS source
================
@@ -1527,8 +1614,8 @@ In a Terminal cd to the qgis source folder previously downloaded, then:
mkdir build
cd build
cmake -D CMAKE_INSTALL_PREFIX=~/Applications \
-D CMAKE_BUILD_TYPE=MinSizeRel \
-D WITH_INTERNAL_SPATIALITE=FALSE \
-D CMAKE_BUILD_TYPE=MinSizeRel -D ENABLE_TESTS=FALSE \
-D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_PYSPATIALITE=FALSE \
-D QWT_LIBRARY=/usr/local/qwt-5.2.2/lib/libqwt.dylib \
-D QWT_INCLUDE_DIR=/usr/local/qwt-5.2.2/include \
-D BISON_EXECUTABLE=/usr/local/bin/bison \
@@ -1549,8 +1636,8 @@ script and add arch flags to the configuration:
sudo chmod +x /usr/local/bin/python32

cmake -D CMAKE_INSTALL_PREFIX=~/Applications -D \
-D CMAKE_BUILD_TYPE=MinSizeRel \
-D WITH_INTERNAL_SPATIALITE=FALSE \
-D CMAKE_BUILD_TYPE=MinSizeRel -D ENABLE_TESTS=FALSE \
-D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_PYSPATIALITE=FALSE \
-D QWT_LIBRARY=/usr/local/qwt-5.2.1-svn/lib/libqwt.dylib \
-D QWT_INCLUDE_DIR=/usr/local/qwt-5.2.1-svn/include \
-D BISON_EXECUTABLE=/usr/local/bin/bison \
@@ -1567,19 +1654,19 @@ the above configuration:
On Lion you are on your own to figure out how to install libfcgi and add fcgi
support to the system Apache. Not recommended for the average user.

Bundling note: Older Qt versions may have problems with some Qt plugins and
QGIS. The way to handle this is to bundle Qt inside the QGIS application. You
can do this now or wait to see if there are immediate crashes when running QGIS.
It's also a good idea to bundle Qt if you need to copy QGIS to other Macs (where
you would have to install Xcode just so Qt would install!).
If you want the Globe plugin (and you compiled and installed OSG/osgEarth),
add the following lines before the last line in the above configuration:

To bundle Qt, add the following line before the last line (the ".." line) in
the above cmake configurations:
-D WITH_GLOBE=true \
-D OSGEARTH_INCLUDE_DIR="/Library/Application Support/OpenSceneGraph/Headers" \
-D OSG_PLUGINS_PATH="/Library/Application Support/OpenSceneGraph/PlugIns" \

-D QGIS_MACAPP_BUNDLE=1 \
Bundling note: Older Qt versions may have problems with some Qt plugins and
QGIS. The way to handle this is to bundle Qt inside the QGIS application. The
default is to bundle Qt (and osg/osgEarth, if configured).

Even better for distribution purposes, to also bundle any extra non-framework,
non-standard, libs (ie postgres' libpq) bump the bundle number to 2:
non-standard, libs (ie postgres' libpq) set the bundle value to 2:

-D QGIS_MACAPP_BUNDLE=2 \

0 comments on commit eca69c2

Please sign in to comment.