Skip to content

Commit 69897b3

Browse files
kyngchaosmach0
authored andcommitted
OS X build/install updates
1 parent 9e9577a commit 69897b3

File tree

3 files changed

+273
-208
lines changed

3 files changed

+273
-208
lines changed

INSTALL

+83-73
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Quantum GIS (QGIS)
22
Building QGIS from source - step by step
3-
Sunday August 07, 2011
3+
Sunday November 06, 2011
44

55

6-
Last Updated: Sunday August 07, 2011
7-
Last Change : Tuesday June 28, 2011
6+
Last Updated: Sunday November 06, 2011
7+
Last Change : Sunday November 06, 2011
88

99

1010
1. Introduction
@@ -81,9 +81,9 @@ Following a summary of the required dependencies for building:
8181

8282
Required build tools:
8383

84-
- CMake >= 2.6.0
84+
- CMake >= 2.6.2
8585
- Flex
86-
- Bison
86+
- Bison >= 2.4
8787

8888
Required build deps:
8989

@@ -320,10 +320,10 @@ Install them using dpkg. E.g.:
320320
3.9. A practical case: Building QGIS and GRASS from source on Ubuntu with ECW and MrSID formats support
321321
=======================================================================================================
322322

323-
The following procedure has been tested on Ubuntu 8.04, 8.10 and 9.04 32bit. If you want
324-
to use different versions of the software (gdal, grass, qgis), just make the
325-
necessary adjustments to the following code. This guide assumes that you don't have
326-
installed any previous version of gdal, grass and qgis.
323+
The following procedure has been tested on Ubuntu 8.04, 8.10 and 9.04 32bit. If
324+
you want to use different versions of the software (gdal, grass, qgis), just
325+
make the necessary adjustments to the following code. This guide assumes that
326+
you don't have installed any previous version of gdal, grass and qgis.
327327

328328

329329
3.9.1. Step 1: install base packages
@@ -343,7 +343,7 @@ Go to the ERDAS web site http://www.erdas.com/ and follow the links
343343
then download the "'Image Compression SDK Source Code 3.3'" (you'll need to make a registration
344344
and accept a license).
345345

