Skip to content

Commit d8c3c90

Browse files
committedMay 8, 2011
Mac install updates

File tree

2 files changed

+182
-291
lines changed

2 files changed

+182
-291
lines changed
 

‎INSTALL

Lines changed: 98 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ Quantum GIS (QGIS)
22
Building QGIS from source - step by step
33

44

5-
Last update: 20110426
6-
Last change: 20110404
5+
Last update: 20110508
6+
Last change: 20110508
77

88

99
1. Introduction
@@ -22,12 +22,12 @@ Last change: 20110404
2222
4.1. Building with Microsoft Visual Studio
2323
4.2. Building using MinGW
2424
4.3. Creation of MSYS environment for compilation of Quantum GIS
25-
5. MacOS X: building using frameworks and Cmake
26-
5.1. Install Qt4 from .dmg
25+
5. Building on MacOS X
26+
5.1. Install Qt4 from disk image
2727
5.2. Install development frameworks for QGIS dependencies
2828
5.3. Install CMake for OSX
29-
5.4. Install subversion for OSX
30-
5.5. Check out QGIS from SVN
29+
5.4. Install git for OSX
30+
5.5. Check out QGIS from git
3131
5.6. Configure the build
3232
5.7. Building
3333
6. Authors and Acknowledgments
@@ -1160,14 +1160,14 @@ We're done with preparation of MSYS environment. Now you can delete all stuff in
11601160
of space and it's not necessary at all.
11611161

11621162

1163-
5. MacOS X: building using frameworks and Cmake
1164-
===============================================
1163+
5. Building on MacOS X
1164+
======================
11651165

11661166
In this approach I will try to avoid as much as possible building dependencies
11671167
from source and rather use frameworks wherever possible.
11681168

11691169
The base system here is Mac OS X 10.4 (Tiger), with a single architecture build.
1170-
Included are a few notes for building on Mac OS X 10.5 (Leopard) and 10.6 (Snow Leopard).
1170+
Included are notes for building on Mac OS X 10.5 (Leopard) and 10.6 (Snow Leopard).
11711171
Make sure to read each section completely before typing the first command you see.
11721172

11731173
General note on Terminal usage: When I say "cd" to a folder in a Terminal,
@@ -1192,25 +1192,26 @@ ie: Mac Pro "8 Core" model (2 quad core processors) = 8
11921192
ie: Macbook Pro i5 (hyperthreading) = 2 cores X 2 = 4
11931193

11941194

1195-
5.1. Install Qt4 from .dmg
1196-
==========================
1195+
5.1. Install Qt4 from disk image
1196+
================================
11971197

1198-
You need a minimum of Qt-4.4.0. I suggest getting the latest.
1198+
You need a minimum of Qt-4.4.0. I suggest getting the latest. There is no need for the full Qt SDK, so save yourself some download time and get the frameworks only.
11991199

12001200
Snow Leopard note: If you are building on Snow Leopard, you will need to
12011201
decide between 32-bit support in the older, Qt Carbon branch, or 64-bit
12021202
support in the Qt Cocoa branch. Appropriate installers are available for both
12031203
as of Qt-4.5.2. Qt 4.6+ is recommended for Cocoa.
12041204

1205-
PPC note: There appear to be issues with Qt Cocoa on PPC Macs. QT Carbon
1206-
is recommended on PPC Macs.
1205+
PPC note: The readymade Qt Cocoa installers don't include PPC support, you'd
1206+
have to compile Qt yourself. But, there appear to be issues with Qt Cocoa on PPC
1207+
Macs anyyways. QT Carbon is recommended on PPC Macs.
12071208

1208-
http://qt.nokia.com/downloads
1209+
http://qt.nokia.com/downloads
12091210

1210-
If you want debug frameworks, Qt also provides a dmg with these. These are in
1211-
addition to the non-debug frameworks.
1211+
If you want debug frameworks, Qt also provides a separate download with these.
1212+
These are in addition to the non-debug frameworks.
12121213

1213-
Once downloaded open the dmg and run the installer. Note you need admin
1214+
Once downloaded open the disk image and run the installer. Note you need admin
12141215
privileges to install.
12151216

12161217
Qt note: Starting in Qt 4.4, libQtCLucene was added, and in 4.5
@@ -1230,10 +1231,10 @@ CMAKE_MODULE_LINKER_FLAGS and CMAKE_EXE_LINKER_FLAGS in the cmake build.
12301231
=========================================================
12311232

12321233
Download William Kyngesburye's excellent GDAL Complete package that includes
1233-
PROJ, GEOS, GDAL, SQLite3, and image libraries, as frameworks. There is also
1234-
a GSL framework.
1234+
PROJ, GEOS, GDAL, SQLite3, Spatialite, and image libraries, as frameworks.
1235+
There is also a GSL framework.
12351236

1236-
http://www.kyngchaos.com/wiki/software/frameworks
1237+
http://www.kyngchaos.com/wiki/software/frameworks
12371238

12381239
Once downloaded, open and install the frameworks.
12391240

@@ -1242,11 +1243,11 @@ Qgis just needs the libpq client library, so unless you want to setup the full
12421243
Postgres + PostGIS server, all you need is the client-only package.
12431244
It's available here:
12441245

1245-
http://www.kyngchaos.com/wiki/software/postgres
1246+
http://www.kyngchaos.com/wiki/software/postgres
12461247

