1
1
QGIS
2
2
Building QGIS from source - step by step
3
- Tuesday May 21 , 2013
3
+ Monday July 08 , 2013
4
4
5
5
6
- Last Updated: Tuesday May 21 , 2013
7
- Last Change : Tuesday May 21 , 2013
6
+ Last Updated: Monday July 08 , 2013
7
+ Last Change : Wednesday May 22 , 2013
8
8
9
9
10
10
1. Introduction
@@ -1198,6 +1198,10 @@ which can be used in build shell scripts like:
1198
1198
1199
1199
make -j $(/usr/sbin/sysctl -n hw.ncpu)
1200
1200
1201
+ Note: if you get an error in parallel compilation, try removing the -j # flag,
1202
+ so it's just 'make', or using a smaller number. Sometimes make can hiccup on too
1203
+ many threads.
1204
+
1201
1205
1202
1206
5.1. Install Developer Tools
1203
1207
============================
@@ -1207,14 +1211,12 @@ Snow Leopard, the Developer Tools, later called Xcode, were included with the
1207
1211
system install disks, though it's best to download the latest version compatible
1208
1212
with your system to get important updates fixing various issues.
1209
1213
Starting with Lion, Xcode is available as a download and from the App Store.
1210
- BUT, there is really no need for the full Xcode on Lion, and in fact could be
1211
- tricky to use for compiling QGIS.
1212
1214
1213
- Downloading Xcode/Developer Tools requires a free developer account at
1215
+ Downloading Xcode/Developer Tools for up through Snow Leopard requires a free developer account at
1214
1216
developer.apple.com. Up through Snow Leopard, get the latest Xcode that is
1215
- supported for your system. For Lion, all you need is the much smaller
1216
- Command Line Tools for Xcode (you don't get the IDE or system SDKs but they are not
1217
- necessary for QGIS). When installing Xcode up through Snow Leopard, make sure to
1217
+ supported for your system. For Lion and above, you can get Xcode from either a
1218
+ free developer account or for a minimal fee from the app store.
1219
+ When installing Xcode up through Snow Leopard, make sure to
1218
1220
do a custom install and install the Unix Development or Command Line Tools option.
1219
1221
1220
1222
On Lion, if you have installed Xcode 4.0 - 4.2 and are upgrading to 4.3, it's
@@ -1223,8 +1225,7 @@ a good idea to uninstall the old version first with:
1223
1225
sudo /Developer/Library/uninstall-devtools
1224
1226
1225
1227
On Lion and Mt. Lion, using Xcode 4.4+, the developer command line tools can be
1226
- installed via the Xcode preferences. The tools now appear to require an install
1227
- of Xcode, regardless of using a separate DMG installer for just the tools.
1228
+ installed via the Xcode preferences.
1228
1229
1229
1230
Xcode 4.3+ also introduces the clang frontend to the LLVM compiler as default.
1230
1231
@@ -1421,7 +1422,7 @@ http://download.osgeo.org/libspatialindex/
1421
1422
Double-click the source tarball to unpack, then, in Terminal.app, cd to the
1422
1423
source folder and:
1423
1424
1424
- ./configure
1425
+ ./configure --disable-dependency-tracking CFLAGS=-Os
1425
1426
make
1426
1427
sudo make install
1427
1428
@@ -1446,6 +1447,9 @@ your own risk.
1446
1447
5.4.5. Additional dependencies: SIP
1447
1448
===================================
1448
1449
1450
+ Mt Lion note: SIP 4.15.7 appears to not work on Mt Lion. Install 4.14.6.
1451
+ (or a later working version when available)
1452
+
1449
1453
Retrieve the python bindings toolkit SIP from
1450
1454
1451
1455
http://www.riverbankcomputing.com/software/sip/download
@@ -1488,10 +1492,17 @@ For 64-bit Qt (Qt Cocoa), use this configure line:
1488
1492
Lion+ system Python
1489
1493
1490
1494
Similar to Snow Leopard, you should install outside the system Python path.
1491
- There is no need for the SDK option or arch option:
1495
+ The SDK option should match the system you are compiling on:
1496
+
1497
+ for Lion:
1492
1498
1493
1499
python2.7 configure.py -d /Library/Python/2.7/site-packages -b /usr/local/bin \
1494
- -e /usr/local/include -v /usr/local/share/sip
1500
+ -e /usr/local/include -v /usr/local/share/sip --arch=x86_64 -s MacOSX10.7.sdk
1501
+
1502
+ for Mt. Lion:
1503
+
1504
+ python2.7 configure.py -d /Library/Python/2.7/site-packages -b /usr/local/bin \
1505
+ -e /usr/local/include -v /usr/local/share/sip --arch=x86_64 -s MacOSX10.8.sdk
1495
1506
1496
1507
continue...
1497
1508
@@ -1596,7 +1607,7 @@ For 64-bit Qt (Qt Cocoa), use this configure line:
1596
1607
Lion and Mt. Lion system Python
1597
1608
1598
1609
Similar to Snow Leopard, you should install outside the system Python path.
1599
- But you don't need the arch option:
1610
+ But you don't need the use- arch option:
1600
1611
1601
1612
python2.7 configure.py -d /Library/Python/2.7/site-packages -b /usr/local/bin -n /usr/local/Qt4.8/qsci -v /usr/local/share/sip/PyQt4
1602
1613
@@ -1622,7 +1633,11 @@ Snow Leopard: substitute '2.6' for Python version
1622
1633
cd Python
1623
1634
python2.7 configure.py -o /usr/local/lib -n /usr/local/include \
1624
1635
-d /Library/Python/2.7/site-packages/PyQt4 -v /usr/local/share/sip/PyQt4 \
1625
- --pyqt-sipdir=/usr/local/share/sip/PyQt4
1636
+ --sip-incdir=/usr/local/include --pyqt-sipdir=/usr/local/share/sip/PyQt4
1637
+ cat >>Qsci.pro <<EOF
1638
+ QMAKE_LFLAGS_PLUGIN -= -dynamiclib
1639
+ QMAKE_LFLAGS_PLUGIN += -bundle
1640
+ EOF
1626
1641
qmake -spec macx-g++ Qsci.pro
1627
1642
make -j [#cpus]
1628
1643
sudo make install
@@ -1764,7 +1779,7 @@ In a new Terminal cd to the source folder and:
1764
1779
make install
1765
1780
sudo mkdir -p "/Library/Application Support/OpenSceneGraph/PlugIns"
1766
1781
1767
- Enter the staging path you chose for the CMAKE_INSTALL_PREFIX option above.
1782
+ Open the staging folder you chose for the CMAKE_INSTALL_PREFIX option above.
1768
1783
1769
1784
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
1770
1785
to /Library/Application Support/OpenSceneGraph/PlugIns. The bin/ executables
@@ -1788,6 +1803,8 @@ http://github.com/gwaldron/osgearth/tags
1788
1803
Download a tarball for the latest stable release (sorting can be confusing here).
1789
1804
Double-click the source tarball to unpack it.
1790
1805
1806
+ Note: for now stick with version 2.3. There are compile errors in 2.4 that need attention.
1807
+
1791
1808
This one also needs an intermediate staging area. Choose a folder similar to OSG.
1792
1809
1793
1810
In a new Terminal cd to the source folder and:
@@ -1803,13 +1820,14 @@ In a new Terminal cd to the source folder and:
1803
1820
make install
1804
1821
sudo mkdir -p "/Library/Application Support/OpenSceneGraph/Headers"
1805
1822
1806
- Enter the staging path you chose for the CMAKE_INSTALL_PREFIX option above.
1807
- Also enter the OSG staging path /bin folder in the export above .
1823
+ Open the staging folder you chose for the CMAKE_INSTALL_PREFIX option above.
1824
+ Also open the OSG staging path /bin folder from the OSG build .
1808
1825
1809
1826
Move all the .frameworks from the lib/ folder to /Library/Frameworks.
1810
1827
Move the files in the osgPlugins folder in the lib/ folder to
1811
1828
/Library/Application Support/OpenSceneGraph/PlugIns. Move the osgEarthDrivers
1812
1829
folder in the include/ folder to /Library/Application Support/OpenSceneGraph/Headers.
1830
+ (you may need to create this folder)
1813
1831
And as for OSG, you can leave the bin/ executables where they are.
1814
1832
1815
1833
0 commit comments