11Quantum GIS (QGIS)
22Building QGIS from source - step by step
3- Friday January 04 , 2013
3+ Monday April 01 , 2013
44
55
6- Last Updated: Friday January 04 , 2013
7- Last Change : Friday January 04, 2013
6+ Last Updated: Monday April 01 , 2013
7+ Last Change : Saturday December 08, 2012
88
99
1010 1. Introduction
@@ -650,8 +650,9 @@ box, browse to the top level QGIS directory.
650650In the Where to build the binaries: box, browse to the 'build' directory you
651651created.
652652
653- Adjust the path to bison and flex so that the shortened C:/Progra~1 is used
654- rather than C:/Program Files.
653+ If the path to bison and flex contains blanks, you need to use the short name
654+ for the directory (i.e. C:\Program Files should be rewritten to
655+ C:\Progra~n, where n is the number as shown in `dir /x C:\``).
655656
656657Verify that the 'BINDINGS_GLOBAL_INSTALL' option is not checked, so that python
657658bindings are placed into the output directory when you run the INSTALL target.
@@ -1225,7 +1226,10 @@ On Lion and Mt. Lion, using Xcode 4.4+, the developer command line tools can be
12251226installed via the Xcode preferences. The tools now appear to require an install
12261227of Xcode, regardless of using a separate DMG installer for just the tools.
12271228
1228- Xcode 4.4+ also introduces the clang frontend to the LLVM compiler as default.
1229+ Xcode 4.3+ also introduces the clang frontend to the LLVM compiler as default.
1230+
1231+ Note: In XCODE 4.5 installed from the app store, you need to install the
1232+ command line tools from XCode -> Preferences -> Downloads and choose command line tools.
12291233
12301234http://clang.llvm.org/
12311235
@@ -1243,7 +1247,7 @@ If you have trouble building some of the dependencies listed below with clang
12431247 5.2. Install Qt4 from disk image
12441248 ================================
12451249
1246- You need a minimum of Qt-4.4.0. I suggest getting the latest. There is no need
1250+ You need a minimum of Qt-4.4.0. I suggest getting the latest (Qt 4, not 5) . There is no need
12471251for the full Qt SDK, so save yourself some download time and get the frameworks
12481252only. This is available in the Libraries section of the Qt download page.
12491253
@@ -1253,15 +1257,17 @@ support in the Qt Cocoa branch. Appropriate installers are available for both
12531257as of Qt-4.5.2, though they stopped making Carbon packages at Qt 4.7.4.
12541258Qt 4.6+ is recommended for Cocoa.
12551259Starting with Lion, Carbon may not work properly, if at all.
1260+ Starting with Qt 4.8, only 64bit Cocoa installers are available.
12561261
1257- Mt. Lion note: Any Qt version < 4.8.3 will cause a 'This version of Mac OS X
1258- is unsupported' error when building QGIS.
1262+ General note: Support for new system versions in any given Qt version may
1263+ not be present and may cause a 'This version of Mac OS X
1264+ is unsupported' error when building QGIS. Try the next Qt version.
12591265
12601266PPC note: The readymade Qt Cocoa installers don't include PPC support, you'd
12611267have to compile Qt yourself. But, there appear to be issues with Qt Cocoa on
12621268PPC Macs anyways. Qt Carbon is recommended on PPC Macs.
12631269
1264- http://qt.nokia.com /downloads
1270+ http://qt-project.org /downloads
12651271
12661272If you want debug frameworks, Qt also provides a separate download with these.
12671273These are in addition to the non-debug frameworks.
@@ -1273,7 +1279,7 @@ of the download page. Files are in the qt/source (yes, even the binary packages
12731279Once downloaded open the disk image and run the installer. Note you need admin
12741280privileges to install.
12751281
1276- Leopard note: Qt includes a couple non-framework libraries in /usr/lib.
1282+ Leopard+ note: Qt includes a couple non-framework libraries in /usr/lib.
12771283When using a system SDK these libraries will not be found. To fix this problem,
12781284add symlinks to /usr/local:
12791285
@@ -1296,7 +1302,7 @@ Binary installers are available for OS X, but they are not recommended
12961302(2.4 versions install in /usr instead of /usr/local, and 2.6+ versions are a
12971303strange application). Instead, download the source.
12981304NOTE: 2.8.5 is broken for detecting part of Qt. Fixed in 2.8.6.
1299- Double-click the source tarball, then cd to the source folder and:
1305+ Double-click the source tarball to unpack it , then cd to the source folder and:
13001306
13011307 ./bootstrap --docdir=/share/doc/CMake --mandir=/share/man
13021308 make -j [#cpus]
@@ -1347,9 +1353,9 @@ osgEarth), try bypassing ccache.
13471353
13481354Download William Kyngesburye's excellent GDAL Complete package that includes
13491355PROJ, GEOS, GDAL, SQLite3, Spatialite, and image libraries, as frameworks.
1350- There is also a GSL framework .
1356+ There are also GSL and FreeType frameworks .
13511357
1352- http://www.kyngchaos.com/wiki/ software/frameworks
1358+ http://www.kyngchaos.com/software/frameworks
13531359
13541360Once downloaded, open and install the frameworks.
13551361
@@ -1358,11 +1364,11 @@ support). QGIS just needs the libpq client library, so unless you want to
13581364setup the full Postgres + PostGIS server, all you need is the client-only
13591365package. It's available here:
13601366
1361- http://www.kyngchaos.com/wiki/ software/postgres
1367+ http://www.kyngchaos.com/software/postgres
13621368
13631369Also available is a GRASS application:
13641370
1365- http://www.kyngchaos.com/wiki/ software/grass
1371+ http://www.kyngchaos.com/software/grass
13661372
13671373Old versions of these packages for older systems are available in the
13681374software archive section.
@@ -1387,7 +1393,7 @@ have problems and you are on your own with those.
13871393 =====================================
13881394
13891395Snow Leopard+ note: Snow Leopard includes a usable expat, so this step is
1390- not necessary on Snow Leopard or Lion .
1396+ not necessary on Snow Leopard or above .
13911397
13921398Get the expat sources:
13931399
@@ -1420,7 +1426,7 @@ source folder and:
14201426 ======================================
14211427
14221428Leopard+ note: Starting with Leopard a usable Python is included
1423- in the system. This Python 2.5, 2.6 and 2.7, respectively for Leo, Snow and Lion.
1429+ in the system. This is Python 2.5, 2.6 and 2.7, respectively for Leo, Snow and Lion+ .
14241430So there is no need to install Python on Leopard and newer.
14251431You can still install Python from python.org if preferred.
14261432
@@ -1475,11 +1481,10 @@ For 64-bit Qt (Qt Cocoa), use this configure line:
14751481 python2.6 configure.py -n -d /Library/Python/2.6/site-packages -b /usr/local/bin \
14761482 -e /usr/local/include -v /usr/local/share/sip --arch=x86_64 -s MacOSX10.6.sdk
14771483
1478- Lion system Python
1484+ Lion+ system Python
14791485
14801486Similar to Snow Leopard, you should install outside the system Python path.
1481- There is no need for the SDK option (the CLI tools for Lion don't include SDKs)
1482- or arch option:
1487+ There is no need for the SDK option or arch option:
14831488
14841489 python2.7 configure.py -d /Library/Python/2.7/site-packages -b /usr/local/bin \
14851490 -e /usr/local/include -v /usr/local/share/sip
@@ -1519,14 +1524,14 @@ Edit QScintilla-gpl-2.x.x/Qt4Qt5/qscintilla.pro in the following manner:
15191524 target.path = $$[QT_INSTALL_LIBS] --> target.path = /usr/local/lib
15201525 header.path = $$[QT_INSTALL_HEADERS] --> header.path = /usr/local/include
15211526
1522- Save the qscintilla.pro file and build the QScintilla2 C++ library:
1527+ Save the qscintilla.pro file and build the QScintilla2 C++ library (adjust the install_name_tool command for the version installed) :
15231528
15241529 qmake -spec macx-g++ qscintilla.pro
15251530 make -j [#cpus]
15261531 sudo make install
15271532
1528- sudo install_name_tool -id /usr/local/lib/libqscintilla2.8 .dylib \
1529- /usr/local/lib/libqscintilla2.8 .dylib
1533+ sudo install_name_tool -id /usr/local/lib/libqscintilla2.9 .dylib \
1534+ /usr/local/lib/libqscintilla2.9 .dylib
15301535
15311536This installs QScintilla2's dylib in /usr/local/lib/ and the header files in
15321537/usr/local/include/Qsci/, both of which should be automatically found when
@@ -1585,7 +1590,7 @@ For 64-bit Qt (Qt Cocoa), use this configure line:
15851590
15861591 python2.6 configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin --use-arch x86_64
15871592
1588- Lion system Python
1593+ Lion and Mt. Lion system Python
15891594
15901595Similar to Snow Leopard, you should install outside the system Python path.
15911596But you don't need the arch option:
@@ -1606,12 +1611,16 @@ Then make again.
16061611 =========================================================
16071612
16081613This will create the Qsci.so module in /Library/Python/2.x/site-packages/PyQt4.
1614+ Like PyQt, it needs help to not install in system locations.
16091615
16101616Snow Leopard: substitute '2.6' for Python version
16111617
16121618 cd <QScintilla2 source dir>
16131619 cd Python
1614- python2.7 configure.py -o /usr/local/lib -n /usr/local/include
1620+ python2.7 configure.py -o /usr/local/lib -n /usr/local/include \
1621+ -d /Library/Python/2.7/site-packages/PyQt4 -v /usr/local/share/sip/PyQt4 \
1622+ --pyqt-sipdir=/usr/local/share/sip/PyQt4
1623+ qmake -spec macx-g++ Qsci.pro
16151624 make -j [#cpus]
16161625 sudo make install
16171626
@@ -1651,7 +1660,26 @@ Qwt 6.x.x is similarly built, but defaults to being installed as a framework:
16511660 qmake -spec macx-g++
16521661 make -j [#cpus]
16531662 sudo make install
1654-
1663+
1664+ TODO: Remedy for :
1665+
1666+ shrub:qwt-6.1-rc3 timlinux$ sudo make install
1667+ Password:
1668+ cd src/ && make -f Makefile install
1669+ rm -f -r "/usr/local/qwt-6.1.0-rc3/lib/qwt.framework"
1670+ cp -f -R "../lib/qwt.framework" "/usr/local/qwt-6.1.0-rc3/lib/qwt.framework"
1671+ cp -f -R /Users/timlinux/dev/cpp/qwt-6.1-rc3/doc/html /usr/local/qwt-6.1.0-rc3/doc/
1672+ cp -f -R /Users/timlinux/dev/cpp/qwt-6.1-rc3/doc/man /usr/local/qwt-6.1.0-rc3/doc/
1673+ cd textengines/ && make -f Makefile install
1674+ make[1]: Nothing to be done for `install'.
1675+ cd designer/ && make -f Makefile install
1676+ rm -f libqwt_designer_plugin.dylib
1677+ linking plugins/designer/libqwt_designer_plugin.dylib
1678+ ld: library not found for -lqwt
1679+ collect2: ld returned 1 exit status
1680+ make[1]: *** [plugins/designer/libqwt_designer_plugin.dylib] Error 1
1681+ make: *** [sub-designer-install_subtargets-ordered] Error 2
1682+
16551683 sudo install_name_tool -id /usr/local/qwt-6.0.1/lib/qwt.framework/Versions/6/qwt \
16561684 /usr/local/qwt-6.0.1/lib/qwt.framework/Versions/6/qwt
16571685
@@ -1713,14 +1741,8 @@ tarball to unpack it, then cd to the source folder and:
17131741
17141742If you want the Globe plugin in QGIS (default OFF), OSG and osgEarth are needed.
17151743
1716- First, OpenSceneGraph. The main site is:
1717-
1718- http://www.openscenegraph.org/
1719-
1720- Get the tarball (or zip) for the the latest 3.x version.
1721- Binary availability is unknown at this time as the site is down.
1722-
1723- Another place to get the source is github:
1744+ First, OpenSceneGraph. The main site is very out of date, just go to
1745+ github:
17241746
17251747http://github.com/openscenegraph/osg/tags
17261748
@@ -1734,13 +1756,39 @@ temporary location first. You could stage it to the folder that the OSG source
17341756folder is in, or a common staging area like /Users/Shared/unix/osg. Pick a
17351757folder not hidden and that doesn't need admin permissions to write to for simplicity.
17361758
1759+ If you are building on Leopard, its configure forces a old ppc/i386 32bit build.
1760+ If you want 64bit you need to fix CMakeLists.txt - in a text editor, find the
1761+ if-block that starts with:
1762+
1763+ ELSEIF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.6" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.5")
1764+
1765+ In that section before the next ELSEIF, change:
1766+
1767+ ppc;i386
1768+
1769+ to:
1770+
1771+ i386;x86_64
1772+
1773+ and change:
1774+
1775+ mmacosx-version-min=10.5
1776+
1777+ to:
1778+
1779+ mmacosx-version-min=10.6
1780+
17371781In a new Terminal cd to the source folder and:
17381782
17391783 mkdir build
17401784 cd build
17411785 cmake -D CMAKE_INSTALL_PREFIX=/path/to/some/staging/folder \
17421786 -D OSG_COMPILE_FRAMEWORKS=ON \
17431787 -D OSG_PLUGIN_SEARCH_INSTALL_DIR_FOR_PLUGINS=OFF \
1788+ -D JASPER_LIBRARY=/Library/Frameworks/UnixImageIO.framework \
1789+ -D JASPER_INCLUDE_DIR=/Library/Frameworks/UnixImageIO.framework/Headers \
1790+ -D TIFF_LIBRARY=/Library/Frameworks/UnixImageIO.framework \
1791+ -D TIFF_INCLUDE_DIR=/Library/Frameworks/UnixImageIO.framework/Headers \
17441792 ..
17451793 make
17461794 make install
@@ -1750,7 +1798,7 @@ Enter the staging path you chose for the CMAKE_INSTALL_PREFIX option above.
17501798
17511799Now 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
17521800to /Library/Application Support/OpenSceneGraph/PlugIns. The bin/ executables
1753- can be left where they are, we don't need them .
1801+ can be left where they are.
17541802
17551803Next up is libzip. Get the latest tarball at:
17561804
0 commit comments