12471248
Also available is a GRASS application:
12481249

1249-
http://www.kyngchaos.com/wiki/software/grass
1250+
http://www.kyngchaos.com/wiki/software/grass
12501251

12511252

12521253
5.2.1. Additional Dependencies: General compatibility note
@@ -1272,7 +1273,7 @@ not necessary on Snow Leopard.
12721273

12731274
Get the expat sources:
12741275

1275-
http://sourceforge.net/project/showfiles.php?group_id=10127
1276+
http://sourceforge.net/project/showfiles.php?group_id=10127
12761277

12771278
Double-click the source tarball to unpack, then, in Terminal.app, cd to the source folder and:
12781279

@@ -1290,7 +1291,7 @@ Leopard and Snow Leopard. You can still install Python from python.org if prefer
12901291

12911292
If installing from python.org, make sure you install at least the latest Python 2.x from
12921293

1293-
http://www.python.org/download/
1294+
http://www.python.org/download/
12941295

12951296
Python 3 is a major change, and may have compatibility issues, so try it at your own risk.
12961297

@@ -1300,31 +1301,33 @@ Python 3 is a major change, and may have compatibility issues, so try it at your
13001301

13011302
Retrieve the python bindings toolkit SIP from
13021303

1303-
http://www.riverbankcomputing.com/software/sip/download
1304+
http://www.riverbankcomputing.com/software/sip/download
13041305

1305-
Double-click the source tarball to unpack it, then, in Terminal.app, cd to the source folder
1306-
and (this installs by default into the Python framework, and is appropriate only for
1307-
python.org Python installs):
1306+
Double-click the source tarball to unpack it, then, in Terminal.app,
1307+
cd to the source folder. Then for your chosen Python:
1308+
1309+
python.org Python
13081310

13091311
python configure.py
13101312
make
13111313
sudo make install
13121314

1313-
Leopard notes
1315+
Leopard system Python
13141316

1315-
If building on Leopard, using Leopard's bundled Python, SIP wants to install in the
1316-
system path -- this is not a good idea. Use this configure command instead of the
1317-
basic configure above:
1317+
SIP wants to install in the system path -- this is not a good idea.
1318+
More configuration is needed to install outside the system path:
13181319

13191320
python configure.py -n -d /Library/Python/2.5/site-packages -b /usr/local/bin \
13201321
-e /usr/local/include -v /usr/local/share/sip -s MacOSX10.5.sdk
13211322

1322-
Snow Leopard notes
1323+
Snow Leopard system Python
13231324

13241325
Similar to Leopard, you should install outside the system Python path.
13251326
Also, you need to specify the architecture you want (requires at least SIP 4.9),
13261327
and make sure to run the versioned python binary (this one responds to the
1327-
'arch' command, 'python' does not). If you are using 32-bit Qt (Qt Carbon):
1328+
'arch' command, 'python' does not).
1329+
1330+
If you are using 32-bit Qt (Qt Carbon):
13281331

13291332
python2.6 configure.py -n -d /Library/Python/2.6/site-packages -b /usr/local/bin \
13301333
-e /usr/local/include -v /usr/local/share/sip --arch=i386 -s MacOSX10.6.sdk
@@ -1340,44 +1343,30 @@ For 64-bit Qt (Qt Cocoa), use this configure line:
13401343

13411344
Retrieve the python bindings toolkit for Qt from
13421345

1343-
http://www.riverbankcomputing.com/software/pyqt/download
1346+
http://www.riverbankcomputing.com/software/pyqt/download
1347+
1348+
Double-click the source tarball to unpack it, then, in Terminal.app,
1349+
cd to the source folder. Then for your chosen Python:
13441350

1345-
Double-click the source tarball to unpack it, then, in Terminal.app, cd to the source folder
1346-
and (this installs by default into the Python framework, and is appropriate only for
1347-
python.org Python installs):
1351+
python.org Python
13481352

13491353
python configure.py
13501354
yes
13511355

1352-
There is a problem with the configuration that needs to be fixed now
1353-
(it affects PyQwt compilation later). Edit pyqtconfig.py and change the qt_dir line to:
1354-
1355-
'qt_dir': '/usr',
1356-
1357-
Then continue with compilation and installation (this is a good place to use
1358-
parallel compilation, if you can):
1356+
Leopard system Python
13591357

1360-
make
1361-
sudo make install
1362-
1363-
Leopard notes
1364-
1365-
If building on Leopard, using Leopard's bundled Python, PyQt wants to install
1366-
in the system path -- this is not a good idea. Use this configure command
1367-
instead of the basic configure above:
1358+
PyQt wants to install in the system path -- this is not a good idea.
1359+
More configuration is needed to install outside the system path:
13681360

13691361
python configure.py -d /Library/Python/2.5/site-packages -b /usr/local/bin
13701362

1371-
If there is a problem with undefined symbols in QtOpenGL on Leopard, edit
1372-
QtOpenGL/makefile and add -undefined dynamic_lookup to LFLAGS.
1373-
Then make again.
1374-
1375-
Snow Leopard notes
1363+
Snow Leopard system Python
13761364