346-
Uncompress the arquive in a proper location (this guide assumes
346+
Uncompress the archive in a proper location (this guide assumes
347347
that all the downloaded source code will be placed in the user home)
348348
and the enter the newly created folder
349349

@@ -438,23 +438,32 @@ leave the folder
438438
Before downloading and compile GRASS source code you need to install a few
439439
other libraries and programs. We can do this through apt
440440

441-
sudo apt-get install flex bison libreadline5-dev libncurses5-dev lesstif2-dev debhelper dpatch libtiff4-dev \
442-
tcl8.4-dev tk8.4-dev fftw-dev xlibmesa-gl-dev libfreetype6-dev autoconf2.13 autotools-dev \
443-
libgdal1-dev proj libjpeg62-dev libpng12-dev libpq-dev unixodbc-dev doxygen fakeroot cmake \
444-
python-dev python-qt4-common python-qt4-dev python-sip4 python2.5-dev sip4 libglew1.5-dev libxmu6 \
445-
libqt4-dev libgsl0-dev python-qt4 swig python-wxversion python-wxgtk2.8 libwxgtk2.8-0 libwxbase2.8-0 tcl8.4-dev \
446-
tk8.4-dev tk8.4 libfftw3-dev libfftw3-3
441+
sudo apt-get install flex bison libreadline5-dev libncurses5-dev lesstif2-dev \
442+
debhelper dpatch libtiff4-dev tcl8.4-dev tk8.4-dev fftw-dev xlibmesa-gl-dev \
443+
libfreetype6-dev autoconf2.13 autotools-dev libgdal1-dev proj libjpeg62-dev \
444+
libpng12-dev libpq-dev unixodbc-dev doxygen fakeroot cmake python-dev \
445+
python-qt4-common python-qt4-dev python-sip4 python2.5-dev sip4 libglew1.5-dev \
446+
libxmu6 \ libqt4-dev libgsl0-dev python-qt4 swig python-wxversion \
447+
python-wxgtk2.8 libwxgtk2.8-0 libwxbase2.8-0 tcl8.4-dev tk8.4-dev tk8.4 \
448+
libfftw3-dev libfftw3-3
447449

448450
At this point we can get the GRASS source code: you may want to download it
449-
through svn or maybe you want just to download the latest available source code arquive.
450-
For example the GRASS 6.4rc4 is available at http://grass.itc.it/grass64/source/grass-6.4.0RC4.tar.gz
451+
through svn or maybe you want just to download the latest available source code
452+
archive. For example the GRASS 6.4rc4 is available at
453+
http://grass.itc.it/grass64/source/grass-6.4.0RC4.tar.gz
451454

452-
Uncompress the arquive, enter the newly created folder and run configure with a few specific parameters
455+
Uncompress the archive, enter the newly created folder and run configure with a few specific parameters
453456

454-
CFLAGS="-fexceptions" ./configure --with-tcltk-includes=/usr/include/tcl8.4 --with-proj-share=/usr/share/proj --with-gdal=/usr/local/bin/gdal-config \
457+
CFLAGS="-fexceptions" ./configure \
458+
--with-tcltk-includes=/usr/include/tcl8.4 \
459+
--with-proj-share=/usr/share/proj \
460+
--with-gdal=/usr/local/bin/gdal-config \
455461
--with-python=/usr/bin/python2.5-config
456462

457-
The additional gcc option -fexceptions is necessary to enable exceptions support in GRASS libraries. It is currently the only way to avoid QGIS crashes if a fatal error happens in GRASS library. See also http://trac.osgeo.org/grass/ticket/869
463+
The additional gcc option -fexceptions is necessary to enable exceptions
464+
support in GRASS libraries. It is currently the only way to avoid QGIS crashes
465+
if a fatal error happens in GRASS library. See also
466+
http://trac.osgeo.org/grass/ticket/869
458467

459468
Then as usual (it will take a while)
460469

@@ -474,31 +483,21 @@ may want to give it a try
474483
grass64 -wxpython
475484

476485

477-
3.9.6. Step 6: compile and install QGIS
486+
3.9.6. Step 6: Compile and install QGIS
478487
=======================================
479488

480-
As for GRASS you can obtain the QGIS source code from different sources,
481-
for instance from svn or just by downloading one of the source code arquives available
482-
at http://www.qgis.org/download/sources.html
489+
As for GRASS you can obtain the QGIS source code from different sources as described
490+
in section 2 above. Once you have the sources, create a build directory in them:
483491

484-
For example download the QGIS 1.1.0 source code here http://download.osgeo.org/qgis/src/qgis_1.1.0.tar.gz
485-
486-
uncompress the arquive and enter the newly created folder
487-
488-
cd /qgis_1.1.0
492+
cd Quantum-GIS
493+
mkdir build
494+
cd build
489495

490496
then run ccmake
491497

492-
ccmake .
493-
494-
press the "c" key, then when the option list will appear we need to manually
495-
configure the "GRASS_PREFIX" parameter. Scroll down until the "GRASS_PREFIX" will appear,
496-
press enter and manually set it to
497-
498-
/usr/local/grass-6.4.0RC4
499-
500-
then press enter again.
498+
ccmake ..
501499

500+
Press the "c" key to do an initial configure.
502501
Press the "c" again and the option "Press [g] to generate and exit" will appear.
503502
Press the "g" key to generate and exit.
504503

@@ -620,13 +619,9 @@ installed in the default locations):
620619
@cmd
621620

622621
Start the batch file and on the command prompt checkout the QGIS source from
623-
svn to the source directory qgis-trunk:
624-
625-
svn co https://svn.osgeo.org/qgis/trunk/qgis qgis-trunk
622+
git to the source directory Quantum-GIS:
626623

627-
or using git-svn (from the git shell):
628-
629-
git svn clone --username $USER --revision 15611:HEAD https://svn.osgeo.org/qgis/trunk/qgis
624+
git clone git://github.com/qgis/Quantum-GIS.git
630625

631626
Create a 'build' directory somewhere. This will be where all the build output
632627
will be generated.
@@ -1153,9 +1148,9 @@ In this approach I will try to avoid as much as possible building dependencies
11531148
from source and rather use frameworks wherever possible.
11541149

11551150
The base system here is Mac OS X 10.4 (Tiger), with a single architecture
1156-
build. Included are notes for building on Mac OS X 10.5 (Leopard) and 10.6
1157-
(Snow Leopard). Make sure to read each section completely before typing
1158-
the first command you see.
1151+
build. Included are notes for building on Mac OS X 10.5 (Leopard), 10.6
1152+
(Snow Leopard) and 10.7 (Lion).
1153+
Make sure to read each section completely before typing the first command you see.
11591154

11601155
General note on Terminal usage: When I say "cd" to a folder in a Terminal,
11611156
it means type "cd " (without the quotes, make sure to type a space after) and
@@ -1186,10 +1181,12 @@ You need a minimum of Qt-4.4.0. I suggest getting the latest. There is no need
11861181
for the full Qt SDK, so save yourself some download time and get the frameworks
11871182
only.
11881183

