1
+ Compiling QGIS From Source
2
+ Tim Sutton 2007
1
3
%!encoding: iso-8859-1
2
- = Introduction =
3
4
4
5
5
6
------------------------------------------------------------------------
6
7
7
- 1. Building under windows using msys
8
- 1.1. MSYS:
9
- 1.2. Qt4.3
10
- 1.3. Flex and Bison
11
- 1.4. Python stuff: (optional)
12
- 1.4.1. Download and install Python - use Windows installer
13
- 1.4.2. Download SIP and PyQt4 sources
14
- 1.4.3. Compile SIP
15
- 1.4.4. Compile PyQt
16
- 1.4.5. Final python notes
17
- 1.5. Subversion:
18
- 1.6. CMake:
19
- 1.7. QGIS:
20
- 1.8. Compiling:
21
- 1.9. Configuration
22
- 1.10. Compilation and installation
23
- 1.11. Run qgis.exe from the directory where it's installed (CMAKE_INSTALL_PREFIX)
24
- 1.12. Create the installation package: (optional)
25
- 2. Building on Mac OSX using frameworks and cmake (QGIS > 0.8)
26
- 2.1. Install XCODE
27
- 2.2. Install Qt4 from .dmg
28
- 2.3. Install development frameworks for QGIS dependencies
29
- 2.3.1. Additional Dependencies : GSL
30
- 2.3.2. Additional Dependencies : Expat
31
- 2.3.3. Additional Dependencies : SIP
32
- 2.3.4. Additional Dependencies : PyQt
33
- 2.3.5. Additional Dependencies : Bison
34
- 2.4. Install CMAKE for OSX
35
- 2.5. Install subversion for OSX
36
- 2.6. Check out QGIS from SVN
37
- 2.7. Configure the build
38
- 2.8. GEOS Issues
39
- 2.9. Building
40
- 3. Building on GNU/Linux
41
- 3.1. Building QGIS with Qt4.x
42
- 3.2. Prepare apt
43
- 3.3. Install Qt4
44
- 3.4. Install additional software dependencies required by QGIS
45
- 3.5. GRASS Specific Steps
46
- 3.6. Setup ccache (Optional)
47
- 3.7. Prepare your development environment
48
- 3.8. Check out the QGIS Source Code
49
- 4. Further help and information
50
- 5. Authors and Acknowledgments
8
+ 1. Introduction
9
+ 2. Building under windows using msys
10
+ 2.1. MSYS:
11
+ 2.2. Qt4.3
12
+ 2.3. Flex and Bison
13
+ 2.4. Python stuff: (optional)
14
+ 2.4.1. Download and install Python - use Windows installer
15
+ 2.4.2. Download SIP and PyQt4 sources
16
+ 2.4.3. Compile SIP
17
+ 2.4.4. Compile PyQt
18
+ 2.4.5. Final python notes
19
+ 2.5. Subversion:
20
+ 2.6. CMake:
21
+ 2.7. QGIS:
22
+ 2.8. Compiling:
23
+ 2.9. Configuration
24
+ 2.10. Compilation and installation
25
+ 2.11. Run qgis.exe from the directory where it's installed (CMAKE_INSTALL_PREFIX)
26
+ 2.12. Create the installation package: (optional)
27
+ 3. Building on Mac OSX using frameworks and cmake (QGIS > 0.8)
28
+ 3.1. Install XCODE
29
+ 3.2. Install Qt4 from .dmg
30
+ 3.3. Install development frameworks for QGIS dependencies
31
+ 3.3.1. Additional Dependencies : GSL
32
+ 3.3.2. Additional Dependencies : Expat
33
+ 3.3.3. Additional Dependencies : SIP
34
+ 3.3.4. Additional Dependencies : PyQt
35
+ 3.3.5. Additional Dependencies : Bison
36
+ 3.4. Install CMAKE for OSX
37
+ 3.5. Install subversion for OSX
38
+ 3.6. Check out QGIS from SVN
39
+ 3.7. Configure the build
40
+ 3.8. GEOS Issues
41
+ 3.9. Building
42
+ 4. Building on GNU/Linux
43
+ 4.1. Building QGIS with Qt4.x
44
+ 4.2. Prepare apt
45
+ 4.3. Install Qt4
46
+ 4.4. Install additional software dependencies required by QGIS
47
+ 4.5. GRASS Specific Steps
48
+ 4.6. Setup ccache (Optional)
49
+ 4.7. Prepare your development environment
50
+ 4.8. Check out the QGIS Source Code
51
+ 5. Further help and information
52
+ 6. Authors and Acknowledgments
51
53
52
54
53
55
------------------------------------------------------------------------
54
56
57
+
58
+ 1. Introduction
59
+ ===============
60
+
55
61
/!\ *Note to document writers:* Please use this document as the central
56
62
place for describing build procefures. Please do not remove this notice.
57
63
@@ -63,11 +69,11 @@ simply copy the commands listed in codeblocks that look like this:
63
69
64
70
65
71
66
- 1 . Building under windows using msys
72
+ 2 . Building under windows using msys
67
73
====================================
68
74
69
75
70
- 1 .1. MSYS:
76
+ 2 .1. MSYS:
71
77
==========
72
78
73
79
MSYS provides a unix style build environment under windows. We have created a
@@ -85,7 +91,7 @@ windows application for creating and decompressing files here:
85
91
http://www.7-zip.org/
86
92
87
93
88
- 1 .2. Qt4.3
94
+ 2 .2. Qt4.3
89
95
==========
90
96
91
97
Download qt4.3 opensource precompiled edition exe and install (including the
@@ -112,7 +118,7 @@ If you plan to do some debugging, you'll need to compile debug version of Qt:
112
118
C:\Qt\4.3.0\bin\qtvars.bat compile_debug
113
119
114
120
115
- 1 .3. Flex and Bison
121
+ 2 .3. Flex and Bison
116
122
===================
117
123
118
124
*** Note I think this section can be removed as it should be installed int the
@@ -123,23 +129,23 @@ http://sourceforge.net/project/showfiles.php?group_id=23617&package_id=16424
123
129
(the zip bin) and extract it into c:\msys\mingw\bin
124
130
125
131
126
- 1 .4. Python stuff: (optional)
132
+ 2 .4. Python stuff: (optional)
127
133
=============================
128
134
129
135
Follow this section in case you would like to use Python bindings for QGIS. To
130
136
be able to compile bindings, you need to compile SIP and PyQt4 from sources as
131
137
their installer doesn't include some development files which are necessary.
132
138
133
139
134
- 1 .4.1. Download and install Python - use Windows installer
140
+ 2 .4.1. Download and install Python - use Windows installer
135
141
==========================================================
136
142
137
143
(It doesn't matter to what folder you'll install it)
138
144
139
145
http://python.org/download/
140
146
141
147
142
- 1 .4.2. Download SIP and PyQt4 sources
148
+ 2 .4.2. Download SIP and PyQt4 sources
143
149
=====================================
144
150
145
151
http://www.riverbankcomputing.com/Downloads/sip4/sip-4.6.zip
@@ -148,7 +154,7 @@ http://www.riverbankcomputing.com/Downloads/PyQt4/GPL/PyQt-win-gpl-4.2.zip
148
154
Extract each of the above zip files in a temporary directory.
149
155
150
156
151
- 1 .4.3. Compile SIP
157
+ 2 .4.3. Compile SIP
152
158
==================
153
159
154
160
@@ -159,7 +165,7 @@ Extract each of the above zip files in a temporary directory.
159
165
160
166
161
167
162
- 1 .4.4. Compile PyQt
168
+ 2 .4.4. Compile PyQt
163
169
===================
164
170
165
171
@@ -170,14 +176,14 @@ Extract each of the above zip files in a temporary directory.
170
176
171
177
172
178
173
- 1 .4.5. Final python notes
179
+ 2 .4.5. Final python notes
174
180
=========================
175
181
176
182
/!\ You can delete the directories with unpacked SIP and PyQt4 sources after a
177
183
successfull install, they're not needed anymore.
178
184
179
185
180
- 1 .5. Subversion:
186
+ 2 .5. Subversion:
181
187
================
182
188
183
189
In order to check out QGIS sources from the repository, you need Subversion
@@ -186,15 +192,15 @@ client. This installer should work fine:
186
192
http://subversion.tigris.org/files/documents/15/36797/svn-1.4.3-setup.exe
187
193
188
194
189
- 1 .6. CMake:
195
+ 2 .6. CMake:
190
196
===========
191
197
192
198
CMake is build system used by Quantum GIS. Download it from here:
193
199
194
200
http://www.cmake.org/files/v2.4/cmake-2.4.6-win32-x86.exe
195
201
196
202
197
- 1 .7. QGIS:
203
+ 2 .7. QGIS:
198
204
==========
199
205
200
206
Start a cmd.exe window ( Start -> Run -> cmd.exe ) Create development
@@ -216,7 +222,7 @@ For svn 0.8 branch
216
222
217
223
218
224
219
- 1 .8. Compiling:
225
+ 2 .8. Compiling:
220
226
===============
221
227
222
228
As a background read the generic building with CMake notes at the end of
@@ -238,7 +244,7 @@ Create build directory and set it as current directory:
238
244
239
245
240
246
241
- 1 .9. Configuration
247
+ 2 .9. Configuration
242
248
==================
243
249
244
250
@@ -263,15 +269,15 @@ install prefix to its default c:\program files\
263
269
When configuration is done, click 'OK' to exit the setup utility.
264
270
265
271
266
- 1 .10. Compilation and installation
272
+ 2 .10. Compilation and installation
267
273
==================================
268
274
269
275
270
276
make make install
271
277
272
278
273
279
274
- 1 .11. Run qgis.exe from the directory where it's installed (CMAKE_INSTALL_PREFIX)
280
+ 2 .11. Run qgis.exe from the directory where it's installed (CMAKE_INSTALL_PREFIX)
275
281
=================================================================================
276
282
277
283
Make sure to copy all .dll:s needed to the same directory as the qgis.exe
@@ -292,7 +298,7 @@ c:\msys\local\bin and c:\msys\local\lib directories, so the DLLs will be
292
298
used from that place.
293
299
294
300
295
- 1 .12. Create the installation package: (optional)
301
+ 2 .12. Create the installation package: (optional)
296
302
=================================================
297
303
298
304
Downlad and install NSIS from (http://nsis.sourceforge.net/Main_Page)
@@ -302,21 +308,21 @@ tree. Read the READMEfile there and follow the instructions. Next right click
302
308
on qgis.nsi and choose the option 'Compile NSIS Script'.
303
309
304
310
305
- 2 . Building on Mac OSX using frameworks and cmake (QGIS > 0.8)
311
+ 3 . Building on Mac OSX using frameworks and cmake (QGIS > 0.8)
306
312
==============================================================
307
313
308
314
In this approach I will try to avoid as much as possible building dependencies
309
315
from source and rather use frameworks wherever possible.
310
316
311
317
312
- 2 .1. Install XCODE
318
+ 3 .1. Install XCODE
313
319
==================
314
320
315
321
I recommend to get the latest xcode dmg from the Apple XDC Web site. Install
316
322
XCODE after the ~941mb download is complete.
317
323
318
324
319
- 2 .2. Install Qt4 from .dmg
325
+ 3 .2. Install Qt4 from .dmg
320
326
==========================
321
327
322
328
@@ -350,7 +356,7 @@ Second change the default mkspec symlink so that it points to macx-g++:
350
356
351
357
352
358
353
- 2 .3. Install development frameworks for QGIS dependencies
359
+ 3 .3. Install development frameworks for QGIS dependencies
354
360
=========================================================
355
361
356
362
Download William Kyngesburye's excellent all in one framework that includes
@@ -373,7 +379,7 @@ There are some additional dependencies that at the time of writing are not
373
379
provided as frameworks so we will need to build these from source.
374
380
375
381
376
- 2 .3.1. Additional Dependencies : GSL
382
+ 3 .3.1. Additional Dependencies : GSL
377
383
====================================
378
384
379
385
Retrieve the Gnu Scientific Library from
@@ -393,7 +399,7 @@ Then extract it and build it to a prefix of /usr/local:
393
399
394
400
395
401
396
- 2 .3.2. Additional Dependencies : Expat
402
+ 3 .3.2. Additional Dependencies : Expat
397
403
======================================
398
404
399
405
Get the expat sources:
@@ -412,7 +418,7 @@ Get the expat sources:
412
418
413
419
414
420
415
- 2 .3.3. Additional Dependencies : SIP
421
+ 3 .3.3. Additional Dependencies : SIP
416
422
====================================
417
423
418
424
Retrieve the python bindings toolkit SIP from
@@ -433,7 +439,7 @@ Then extract and build it to a prefix of /usr/local:
433
439
434
440
435
441
436
- 2 .3.4. Additional Dependencies : PyQt
442
+ 3 .3.4. Additional Dependencies : PyQt
437
443
=====================================
438
444
439
445
Retrieve the python bindings toolkit for Qt from
@@ -455,7 +461,7 @@ Then extract and build it to a prefix of /usr/local:
455
461
456
462
457
463
458
- 2 .3.5. Additional Dependencies : Bison
464
+ 3 .3.5. Additional Dependencies : Bison
459
465
======================================
460
466
461
467
The version of bison available by default on Mac OSX is too old so you need to
@@ -477,7 +483,7 @@ Now build and install it to a prefix of /usr/local :
477
483
478
484
479
485
480
- 2 .4. Install CMAKE for OSX
486
+ 3 .4. Install CMAKE for OSX
481
487
==========================
482
488
483
489
Get the latest release from here:
@@ -495,7 +501,7 @@ At the time of writing the file I grabbed was:
495
501
Once downloaded open the dmg and run the installer
496
502
497
503
498
- 2 .5. Install subversion for OSX
504
+ 3 .5. Install subversion for OSX
499
505
===============================
500
506
501
507
The http://sourceforge.net/projects/macsvn/ (MacSVN) project has a downloadable
@@ -538,7 +544,7 @@ old) that is installed by MacOSX
538
544
Now close and reopen your shell to get the updated vars.
539
545
540
546
541
- 2 .6. Check out QGIS from SVN
547
+ 3 .6. Check out QGIS from SVN
542
548
============================
543
549
544
550
Now we are going to check out the sources for QGIS. First we will create a
@@ -579,7 +585,7 @@ this:
579
585
I suggest you press 'p' to accept the key permanently.
580
586
581
587
582
- 2 .7. Configure the build
588
+ 3 .7. Configure the build
583
589
========================
584
590
585
591
CMake supports out of source build so we will create a 'build' dir for the
@@ -593,7 +599,7 @@ build process
593
599
594
600
595
601
596
- 2 .8. GEOS Issues
602
+ 3 .8. GEOS Issues
597
603
================
598
604
599
605
I had some issues with GEOS headers so I made the following edits:
@@ -603,7 +609,7 @@ In file /Library/Frameworks/GEOS.framework/Headers/io.h, comment out line 61
603
609
In file /Library/Frameworks/GEOS.framework/Headers/geom.h, comment out line 145
604
610
605
611
606
- 2 .9. Building
612
+ 3 .9. Building
607
613
=============
608
614
609
615
Now we can start the build process:
@@ -619,11 +625,11 @@ If all built without errors you can then install it:
619
625
620
626
621
627
622
- 3 . Building on GNU/Linux
628
+ 4 . Building on GNU/Linux
623
629
========================
624
630
625
631
626
- 3 .1. Building QGIS with Qt4.x
632
+ 4 .1. Building QGIS with Qt4.x
627
633
=============================
628
634
629
635
*Requires:* Ubuntu Edgy
@@ -640,7 +646,7 @@ in use for a while, you may need to just skip those steps which are irrelevant
640
646
to you.
641
647
642
648
643
- 3 .2. Prepare apt
649
+ 4 .2. Prepare apt
644
650
================
645
651
646
652
The packages qgis depends on to build are available in the "universe" component
@@ -659,7 +665,7 @@ of Ubuntu. This is not activated by default, so you need to activate it:
659
665
```
660
666
661
667
662
- 3 .3. Install Qt4
668
+ 4 .3. Install Qt4
663
669
================
664
670
665
671
```
@@ -705,7 +711,7 @@ of Ubuntu. This is not activated by default, so you need to activate it:
705
711
above commands to select the Qt4 version of the relevant applications.
706
712
707
713
708
- 3 .4. Install additional software dependencies required by QGIS
714
+ 4 .4. Install additional software dependencies required by QGIS
709
715
==============================================================
710
716
711
717
```
@@ -716,7 +722,7 @@ of Ubuntu. This is not activated by default, so you need to activate it:
716
722
```
717
723
718
724
719
- 3 .5. GRASS Specific Steps
725
+ 4 .5. GRASS Specific Steps
720
726
=========================
721
727
722
728
/!\ *Note:* If you don't need to build with GRASS support, you can
@@ -729,7 +735,7 @@ of Ubuntu. This is not activated by default, so you need to activate it:
729
735
```
730
736
731
737
732
- 3 .6. Setup ccache (Optional)
738
+ 4 .6. Setup ccache (Optional)
733
739
============================
734
740
735
741
You should also setup ccache to speed up compile times:
@@ -741,7 +747,7 @@ of Ubuntu. This is not activated by default, so you need to activate it:
741
747
```
742
748
743
749
744
- 3 .7. Prepare your development environment
750
+ 4 .7. Prepare your development environment
745
751
=========================================
746
752
747
753
As a convention I do all my development work in $HOME/dev/<language>, so in
@@ -756,7 +762,7 @@ of Ubuntu. This is not activated by default, so you need to activate it:
756
762
This directory path will be assumed for all instructions that follow.
757
763
758
764
759
- 3 .8. Check out the QGIS Source Code
765
+ 4 .8. Check out the QGIS Source Code
760
766
===================================
761
767
762
768
There are two ways the source can be checked out. Use the anonymous method
@@ -826,14 +832,14 @@ of Ubuntu. This is not activated by default, so you need to activate it:
826
832
on your screen.
827
833
828
834
829
- 4 . Further help and information
835
+ 5 . Further help and information
830
836
===============================
831
837
832
838
Please visit http://qgis.org for information on joining our mailing lists
833
839
and getting involved in the project further.
834
840
835
841
836
- 5 . Authors and Acknowledgments
842
+ 6 . Authors and Acknowledgments
837
843
==============================
838
844
839
845
The follwing people have contributed to this document:
0 commit comments