13771365
Similar to Leopard, you should install outside the system Python path.
13781366
Also, you need to specify the architecture you want (requires at least PyQt 4.6),
13791367
and make sure to run the versioned python binary (this one responds to the
13801368
'arch' command, which is important for pyuic4, 'python' does not).
1369+
13811370
If you are using 32-bit Qt (Qt Carbon):
13821371

13831372
python2.6 configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin --use-arch i386
@@ -1386,40 +1375,41 @@ For 64-bit Qt (Qt Cocoa), use this configure line:
13861375

13871376
python2.6 configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin --use-arch x86_64
13881377

1378+
continue...
1379+
1380+
There is a problem with the configuration that needs to be fixed now
1381+
(it affects PyQwt compilation later). Edit pyqtconfig.py and change the qt_dir line to:
1382+
1383+
'qt_dir': '/usr',
1384+
1385+
Then continue with compilation and installation (this is a good place to use
1386+
parallel compilation, if you can):
1387+
1388+
make
1389+
sudo make install
1390+
1391+
If there is a problem with undefined symbols in QtOpenGL on Leopard, edit
1392+
QtOpenGL/makefile and add -undefined dynamic_lookup to LFLAGS.
1393+
Then make again.
1394+
13891395

13901396
5.2.6. Additional Dependencies: Qwt/PyQwt
13911397
=========================================
13921398

13931399
The GPS tracking feature uses Qwt. Some popular 3rd-party plugins use PyQwt.
13941400
You can take care of both with the PyQwt source from:
13951401

1396-
http://pyqwt.sourceforge.net/
1402+
http://pyqwt.sourceforge.net/
13971403

13981404
Double-click the tarball to unpack it. The following assumes PyQwt v5.2.0 (comes with Qwt 5.2.1).
13991405
Normal compilation does both Qwt and PyQwt at the same time, but Qwt is statically linked
14001406
into PyQwt, and Qgis can't use it. So, we need to split the build.
14011407