1189-
Snow Leopard note: If you are building on Snow Leopard, you will need to
1190-
decide between 32-bit support in the older, Qt Carbon branch, or 64-bit
1184+
Snow Leopard+ note: If you are building on Snow Leopard+, you will need to
1185+
decide between 32-bit support in the older Qt Carbon branch, or 64-bit
11911186
support in the Qt Cocoa branch. Appropriate installers are available for both
1192-
as of Qt-4.5.2. Qt 4.6+ is recommended for Cocoa.
1187+
as of Qt-4.5.2, though they stopped making Carbon packages at Qt 4.7.4.
1188+
Qt 4.6+ is recommended for Cocoa.
1189+
Starting with Lion, Carbon may not work properly, if at all.
11931190

11941191
PPC note: The readymade Qt Cocoa installers don't include PPC support, you'd
11951192
have to compile Qt yourself. But, there appear to be issues with Qt Cocoa on
@@ -1257,8 +1254,8 @@ have problems and you are on your own with those.
12571254
5.2.2. Additional Dependencies: Expat
12581255
=====================================
12591256

1260-
Snow Leopard note: Snow Leopard includes a usable expat, so this step is
1261-
not necessary on Snow Leopard.
1257+
Snow Leopard+ note: Snow Leopard includes a usable expat, so this step is
1258+
not necessary on Snow Leopard or Lion.
12621259

12631260
Get the expat sources:
12641261

@@ -1275,10 +1272,10 @@ source folder and:
12751272
5.2.3. Additional Dependencies: Python
12761273
======================================
12771274

1278-
Leopard and Snow Leopard note: Leopard and Snow Leopard include a usable
1279-
Python 2.5 and 2.6, respectively. So there is no need to install Python on
1280-
Leopard and Snow Leopard. You can still install Python from python.org if
1281-
preferred.
1275+
Leopard+ note: Starting with Leopard a usable Python is included
1276+
in the system. This Python 2.5, 2.6 and 2.7, respectively for Leo, Snow and Lion.
1277+
So there is no need to install Python on Leopard and newer.
1278+
You can still install Python from python.org if preferred.
12821279

12831280
If installing from python.org, make sure you install at least the latest Python
12841281
2.x from
@@ -1313,12 +1310,13 @@ More configuration is needed to install outside the system path:
13131310
python configure.py -n -d /Library/Python/2.5/site-packages -b /usr/local/bin \
13141311
-e /usr/local/include -v /usr/local/share/sip -s MacOSX10.5.sdk
13151312

1316-
Snow Leopard system Python
1313+
Snow Leopard+ system Python
13171314

13181315
Similar to Leopard, you should install outside the system Python path.
13191316
Also, you need to specify the architecture you want (requires at least SIP
13201317
4.9), and make sure to run the versioned python binary (this one responds to
13211318
the 'arch' command, 'python' does not).
1319+
Substitute '2.7' for python version and 10.7 for SDK version below for Lion.
13221320

13231321
If you are using 32-bit Qt (Qt Carbon):
13241322

@@ -1360,12 +1358,13 @@ More configuration is needed to install outside the system path:
13601358

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

1363-
Snow Leopard system Python
1361+
Snow Leopard+ system Python
13641362

13651363
Similar to Leopard, you should install outside the system Python path.
13661364
Also, you need to specify the architecture you want (requires at least PyQt 4.6),
13671365
and make sure to run the versioned python binary (this one responds to the
13681366
'arch' command, which is important for pyuic4, 'python' does not).
1367+
Substitute '2.7' for python version and 10.7 for SDK version below for Lion.
13691368

13701369
If you are using 32-bit Qt (Qt Carbon):
13711370

@@ -1434,7 +1433,7 @@ Carbon note below):
14341433

14351434
Make sure to use the qwt install path from the Qwt build above.
14361435

1437-
Snow Leopard note
1436+
Snow Leopard+ note
14381437

14391438
If using Qt Carbon, you need to specify which architectures to build, otherwise
14401439
it will default to a combination that does not work (ie x86_64 for a Carbon Qt).
@@ -1448,18 +1447,15 @@ This is not needed for Qt Cocoa. Configure as follows:
14481447
5.2.7. Additional Dependencies: Bison
14491448
=====================================
14501449

1451-
Leopard and Snow Leopard note: Leopard and Snow Leopard include Bison 2.3,
1452-
so this step can be skipped on Leopard and Snow Leopard.
1453-
1454-
The version of bison available by default on Mac OS X 10.4 is too old so you
1455-
need to get a more recent one on your system. Download at least version 2.3 from:
1450+
The version of bison available by default on Mac OS X is too old so you
1451+
need to get a more recent one on your system. Download at least version 2.4 from:
14561452

14571453
ftp.gnu.org/gnu/bison/
14581454

1459-
Now build and install it to a prefix of /usr/local. Double-click the source
1455+
Now build and install it to a prefix of /usr/local. Double-click the source
14601456
tarball to unpack it, then cd to the source folder and:
14611457

1462-
./configure --prefix=/usr/local
1458+
./configure --disable-dependency-tracking CFLAGS=-Os
14631459
make
14641460
sudo make install
14651461

@@ -1473,8 +1469,9 @@ http://www.cmake.org/cmake/resources/software.html
14731469

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

14791476
./bootstrap --docdir=/share/doc/CMake --mandir=/share/man
14801477
make
@@ -1500,16 +1497,17 @@ CMake supports out of source build so we will create a 'build' dir for the
15001497
build process. OS X uses ${HOME}/Applications as a standard user app folder (it
15011498
gives it the system app folder icon). If you have the correct permissions you
15021499
may want to build straight into your /Applications folder. The instructions
1503-
below assume you are building into a pre-existing ${HOME}/Applications directory.
1500+
below assume you are building into a ${HOME}/Applications directory.
15041501
In a Terminal cd to the qgis source folder previously downloaded, then:
15051502

15061503
mkdir build
15071504
cd build
15081505
cmake -D CMAKE_INSTALL_PREFIX=~/Applications \
15091506
-D CMAKE_BUILD_TYPE=MinSizeRel \
1510-
-D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_MAPSERVER=TRUE \
1507+
-D WITH_INTERNAL_SPATIALITE=FALSE \
15111508
-D QWT_LIBRARY=/usr/local/qwt-5.2.1-svn/lib/libqwt.dylib \
15121509
-D QWT_INCLUDE_DIR=/usr/local/qwt-5.2.1-svn/include \
1510+
-D BISON_EXECUTABLE=/usr/local/bin/bison \
15131511
..
15141512

15151513
This will automatically find and use the previously installed frameworks, and
@@ -1521,10 +1519,11 @@ path and version as required):
15211519

15221520
cmake -D CMAKE_INSTALL_PREFIX=~/Applications -D CMAKE_BUILD_TYPE=Release \
15231521
-D CMAKE_BUILD_TYPE=MinSizeRel \
1524-
-D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_MAPSERVER=TRUE \
1522+
-D WITH_INTERNAL_SPATIALITE=FALSE \
15251523
-D QWT_LIBRARY=/usr/local/qwt-5.2.1-svn/lib/libqwt.dylib \
15261524
-D QWT_INCLUDE_DIR=/usr/local/qwt-5.2.1-svn/include \
15271525
-D GRASS_PREFIX=/user/local/grass-6.4.1 \
1526+
-D BISON_EXECUTABLE=/usr/local/bin/bison \
15281527
..
15291528

15301529
Snow Leopard note: To handle 32-bit Qt (Carbon), create a 32bit python wrapper
@@ -1539,12 +1538,23 @@ script and add arch flags to the configuration:
15391538

15401539
cmake -D CMAKE_INSTALL_PREFIX=~/Applications -D \
15411540
-D CMAKE_BUILD_TYPE=MinSizeRel \
1542-
-D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_MAPSERVER=TRUE \
1541+
-D WITH_INTERNAL_SPATIALITE=FALSE \
15431542
-D QWT_LIBRARY=/usr/local/qwt-5.2.1-svn/lib/libqwt.dylib \
15441543
-D QWT_INCLUDE_DIR=/usr/local/qwt-5.2.1-svn/include \
1544+
-D BISON_EXECUTABLE=/usr/local/bin/bison \
15451545
-D CMAKE_OSX_ARCHITECTURES=i386 -D PYTHON_EXECUTABLE=/usr/local/bin/python32 \
15461546
..
15471547

1548+
The Qgis Mapserver feature requires fastcgi support. This is included in
1549+
Leopard and Snow Leopard, but was dropped at Lion. To build the Mapserver
1550+
component on Leopard and Snow, add the followling line before the last line in
1551+
the above configuration:
1552+
1553+
-D WITH_MAPSERVER=TRUE \
1554+
1555+
On Lion you are on your own to figure out how to install libfcgi and add fcgi
1556+
support to the system Apache. Not recommended for the average user.
1557+
15481558
Bundling note: Older Qt versions may have problems with some Qt plugins and
15491559
Qgis. The way to handle this is to bundle Qt inside the Qgis application. You
15501560
can do this now or wait to see if there are immediate crashes when running Qgis.

0 commit comments

Comments
 (0)