1402-
First edit qwtconfig.pri in the qwt-5.2 subdir and change some settings so
1403-
you don't get a bloated debug static library (too bad they are not configurable from
1404-
qmake). Scroll down to the 'release/debug mode' block. Edit the last 'CONFIG +='
1405-
line, within an 'else' block, and change 'debug' to 'release'. Like so:
1406-
1407-
else {
1408-
CONFIG += release # release/debug
1409-
}
1410-
1411-
Also uncomment (remove # prefix) the line 'CONFIG += QwtDll'. Like so:
1412-
1413-
CONFIG += QwtDll
1414-
1415-
If you are building for Qt Carbon 32bit on Snow Leopard, add a line at the bottom:
1416-
1417-
CONFIG += x86
1418-
1419-
Save and close.
1420-
14211408
Now, cd into the qwt-5.2 subdir in a Terminal. Type these commands to build and install:
14221409

1410+
cat >> qwtconfig.pri <<EOF
1411+
CONFIG += release QwtDll
1412+
EOF
14231413
qmake -spec macx-g++
14241414
make
14251415
sudo make install
@@ -1429,7 +1419,7 @@ Now, cd into the qwt-5.2 subdir in a Terminal. Type these commands to build and
14291419
The Qwt shared library is now installed in /usr/local/qwt-5.x.x[-svn] (x.x is the
14301420
minor.point version, and it may be an SVN version). Remember this for QGIS and PyQwt configuration.
14311421

1432-
Now for PyQwt. Still in the Terminal:
1422+
Now for PyQwt. Still in the Terminal (for all Pythons, except see Snow Leopard Carbon note below):
14331423

14341424
cd ../configure
14351425
python configure.py --extra-include-dirs=/usr/local/qwt-5.2.1-svn/include \
@@ -1473,10 +1463,10 @@ tarball to unpack it, then cd to the source folder and:
14731463

14741464
Get the latest source release from here:
14751465

1476-
http://www.cmake.org/cmake/resources/software.html
1466+
http://www.cmake.org/cmake/resources/software.html
14771467

14781468
Binary installers are available for OS X, but they are not recommended
1479-
(2.4 versions install in /usr instead of /usr/local, and 2.6 versions are a
1469+
(2.4 versions install in /usr instead of /usr/local, and 2.6+ versions are a
14801470
strange application). Instead, download the source, double-click the source tarball,
14811471
then cd to the source folder and:
14821472

@@ -1485,45 +1475,32 @@ then cd to the source folder and:
14851475
sudo make install
14861476

14871477

1488-
5.4. Install subversion for OSX
1489-
===============================
1490-
1491-
Leopard and Snow Leopard note: Leopard and Snow Leopard (Xcode 3+)
1492-
include SVN, so this step can be skipped on Leopard and Snow Leopard.
1493-
1494-
The [http://sourceforge.net/projects/macsvn/MacSVN] project has a downloadable
1495-
build of svn. If you are a GUI inclined person you may want to grab their gui
1496-
client too. Get the command line client here:
1497-
1498-
curl -O http://ufpr.dl.sourceforge.net/sourceforge/macsvn/Subversion_1.4.2.zip
1499-
1500-
Once downloaded open the zip file and run the installer.
1501-
1502-
You also need to install BerkleyDB available from the same
1503-
http://sourceforge.net/projects/macsvn/ (website). At the time of writing the
1504-
file was here:
1478+
5.4. Install git for OSX
1479+
========================
15051480

1506-
curl -O http://ufpr.dl.sourceforge.net/sourceforge/macsvn/Berkeley_DB_4.5.20.zip
1481+
The git (http://git-scm.com/) project has a downloadable build of git.
1482+
Make sure to get the package matching your processor (x86_64 most likely, only the first Intel Macs need the i386 package).
15071483

1508-
Once again unzip this and run the installer therein.
1484+
Once downloaded open the disk image and run the installer.
15091485

1510-
Lastly we need to ensure that the svn commandline executeable is in the path.
1511-
Add the following line to the end of /etc/bashrc using sudo:
1486+
PPC/source note
15121487

1513-
sudo vim /etc/bashrc
1488+
The git site does not offer PPC builds. If you need a PPC build, or you just want
1489+
a little more control over the installation, you need to compile it yourself.
15141490

1515-
And add this line to the bottom before saving and quiting:
1491+
Download the source from http://git-scm.com/. Unzip it, and in a Terminal cd to the source folder, then:
15161492

1517-
export PATH=/usr/local/bin:$PATH:/usr/local/pgsql/bin
1493+
make prefix=/usr/local
1494+
sudo make prefix=/usr/local install
15181495

1519-
/usr/local/bin needs to be first in the path so that the newer bison (that will
1520-
be built from source further down) is found before the bison (which is very
1521-
old) that is installed by MacOSX
1496+
If you don't need any of the extras, Perl, Python or TclTk (GUI), you can disable them before running make with:
15221497

1523-
Now close and reopen your shell to get the updated vars.
1498+
export NO_PERL=
1499+
export NO_TCLTK=
1500+
export NO_PYTHON=
15241501

15251502

1526-
5.5. Check out QGIS from SVN
1503+
5.5. Check out QGIS from git
15271504
============================
15281505

15291506
Now we are going to check out the sources for QGIS. First we will create a
@@ -1533,27 +1510,7 @@ directory for working in (or some folder of your choice):
15331510

15341511
Now we check out the sources:
15351512

1536-
Trunk:
1537-
1538-
svn co https://svn.osgeo.org/qgis/trunk/qgis qgis
1539-
1540-
For a release branch version x.y.z:
1541-
1542-
svn co https://svn.qgis.org/qgis/branches/Release-x_y_z qgis-x.y.z
1543-
1544-
The first time you check out QGIS sources you will probably get a message like
1545-
this:
1546-
1547-
Error validating server certificate for 'https://svn.qgis.org:443':
1548-
- The certificate is not issued by a trusted authority. Use the fingerprint to
1549-
validate the certificate manually! Certificate information:
1550-
- Hostname: svn.qgis.org
1551-
- Valid: from Apr 1 00:30:47 2006 GMT until Mar 21 00:30:47 2008 GMT
1552-
- Issuer: Developer Team, Quantum GIS, Anchorage, Alaska, US
1553-
- Fingerprint: 2f:cd:f1:5a:c7:64:da:2b:d1:34:a5:20:c6:15:67:28:33:ea:7a:9b
1554-
(R)eject, accept (t)emporarily or accept (p)ermanently?
1555-
1556-
I suggest you press 'p' to accept the key permanently.
1513+
git clone git://github.com/qgis/Quantum-GIS.git
15571514

15581515

15591516
5.6. Configure the build
@@ -1568,7 +1525,7 @@ In a Terminal cd to the qgis source folder previously downloaded, then:
15681525

15691526
mkdir build
15701527
cd build
1571-
cmake -D CMAKE_INSTALL_PREFIX=~/Applications -D CMAKE_BUILD_TYPE=Release \
1528+
cmake -D CMAKE_INSTALL_PREFIX=~/Applications \
15721529
-D CMAKE_BUILD_TYPE=MinSizeRel \
15731530
-D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_MAPSERVER=TRUE \
15741531
-D QWT_LIBRARY=/usr/local/qwt-5.2.1-svn/lib/libqwt.dylib \
@@ -1587,7 +1544,7 @@ path and version as required):
15871544
-D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_MAPSERVER=TRUE \
15881545
-D QWT_LIBRARY=/usr/local/qwt-5.2.1-svn/lib/libqwt.dylib \
15891546
-D QWT_INCLUDE_DIR=/usr/local/qwt-5.2.1-svn/include \
1590-
-D GRASS_PREFIX=/user/local/grass-6.4.0 \
1547+
-D GRASS_PREFIX=/user/local/grass-6.4.1 \
15911548
..
15921549

15931550
Snow Leopard note: To handle 32-bit Qt (Carbon), create a 32bit python wrapper
@@ -1600,7 +1557,7 @@ script and add arch flags to the configuration:
16001557

16011558
sudo chmod +x /usr/local/bin/python32
16021559

1603-
cmake -D CMAKE_INSTALL_PREFIX=~/Applications -D CMAKE_BUILD_TYPE=Release \
1560+
cmake -D CMAKE_INSTALL_PREFIX=~/Applications -D \
16041561
-D CMAKE_BUILD_TYPE=MinSizeRel \
16051562
-D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_MAPSERVER=TRUE \
16061563
-D QWT_LIBRARY=/usr/local/qwt-5.2.1-svn/lib/libqwt.dylib \
@@ -1614,10 +1571,14 @@ or wait to see if there are immediate crashes when running Qgis. It's also a go
16141571
idea to bundle Qt if you need to copy Qgis to other Macs (where you would have to
16151572
install Xcode just so Qt would install!).
16161573

1617-
To bundle Qt, add the following line before the last line in the above cmake configurations:
1574+
To bundle Qt, add the following line before the last line (the ".." line) in the above cmake configurations:
16181575

16191576
-D QGIS_MACAPP_BUNDLE=1 \
16201577

1578+
Even better for distribution purposes, to also bundle any extras non-framework, non-standard, libs (ie postgres' libpq) bump the bundle number to 2:
1579+
1580+
-D QGIS_MACAPP_BUNDLE=2 \
1581+
16211582

16221583
5.7. Building
16231584
=============
@@ -1631,7 +1592,7 @@ If all built without errors you can then install it:
16311592

16321593
make install
16331594

1634-
or, for a /Applications build:
1595+
or, for an /Applications build:
16351596

16361597
sudo make install
16371598

‎doc/osx.t2t

Lines changed: 84 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

2-
= MacOS X: building using frameworks and Cmake =
2+
= Building on MacOS X =
33

44
In this approach I will try to avoid as much as possible building dependencies
55
from source and rather use frameworks wherever possible.
66

77
The base system here is Mac OS X 10.4 (__Tiger__), with a single architecture build.
8-
Included are a few notes for building on Mac OS X 10.5 (__Leopard__) and 10.6 (__Snow Leopard__).
8+
Included are notes for building on Mac OS X 10.5 (__Leopard__) and 10.6 (__Snow Leopard__).
99
Make sure to read each section completely before typing the first command you see.
1010

1111
__General note on Terminal usage:__ When I say "cd" to a folder in a Terminal,
@@ -31,26 +31,25 @@ ie: Mac Pro "8 Core" model (2 quad core processors) = 8
3131

3232
ie: Macbook Pro i5 (hyperthreading) = 2 cores X 2 = 4
3333

34-
== Install Qt4 from .dmg ==
34+
== Install Qt4 from disk image ==
3535

36-
You need a minimum of Qt-4.4.0. I suggest getting the latest.
36+
You need a minimum of Qt-4.4.0. I suggest getting the latest. There is no need for the full Qt SDK, so save yourself some download time and get the frameworks only.
3737

3838
__Snow Leopard note:__ If you are building on Snow Leopard, you will need to
3939
decide between 32-bit support in the older, Qt Carbon branch, or 64-bit
4040
support in the Qt Cocoa branch. Appropriate installers are available for both
4141
as of Qt-4.5.2. Qt 4.6+ is recommended for Cocoa.
4242

43-
__PPC note:__ There appear to be issues with Qt Cocoa on PPC Macs. QT Carbon
44-
is recommended on PPC Macs.
43+
__PPC note:__ The readymade Qt Cocoa installers don't include PPC support, you'd
44+
have to compile Qt yourself. But, there appear to be issues with Qt Cocoa on PPC
45+
Macs anyyways. QT Carbon is recommended on PPC Macs.
4546

46-
```
4747
http://qt.nokia.com/downloads
48-
```
4948

50-
If you want debug frameworks, Qt also provides a dmg with these. These are in
51-
addition to the non-debug frameworks.
49+
If you want debug frameworks, Qt also provides a separate download with these.
50+
These are in addition to the non-debug frameworks.
5251

53-
Once downloaded open the dmg and run the installer. Note you need admin
52+
Once downloaded open the disk image and run the installer. Note you need admin
5453
privileges to install.
5554

5655
__Qt note:__ Starting in Qt 4.4, libQtCLucene was added, and in 4.5
@@ -71,12 +70,10 @@ CMAKE_MODULE_LINKER_FLAGS and CMAKE_EXE_LINKER_FLAGS in the cmake build.
7170
== Install development frameworks for QGIS dependencies ==
7271

7372
Download William Kyngesburye's excellent GDAL Complete package that includes
74-
PROJ, GEOS, GDAL, SQLite3, and image libraries, as frameworks. There is also
75-
a GSL framework.
73+
PROJ, GEOS, GDAL, SQLite3, Spatialite, and image libraries, as frameworks.
74+
There is also a GSL framework.
7675

77-
```
7876
http://www.kyngchaos.com/wiki/software/frameworks
79-
```
8077

8178
Once downloaded, open and install the frameworks.
8279

@@ -85,15 +82,11 @@ Qgis just needs the libpq client library, so unless you want to setup the full
8582
Postgres + PostGIS server, all you need is the client-only package.
8683
It's available here:
8784

88-
```
8985
http://www.kyngchaos.com/wiki/software/postgres
90-
```
9186

9287
Also available is a GRASS application:
9388

94-
```
9589
http://www.kyngchaos.com/wiki/software/grass
96-
```
9790

9891
=== Additional Dependencies: General compatibility note ===
9992

@@ -115,9 +108,7 @@ not necessary on Snow Leopard.
115108

116109
Get the expat sources:
117110

118-
```
119111
http://sourceforge.net/project/showfiles.php?group_id=10127
120-
```
121112

122113
Double-click the source tarball to unpack, then, in Terminal.app, cd to the source folder and:
123114

@@ -135,47 +126,45 @@ Leopard and Snow Leopard. You can still install Python from python.org if prefer
135126

136127
If installing from python.org, make sure you install at least the latest Python 2.x from
137128

138-
```
139129
http://www.python.org/download/
140-
```
141130

142131
Python 3 is a major change, and may have compatibility issues, so try it at your own risk.
143132

144133
=== Additional Dependencies: SIP ===
145134

146135
Retrieve the python bindings toolkit SIP from
147136

148-
```
149137
http://www.riverbankcomputing.com/software/sip/download
150-
```
151138

152-
Double-click the source tarball to unpack it, then, in Terminal.app, cd to the source folder
153-
and (this installs by default into the Python framework, and is appropriate only for
154-
python.org Python installs):
139+
Double-click the source tarball to unpack it, then, in Terminal.app,
140+
cd to the source folder. Then for your chosen Python:
141+
142+
__python.org Python__
155143

156144
```
157145
python configure.py
158146
make
159147
sudo make install
160148
```
161149

162-
__Leopard notes__
150+
__Leopard system Python__
163151

164-
If building on Leopard, using Leopard's bundled Python, SIP wants to install in the
165-
system path -- this is not a good idea. Use this configure command instead of the
166-
basic configure above:
152+
SIP wants to install in the system path -- this is not a good idea.
153+
More configuration is needed to install outside the system path:
167154

168155
```
169156
python configure.py -n -d /Library/Python/2.5/site-packages -b /usr/local/bin \
170157
-e /usr/local/include -v /usr/local/share/sip -s MacOSX10.5.sdk
171158
```
172159

173-
__Snow Leopard notes__
160+
__Snow Leopard system Python__
174161

175162
Similar to Leopard, you should install outside the system Python path.
176163
Also, you need to specify the architecture you want (requires at least SIP 4.9),
177164
and make sure to run the versioned python binary (this one responds to the
178-
'arch' command, 'python' does not). If you are using 32-bit Qt (Qt Carbon):
165+
'arch' command, 'python' does not).
166+
167+
If you are using 32-bit Qt (Qt Carbon):
179168

180169
```
181170
python2.6 configure.py -n -d /Library/Python/2.6/site-packages -b /usr/local/bin \
@@ -194,54 +183,34 @@ python2.6 configure.py -n -d /Library/Python/2.6/site-packages -b /usr/local/bin
194183

195184
Retrieve the python bindings toolkit for Qt from
196185

197-
```
198186
http://www.riverbankcomputing.com/software/pyqt/download
199-
```
200187

201-
Double-click the source tarball to unpack it, then, in Terminal.app, cd to the source folder
202-
and (this installs by default into the Python framework, and is appropriate only for
203-
python.org Python installs):
188+
Double-click the source tarball to unpack it, then, in Terminal.app,
189+
cd to the source folder. Then for your chosen Python:
190+
191+
__python.org Python__
204192

205193
```
206194
python configure.py
207195
yes
208196
```
209197

210-
There is a problem with the configuration that needs to be fixed now
211-
(it affects PyQwt compilation later). Edit pyqtconfig.py and change the qt_dir line to:
212-
213-
```
214-
'qt_dir': '/usr',
215-
```
216-
217-
Then continue with compilation and installation (this is a good place to use
218-
parallel compilation, if you can):
198+
__Leopard system Python__
219199

220-
```
221-
make
222-
sudo make install
223-
```
224-
225-
__Leopard notes__
226-
227-
If building on Leopard, using Leopard's bundled Python, PyQt wants to install
228-
in the system path -- this is not a good idea. Use this configure command
229-
instead of the basic configure above:
200+
PyQt wants to install in the system path -- this is not a good idea.
201+
More configuration is needed to install outside the system path:
230202

231203
```
232204
python configure.py -d /Library/Python/2.5/site-packages -b /usr/local/bin
233205
```
234206

235-
If there is a problem with undefined symbols in QtOpenGL on Leopard, edit
236-
QtOpenGL/makefile and add ""-undefined dynamic_lookup"" to LFLAGS.
237-
Then make again.
238-
239-
__Snow Leopard notes__
207+
__Snow Leopard system Python__
240208

241209
Similar to Leopard, you should install outside the system Python path.
242210
Also, you need to specify the architecture you want (requires at least PyQt 4.6),
243211
and make sure to run the versioned python binary (this one responds to the
244212
'arch' command, which is important for pyuic4, 'python' does not).
213+
245214
If you are using 32-bit Qt (Qt Carbon):
246215

247216
```
@@ -254,48 +223,45 @@ For 64-bit Qt (Qt Cocoa), use this configure line:
254223
python2.6 configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin --use-arch x86_64
255224
```
256225

226+
__continue...__
257227

258-
=== Additional Dependencies: Qwt/PyQwt ===
259-
260-
The GPS tracking feature uses Qwt. Some popular 3rd-party plugins use PyQwt.
261-
You can take care of both with the PyQwt source from:
228+
There is a problem with the configuration that needs to be fixed now
229+
(it affects PyQwt compilation later). Edit pyqtconfig.py and change the qt_dir line to:
262230

263231
```
264-
http://pyqwt.sourceforge.net/
232+
'qt_dir': '/usr',
265233
```
266234

267-
Double-click the tarball to unpack it. The following assumes PyQwt v5.2.0 (comes with Qwt 5.2.1).
268-
Normal compilation does both Qwt and PyQwt at the same time, but Qwt is statically linked
269-
into PyQwt, and Qgis can't use it. So, we need to split the build.
270-
271-
First edit qwtconfig.pri in the qwt-5.2 subdir and change some settings so
272-
you don't get a bloated debug static library (too bad they are not configurable from
273-
qmake). Scroll down to the 'release/debug mode' block. Edit the last 'CONFIG +='
274-
line, within an 'else' block, and change 'debug' to 'release'. Like so:
235+
Then continue with compilation and installation (this is a good place to use
236+
parallel compilation, if you can):
275237

276238
```
277-
else {
278-
CONFIG += release # release/debug
279-
}
239+
make
240+
sudo make install
280241
```
281242

282-
Also uncomment (remove # prefix) the line 'CONFIG += QwtDll'. Like so:
243+
If there is a problem with undefined symbols in QtOpenGL on Leopard, edit
244+
QtOpenGL/makefile and add ""-undefined dynamic_lookup"" to LFLAGS.
245+
Then make again.
283246

284-
```
285-
CONFIG += QwtDll
286-
```
287247

288-
If you are building for Qt Carbon 32bit on Snow Leopard, add a line at the bottom:
248+
=== Additional Dependencies: Qwt/PyQwt ===
289249

290-
```
291-
CONFIG += x86
292-
```
250+
The GPS tracking feature uses Qwt. Some popular 3rd-party plugins use PyQwt.
251+
You can take care of both with the PyQwt source from:
293252

294-
Save and close.
253+
http://pyqwt.sourceforge.net/
254+
255+
Double-click the tarball to unpack it. The following assumes PyQwt v5.2.0 (comes with Qwt 5.2.1).
256+
Normal compilation does both Qwt and PyQwt at the same time, but Qwt is statically linked
257+
into PyQwt, and Qgis can't use it. So, we need to split the build.
295258

296259
Now, cd into the qwt-5.2 subdir in a Terminal. Type these commands to build and install:
297260

298261
```
262+
cat >> qwtconfig.pri <<EOF
263+
CONFIG += release QwtDll
264+
EOF
299265
qmake -spec macx-g++
300266
make
301267
sudo make install
@@ -306,7 +272,7 @@ sudo install_name_tool -id /usr/local/qwt-5.2.1-svn/lib/libqwt.5.dylib \
306272
The Qwt shared library is now installed in /usr/local/qwt-5.x.x[-svn] (x.x is the
307273
minor.point version, and it may be an SVN version). Remember this for QGIS and PyQwt configuration.
308274

309-
Now for PyQwt. Still in the Terminal:
275+
Now for PyQwt. Still in the Terminal (for all Pythons, except see Snow Leopard Carbon note below):
310276

311277
```
312278
cd ../configure
@@ -355,12 +321,10 @@ sudo make install
355321

356322
Get the latest source release from here:
357323

358-
```
359324
http://www.cmake.org/cmake/resources/software.html
360-
```
361325

362326
Binary installers are available for OS X, but they are not recommended
363-
(2.4 versions install in /usr instead of /usr/local, and 2.6 versions are a
327+
(2.4 versions install in /usr instead of /usr/local, and 2.6+ versions are a
364328
strange application). Instead, download the source, double-click the source tarball,
365329
then cd to the source folder and:
366330

@@ -370,52 +334,34 @@ make
370334
sudo make install
371335
```
372336

373-
== Install subversion for OSX ==
337+
== Install git for OSX ==
374338

375-
__Leopard and Snow Leopard note:__ Leopard and Snow Leopard (Xcode 3+)
376-
include SVN, so this step can be skipped on Leopard and Snow Leopard.
339+
The [git http://git-scm.com/] project has a downloadable build of git.
340+
Make sure to get the package matching your processor (x86_64 most likely, only the first Intel Macs need the i386 package).
377341

378-
The [http://sourceforge.net/projects/macsvn/MacSVN] project has a downloadable
379-
build of svn. If you are a GUI inclined person you may want to grab their gui
380-
client too. Get the command line client here:
342+
Once downloaded open the disk image and run the installer.
381343

382-
```
383-
curl -O http://ufpr.dl.sourceforge.net/sourceforge/macsvn/Subversion_1.4.2.zip
384-
```
344+
__PPC/source note__
385345

386-
Once downloaded open the zip file and run the installer.
346+
The git site does not offer PPC builds. If you need a PPC build, or you just want
347+
a little more control over the installation, you need to compile it yourself.
387348

388-
You also need to install BerkleyDB available from the same
389-
[http://sourceforge.net/projects/macsvn/ website]. At the time of writing the
390-
file was here:
349+
Download the source from http://git-scm.com/. Unzip it, and in a Terminal cd to the source folder, then:
391350

392-
```
393-
curl -O http://ufpr.dl.sourceforge.net/sourceforge/macsvn/Berkeley_DB_4.5.20.zip
394351
```
395-
396-
Once again unzip this and run the installer therein.
397-
398-
Lastly we need to ensure that the svn commandline executeable is in the path.
399-
Add the following line to the end of /etc/bashrc using sudo:
400-
401-
```
402-
sudo vim /etc/bashrc
352+
make prefix=/usr/local
353+
sudo make prefix=/usr/local install
403354
```
404355

405-
And add this line to the bottom before saving and quiting:
356+
If you don't need any of the extras, Perl, Python or TclTk (GUI), you can disable them before running make with:
406357

407-
```
408-
export PATH=/usr/local/bin:$PATH:/usr/local/pgsql/bin
358+
```
359+
export NO_PERL=
360+
export NO_TCLTK=
361+
export NO_PYTHON=
409362
```
410363

411-
/usr/local/bin needs to be first in the path so that the newer bison (that will
412-
be built from source further down) is found before the bison (which is very
413-
old) that is installed by MacOSX
414-
415-
416-
Now close and reopen your shell to get the updated vars.
417-
418-
== Check out QGIS from SVN ==
364+
== Check out QGIS from git ==
419365

420366
Now we are going to check out the sources for QGIS. First we will create a
421367
directory for working in (or some folder of your choice):
@@ -426,32 +372,10 @@ mkdir -p ~/dev/cpp cd ~/dev/cpp
426372

427373
Now we check out the sources:
428374

429-
Trunk:
430375
```
431-
svn co https://svn.osgeo.org/qgis/trunk/qgis qgis
376+
git clone git://github.com/qgis/Quantum-GIS.git
432377
```
433378

434-
For a release branch version x.y.z:
435-
```
436-
svn co https://svn.qgis.org/qgis/branches/Release-x_y_z qgis-x.y.z
437-
```
438-
439-
The first time you check out QGIS sources you will probably get a message like
440-
this:
441-
442-
```
443-
Error validating server certificate for 'https://svn.qgis.org:443':
444-
- The certificate is not issued by a trusted authority. Use the fingerprint to
445-
validate the certificate manually! Certificate information:
446-
- Hostname: svn.qgis.org
447-
- Valid: from Apr 1 00:30:47 2006 GMT until Mar 21 00:30:47 2008 GMT
448-
- Issuer: Developer Team, Quantum GIS, Anchorage, Alaska, US
449-
- Fingerprint: 2f:cd:f1:5a:c7:64:da:2b:d1:34:a5:20:c6:15:67:28:33:ea:7a:9b
450-
(R)eject, accept (t)emporarily or accept (p)ermanently?
451-
```
452-
453-
I suggest you press 'p' to accept the key permanently.
454-
455379
== Configure the build ==
456380

457381
CMake supports out of source build so we will create a 'build' dir for the
@@ -464,7 +388,7 @@ In a Terminal cd to the qgis source folder previously downloaded, then:
464388
```
465389
mkdir build
466390
cd build
467-
cmake -D CMAKE_INSTALL_PREFIX=~/Applications -D CMAKE_BUILD_TYPE=Release \
391+
cmake -D CMAKE_INSTALL_PREFIX=~/Applications \
468392
-D CMAKE_BUILD_TYPE=MinSizeRel \
469393
-D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_MAPSERVER=TRUE \
470394
-D QWT_LIBRARY=/usr/local/qwt-5.2.1-svn/lib/libqwt.dylib \
@@ -485,7 +409,7 @@ cmake -D CMAKE_INSTALL_PREFIX=~/Applications -D CMAKE_BUILD_TYPE=Release \
485409
-D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_MAPSERVER=TRUE \
486410
-D QWT_LIBRARY=/usr/local/qwt-5.2.1-svn/lib/libqwt.dylib \
487411
-D QWT_INCLUDE_DIR=/usr/local/qwt-5.2.1-svn/include \
488-
-D GRASS_PREFIX=/user/local/grass-6.4.0 \
412+
-D GRASS_PREFIX=/user/local/grass-6.4.1 \
489413
..
490414
```
491415

@@ -500,7 +424,7 @@ EOF
500424

501425
sudo chmod +x /usr/local/bin/python32
502426

503-
cmake -D CMAKE_INSTALL_PREFIX=~/Applications -D CMAKE_BUILD_TYPE=Release \
427+
cmake -D CMAKE_INSTALL_PREFIX=~/Applications -D \
504428
-D CMAKE_BUILD_TYPE=MinSizeRel \
505429
-D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_MAPSERVER=TRUE \
506430
-D QWT_LIBRARY=/usr/local/qwt-5.2.1-svn/lib/libqwt.dylib \
@@ -515,12 +439,18 @@ or wait to see if there are immediate crashes when running Qgis. It's also a go
515439
idea to bundle Qt if you need to copy Qgis to other Macs (where you would have to
516440
install Xcode just so Qt would install!).
517441

518-
To bundle Qt, add the following line before the last line in the above cmake configurations:
442+
To bundle Qt, add the following line before the last line (the ".." line) in the above cmake configurations:
519443

520444
```
521445
-D QGIS_MACAPP_BUNDLE=1 \
522446
```
523447

448+
Even better for distribution purposes, to also bundle any extras non-framework, non-standard, libs (ie postgres' libpq) bump the bundle number to 2:
449+
450+
```
451+
-D QGIS_MACAPP_BUNDLE=2 \
452+
```
453+
524454
== Building ==
525455

526456
Now we can start the build process (remember the parallel compilation note at
@@ -536,7 +466,7 @@ If all built without errors you can then install it:
536466
make install
537467
```
538468

539-
or, for a /Applications build:
469+
or, for an /Applications build:
540470

541471
```
542472
sudo make install

0 commit comments

Comments
 (0)
Please sign in to comment.