-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINSTALL.html
3069 lines (2645 loc) · 91.1 KB
/
INSTALL.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META NAME="generator" CONTENT="http://txt2tags.org">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<TITLE>QGIS</TITLE>
<!-- Included /home/fischer/src/qgis/doc/style.css -->
<STYLE TYPE="text/css">
body{ background: white;
color: black;
font-family: arial,sans-serif;
}
pre { margin-left: 2em;
border: 1;
padding: 4px;
background: #ececec; }
pre, code { font-family: monospace }
.overview{ font: 1.82em; font-weight: bold;}
h1{ background-color: #F6F6F6;
color: #8FB171;
font-size: large;
font-weight: bold;
font-family: luxi serif, georgia, times new roman, times, serif;
background: none;
padding: 0.75em 0 0;
margin: 0;
line-height: 1.1em;
border-bottom: 5px solid #DCEB5C;
}
h2{ background-color: #F6F6F6;
color: #8FB171;
font-size: large;
font-weight: normal;
font-family: luxi serif, georgia, times new roman, times, serif;
background: none;
padding: 0.75em 0 0;
margin: 0;
line-height: 1.1em;
}
h3{ background-color: #F6F6F6;
color: #729FCF;
font-family: luxi serif, georgia, times new roman, times, serif;
font-weight: bold;
font-size: medium;
}
h4{ background-color: #F6F6F6;
color: #729FCF;
font-family: luxi serif, georgia, times new roman, times, serif;
font-weight: normal;
font-size: medium;
}
h5{ background-color: #F6F6F6;
color: #729FCF;
font-family: luxi serif, georgia, times new roman, times, serif;
font-weight: bold;
font-size: small;
}
a{ color: #729FCF;
font-family: arial,sans-serif;
font-size: small;
}
label{ background-color: #FFFFCC;
border: 1px solid black;
margin: 1px;
padding: 0px 3px;
font-size: small;
}
</STYLE>
</HEAD>
<BODY>
<DIV CLASS="header" ID="header">
<H1>QGIS</H1>
<H2>Building QGIS from source - step by step</H2>
<H3>Thursday November 02, 2017</H3>
</DIV>
<DIV CLASS="body" ID="body">
<P>
Last Updated: Thursday November 02, 2017
Last Change : Thursday November 02, 2017
</P>
<DIV CLASS="toc">
<OL>
<LI><A HREF="#toc1">Introduction</A>
<LI><A HREF="#toc2">Overview</A>
<LI><A HREF="#toc3">Building on GNU/Linux</A>
<UL>
<LI><A HREF="#toc4">3.1. Building QGIS with Qt 5.x</A>
<LI><A HREF="#toc5">3.2. Prepare apt</A>
<LI><A HREF="#toc6">3.3. Install build dependencies</A>
<LI><A HREF="#toc7">3.4. Setup ccache (Optional, but recommended)</A>
<LI><A HREF="#toc8">3.5. Prepare your development environment</A>
<LI><A HREF="#toc9">3.6. Check out the QGIS Source Code</A>
<LI><A HREF="#toc10">3.7. Starting the compile</A>
<LI><A HREF="#toc11">3.8. Building Debian packages</A>
<LI><A HREF="#toc12">3.9. On Fedora Linux</A>
</UL>
<LI><A HREF="#toc13">Building on Windows</A>
<UL>
<LI><A HREF="#toc14">4.1. Building with Microsoft Visual Studio</A>
<LI><A HREF="#toc15">4.2. Building using MinGW</A>
<LI><A HREF="#toc16">4.3. Creation of MSYS environment for compilation of QGIS</A>
</UL>
<LI><A HREF="#toc17">Building on MacOS X</A>
<UL>
<LI><A HREF="#toc18">5.1. Install Developer Tools</A>
<LI><A HREF="#toc19">5.2. Install Qt4 from disk image</A>
<LI><A HREF="#toc20">5.3. Install CMake for OSX</A>
<LI><A HREF="#toc21">5.4. Install development frameworks for QGIS dependencies</A>
<LI><A HREF="#toc22">5.5. API documentation</A>
<LI><A HREF="#toc23">5.6. QGIS source</A>
<LI><A HREF="#toc24">5.7. Configure the build</A>
<LI><A HREF="#toc25">5.8. Building</A>
<LI><A HREF="#toc26">5.9. Post-Install</A>
</UL>
<LI><A HREF="#toc27">Setting up the WCS test server on GNU/Linux</A>
<UL>
<LI><A HREF="#toc28">6.1. Preparation</A>
<LI><A HREF="#toc29">6.2. Setup mapserver</A>
<LI><A HREF="#toc30">6.3. Create a home page</A>
<LI><A HREF="#toc31">6.4. Now deploy it</A>
<LI><A HREF="#toc32">6.5. Debugging</A>
</UL>
<LI><A HREF="#toc33">Setting up a Jenkins Build Server</A>
<LI><A HREF="#toc34">Debug output and running tests</A>
<LI><A HREF="#toc35">Authors and Acknowledgments</A>
</OL>
</DIV>
<A NAME="toc1"></A>
<H1>1. Introduction</H1>
<P>
This document is the original installation guide of the described software
QGIS. The software and hardware descriptions named in this
document are in most cases registered trademarks and are therefore subject
to the legal requirements. QGIS is subject to the GNU General Public
License. Find more information on the QGIS Homepage:
<A HREF="http://qgis.org">http://qgis.org</A>
</P>
<P>
The details, that are given in this document have been written and verified
to the best of knowledge and responsibility of the editors. Nevertheless,
mistakes concerning the content are possible. Therefore, all data are not
liable to any duties or guarantees. The editors and publishers do not take
any responsibility or liability for failures and their consequences. You are
always welcome for indicating possible mistakes.
</P>
<P>
Because the code of QGIS evolves from release to release, These instructions are
regularly updated to match the corresponding release. Instructions for the current
master branch are available at
<A HREF="http://htmlpreview.github.io/?https://raw.github.com/qgis/QGIS/master/doc/INSTALL.html.">http://htmlpreview.github.io/?https://raw.github.com/qgis/QGIS/master/doc/INSTALL.html.</A>
If you wish to build another version of QGIS, ensure to checkout the appropriate
release branch. The QGIS source code can be found <A HREF="https://github.com/qgis/QGIS">in the repository</A>.
</P>
<P>
Please visit <A HREF="http://qgis.org">http://qgis.org</A> for information on joining our mailing lists
and getting involved in the project further.
</P>
<P>
/!\ <B>Note to document writers:</B> Please use this document as the central
place for describing build procedures. Please do not remove this notice.
</P>
<P>
/!\ <B>Note to document writers:</B> This document is generated from
doc/INSTALL.t2t - if you need to edit this document, be sure to edit that
file rather than the generated INSTALL document found in the root of the
source directory.
</P>
<A NAME="toc2"></A>
<H1>2. Overview</H1>
<P>
QGIS, like a number of major projects (e.g., KDE 4.0), uses CMake
(<A HREF="http://www.cmake.org">http://www.cmake.org</A>) for building from source.
</P>
<P>
Following a summary of the required dependencies for building:
</P>
<P>
Required build tools:
</P>
<UL>
<LI>CMake >= 3.0.0
<LI>Flex >= 2.5.6
<LI>Bison >= 2.4
</UL>
<P>
Required build dependencies:
</P>
<UL>
<LI>Qt >= 5.3.0
<LI>Proj >= 4.4.x
<LI>GEOS >= 3.4
<LI>Sqlite3 >= 3.0.0
<LI>SpatiaLite
<LI>libspatialindex
<LI>GDAL/OGR >= 2.1
<LI>Qwt >= 5.0 & (< 6.1 with internal QwtPolar)
<LI>expat >= 1.95
<LI>QScintilla2
<LI>QCA
<LI>qtkeychain (>= 0.5)
<LI>libzip
</UL>
<P>
Optional dependencies:
</P>
<UL>
<LI>for GRASS providers and plugin - GRASS >= 7.0.0.
<LI>for georeferencer - GSL >= 1.8
<LI>for PostGIS support - PostgreSQL >= 8.0.x
<LI>for gps plugin - gpsbabel
<LI>for mapserver export and PyQGIS - Python >= 3.3
<LI>for python support - SIP >= 4.12, PyQt >= 5.3 must match Qt version, Qscintilla2
<LI>for qgis mapserver - FastCGI
<LI>for oracle provider - Oracle OCI library
</UL>
<P>
Indirect dependencies:
</P>
<P>
Some proprietary formats (e.g., ECW and MrSid) supported by GDAL require
proprietary third party libraries. QGIS doesn't need any of those itself to
build, but will only support those formats if GDAL is built accordingly. Refer
to <A HREF="http://gdal.org/formats_list.html">http://gdal.org/formats_list.html</A> ff. for instructions how to include
those formats in GDAL.
</P>
<A NAME="toc3"></A>
<H1>3. Building on GNU/Linux</H1>
<A NAME="toc4"></A>
<H2>3.1. Building QGIS with Qt 5.x</H2>
<P>
<B>Requires:</B> Ubuntu / Debian derived distro
</P>
<P>
/!\ <B>Note:</B> Refer to the section Building Debian packages for building
debian packages. Unless you plan to develop on QGIS, that is probably the
easiest option to compile and install QGIS.
</P>
<P>
These notes are for Ubuntu - other versions and Debian derived distros may
require slight variations in package names.
</P>
<P>
These notes are for if you want to build QGIS from source. One of the major
aims here is to show how this can be done using binary packages for <B>*all*</B>
dependencies - building only the core QGIS stuff from source. I prefer this
approach because it means we can leave the business of managing system packages
to apt and only concern ourselves with coding QGIS!
</P>
<P>
This document assumes you have made a fresh install and have a 'clean' system.
These instructions should work fine if this is a system that has already been
in use for a while, you may need to just skip those steps which are irrelevant
to you.
</P>
<A NAME="toc5"></A>
<H2>3.2. Prepare apt</H2>
<P>
The packages QGIS depends on to build are available in the "universe" component
of Ubuntu. This is not activated by default, so you need to activate it:
</P>
<OL>
<LI>Edit your /etc/apt/sources.list file.
<LI>Uncomment all the lines starting with "deb"
</OL>
<P>
Also you will need to be running Ubuntu 'precise' or higher in order for
all dependencies to be met.
</P>
<P>
Now update your local sources database:
</P>
<div class="code"><PRE>
sudo apt-get update
</PRE></div>
<A NAME="toc6"></A>
<H2>3.3. Install build dependencies</H2>
<TABLE BORDER="1">
<TR>
<TH>Distribution</TH>
<TH>install command for packages</TH>
</TR>
<TR>
<TD>stretch</TD>
<TD><CODE>apt-get install bison ca-certificates ccache cmake cmake-curses-gui dh-python doxygen expect flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dateutil python3-dev python3-future python3-gdal python3-httplib2 python3-jinja2 python3-markupsafe python3-mock python3-nose2 python3-owslib python3-plotly python3-psycopg2 python3-pygments python3-pyproj python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-requests python3-sip python3-sip-dev python3-six python3-termcolor python3-tz python3-yaml qt5-default qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb</CODE></TD>
</TR>
<TR>
<TD>xenial</TD>
<TD><CODE>apt-get install bison ca-certificates ccache cmake cmake-curses-gui dh-python doxygen expect flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dateutil python3-dev python3-future python3-gdal python3-httplib2 python3-jinja2 python3-markupsafe python3-mock python3-nose2 python3-owslib python3-plotly python3-psycopg2 python3-pygments python3-pyproj python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-requests python3-sip python3-sip-dev python3-six python3-termcolor python3-tz python3-yaml qt5-default qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb</CODE></TD>
</TR>
<TR>
<TD>yakkety</TD>
<TD><CODE>apt-get install bison ca-certificates ccache cmake cmake-curses-gui dh-python doxygen expect flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dateutil python3-dev python3-future python3-gdal python3-httplib2 python3-jinja2 python3-markupsafe python3-mock python3-nose2 python3-owslib python3-plotly python3-psycopg2 python3-pygments python3-pyproj python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-requests python3-sip python3-sip-dev python3-six python3-termcolor python3-tz python3-yaml qt5-default qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb</CODE></TD>
</TR>
<TR>
<TD>zesty</TD>
<TD><CODE>apt-get install bison ca-certificates ccache cmake cmake-curses-gui dh-python doxygen expect flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dateutil python3-dev python3-future python3-gdal python3-httplib2 python3-jinja2 python3-markupsafe python3-mock python3-nose2 python3-owslib python3-plotly python3-psycopg2 python3-pygments python3-pyproj python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-requests python3-sip python3-sip-dev python3-six python3-termcolor python3-tz python3-yaml qt5-default qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb</CODE></TD>
</TR>
<TR>
<TD>artful</TD>
<TD><CODE>apt-get install bison ca-certificates ccache cmake cmake-curses-gui dh-python doxygen expect flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libosgearth-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dateutil python3-dev python3-future python3-gdal python3-httplib2 python3-jinja2 python3-markupsafe python3-mock python3-nose2 python3-owslib python3-plotly python3-psycopg2 python3-pygments python3-pyproj python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-requests python3-sip python3-sip-dev python3-six python3-termcolor python3-tz python3-yaml qt3d-assimpsceneimport-plugin qt3d-defaultgeometryloader-plugin qt3d-gltfsceneio-plugin qt3d-scene2d-plugin qt3d5-dev qt5-default qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb</CODE></TD>
</TR>
<TR>
<TD>sid</TD>
<TD><CODE>apt-get install bison ca-certificates ccache cmake cmake-curses-gui dh-python doxygen expect flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libosgearth-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dateutil python3-dev python3-future python3-gdal python3-httplib2 python3-jinja2 python3-markupsafe python3-mock python3-nose2 python3-owslib python3-plotly python3-psycopg2 python3-pygments python3-pyproj python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-requests python3-sip python3-sip-dev python3-six python3-termcolor python3-tz python3-yaml qt3d-assimpsceneimport-plugin qt3d-defaultgeometryloader-plugin qt3d-gltfsceneio-plugin qt3d-scene2d-plugin qt3d5-dev qt5-default qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb</CODE></TD>
</TR>
</TABLE>
<P>
(extracted from the control.in file in <CODE>debian/</CODE>)
</P>
<P>
See <A HREF="http://qgis.org/en/site/forusers/alldownloads.html#debian-ubuntu">http://qgis.org/en/site/forusers/alldownloads.html#debian-ubuntu</A> for
currently supported distributions (plain xenial's GDAL for instance is to old
and we build with GDAL2 from ubuntugis).
</P>
<A NAME="toc7"></A>
<H2>3.4. Setup ccache (Optional, but recommended)</H2>
<P>
You should also setup ccache to speed up compile times:
</P>
<div class="code"><PRE>
cd /usr/local/bin
sudo ln -s /usr/bin/ccache gcc
sudo ln -s /usr/bin/ccache g++
</PRE></div>
<P>
or simply add <CODE>/usr/lib/ccache</CODE> to your <CODE>PATH</CODE>.
</P>
<A NAME="toc8"></A>
<H2>3.5. Prepare your development environment</H2>
<P>
As a convention I do all my development work in $HOME/dev/<language>, so in
this case we will create a work environment for C++ development work like
this:
</P>
<div class="code"><PRE>
mkdir -p ${HOME}/dev/cpp
cd ${HOME}/dev/cpp
</PRE></div>
<P>
This directory path will be assumed for all instructions that follow.
</P>
<A NAME="toc9"></A>
<H2>3.6. Check out the QGIS Source Code</H2>
<P>
There are two ways the source can be checked out. Use the anonymous method
if you do not have edit privileges for the QGIS source repository, or use
the developer checkout if you have permissions to commit source code
changes.
</P>
<P>
1. Anonymous Checkout
</P>
<div class="code"><PRE>
cd ${HOME}/dev/cpp
git clone git://github.com/qgis/QGIS.git
</PRE></div>
<P>
2. Developer Checkout
</P>
<div class="code"><PRE>
cd ${HOME}/dev/cpp
git clone git@github.com:qgis/QGIS.git
</PRE></div>
<A NAME="toc10"></A>
<H2>3.7. Starting the compile</H2>
<P>
I compile my development version of QGIS into my ~/apps directory to avoid
conflicts with Ubuntu packages that may be under /usr. This way for example
you can use the binary packages of QGIS on your system along side with your
development version. I suggest you do something similar:
</P>
<div class="code"><PRE>
mkdir -p ${HOME}/apps
</PRE></div>
<P>
Now we create a build directory and run ccmake:
</P>
<div class="code"><PRE>
cd QGIS
mkdir build-master
cd build-master
ccmake ..
</PRE></div>
<P>
When you run ccmake (note the .. is required!), a menu will appear where
you can configure various aspects of the build. If you want QGIS to have
debugging capabilities then set CMAKE_BUILD_TYPE to Debug. If you do not have
root access or do not want to overwrite existing QGIS installs (by your
packagemanager for example), set the CMAKE_INSTALL_PREFIX to somewhere you
have write access to (I usually use ${HOME}/apps). Now press
'c' to configure, 'e' to dismiss any error messages that may appear.
and 'g' to generate the make files. Note that sometimes 'c' needs to
be pressed several times before the 'g' option becomes available.
After the 'g' generation is complete, press 'q' to exit the ccmake
interactive dialog.
</P>
<P>
/!\ <B>Warning:</B> Make sure that your build directory is completely empty when you
enter the command. Do never try to "re-use" an existing <B>Qt4</B> build directory.
If you want to use `ccmake` or other interactive tools, run the command in
the empty build directory once before starting to use the interactive tools.
</P>
<P>
Now on with the build:
</P>
<div class="code"><PRE>
make -jX
</PRE></div>
<P>
where X is the number of available cores. Depending on your platform,
this can speed up the build time considerably.
</P>
<P>
Then you can directly run from the build directory:
</P>
<div class="code"><PRE>
./output/bin/qgis
</PRE></div>
<P>
Another option is to install to your system:
</P>
<div class="code"><PRE>
make install
</PRE></div>
<P>
After that you can try to run QGIS:
</P>
<div class="code"><PRE>
$HOME/apps/bin/qgis
</PRE></div>
<P>
If all has worked properly the QGIS application should start up and appear
on your screen. If you get the error message "error while loading shared libraries",
execute this command in your shell.
</P>
<div class="code"><PRE>
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${HOME}/apps/lib/
</PRE></div>
<P>
Optionally, if you already know what aspects you want in your custom build
then you can skip the interactive ccmake .. part by using the cmake -D
option for each aspect, e.g.:
</P>
<div class="code"><PRE>
cmake -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=${HOME}/apps ..
</PRE></div>
<P>
Also, if you want to speed your build times, you can easily do it with ninja,
an alternative to make with similar build options.
</P>
<P>
For example, to configure your build you can do either one of:
</P>
<div class="code"><PRE>
ccmake -G Ninja ..
</PRE></div>
<div class="code"><PRE>
cmake -G Ninja -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=${HOME}/apps ..
</PRE></div>
<P>
Build and install with ninja:
</P>
<div class="code"><PRE>
ninja (uses all cores by default; also supports the above described -jX option)
ninja install
</PRE></div>
<A NAME="toc11"></A>
<H2>3.8. Building Debian packages</H2>
<P>
Instead of creating a personal installation as in the previous step you can
also create debian package. This is done from the QGIS root directory, where
you'll find a debian directory.
</P>
<P>
First you need to install the debian packaging tools once:
</P>
<div class="code"><PRE>
apt-get install build-essential
</PRE></div>
<P>
First you need to create an changelog entry for your distribution. For example
for Ubuntu Precise:
</P>
<div class="code"><PRE>
dch -l ~precise --force-distribution --distribution precise "precise build"
</PRE></div>
<P>
The QGIS packages will be created with:
</P>
<div class="code"><PRE>
dpkg-buildpackage -us -uc -b
</PRE></div>
<P>
/!\ <B>Note:</B> Install <CODE>devscripts</CODE> to get <CODE>dch</CODE>.
</P>
<P>
/!\ <B>Note:</B> If <CODE>dpkg-buildpackage</CODE> complains about unmet build dependencies
you can install them using <CODE>apt-get</CODE> and re-run the command.
</P>
<P>
/!\ <B>Note:</B> If you have <CODE>libqgis1-dev</CODE> installed, you need to remove it first
using <CODE>dpkg -r libqgis1-dev</CODE>. Otherwise <CODE>dpkg-buildpackage</CODE> will complain about a
build conflict.
</P>
<P>
/!\ <B>Note:</B> By default tests are run in the process of building and their
results are uploaded to <A HREF="http://dash.orfeo-toolbox.org/index.php?project=QGIS.">http://dash.orfeo-toolbox.org/index.php?project=QGIS.</A>
You can turn the tests off using DEB_BUILD_OPTIONS=nocheck in front of the
build command. The upload of results can be avoided with DEB_TEST_TARGET=test.
</P>
<P>
The packages are created in the parent directory (ie. one level up).
Install them using dpkg. E.g.:
</P>
<div class="code"><PRE>
sudo debi
</PRE></div>
<A NAME="toc12"></A>
<H2>3.9. On Fedora Linux</H2>
<P>
We assume that you have the source code of QGIS ready and created a
new subdirectory called `build` or `build-qt5` in it.
</P>
<H3>3.9.1. Install build dependencies</H3>
<div class="code"><PRE>
dnf install qt5-qtwebkit-devel qt5-qtlocation-devel qt5-qttools-static qt5-qtscript-devel qca-qt5-devel qca-qt5-ossl qt5-qt3d-devel python3-qt5-devel python3-qscintilla-qt5-devel qscintilla-qt5-devel python3-qscintilla-devel python3-qscintilla-qt5 clang flex bison geos-devel gdal-devel sqlite-devel libspatialite-devel qt5-qtsvg-devel qt5-qtxmlpatterns-devel spatialindex-devel expat-devel proj-devel qwt-qt5-devel gsl-devel postgresql-devel cmake python3-future gdal-python3 python3-psycopg2 python3-PyYAML python3-pygments python3-jinja2 python3-OWSLib qca-qt5-ossl qwt-qt5-devel qtkeychain-qt5-devel qwt-devel sip-devel libzip-devel
</PRE></div>
<P>
To build QGIS server additional dependencies are required:
</P>
<div class="code"><PRE>
dnf install fcgi-devel
</PRE></div>
<P>
Make sure that your build directory is completely empty when you enter the
following command. Do never try to "re-use" an existing Qt4 build directory.
If you want to use `ccmake` or other interactive tools, run the following
command in the empty build directory once before starting to use the interactive
tools.
</P>
<div class="code"><PRE>
cmake ..
</PRE></div>
<P>
If everything went OK you can finally start to compile. (As usual append a -jX
where X is the number of available cores option to make to speed up your build
process)
</P>
<div class="code"><PRE>
make
</PRE></div>
<P>
Run from the build directory
</P>
<div class="code"><PRE>
./output/bin/qgis
</PRE></div>
<P>
Or install to your system
</P>
<div class="code"><PRE>
make install
</PRE></div>
<H3>3.9.2. Suggested system tweaks</H3>
<P>
By default Fedora disables debugging calls from Qt applications. This prevents
the useful debug output which is normally printed when running the unit tests.
</P>
<P>
To enable debug prints for the current user, execute:
</P>
<div class="code"><PRE>
cat > ~/.config/QtProject/qtlogging.ini << EOL
[Rules]
default.debug=true
EOL
</PRE></div>
<A NAME="toc13"></A>
<H1>4. Building on Windows</H1>
<A NAME="toc14"></A>
<H2>4.1. Building with Microsoft Visual Studio</H2>
<P>
This section describes how to build QGIS using Visual Studio on Windows. This
is currently also how the binary QGIS packages are made (earlier versions used
MinGW).
</P>
<P>
This section describes the setup required to allow Visual Studio to be used to
build QGIS.
</P>
<H3>4.1.1. Visual C++ Community Edition</H3>
<P>
The free (as in free beer) Community installer is available under:
</P>
<BLOCKQUOTE>
<A HREF="http://download.microsoft.com/download/D/2/3/D23F4D0F-BA2D-4600-8725-6CCECEA05196/vs_community_ENU.exe">http://download.microsoft.com/download/D/2/3/D23F4D0F-BA2D-4600-8725-6CCECEA05196/vs_community_ENU.exe</A>
</BLOCKQUOTE>
<H3>4.1.2. Other tools and dependencies</H3>
<P>
Download and install following packages:
</P>
<TABLE BORDER="1">
<TR>
<TH>Tool</TH>
<TH>Website</TH>
</TR>
<TR>
<TD>CMake</TD>
<TD><A HREF="https://cmake.org/files/v3.7/cmake-3.7.2-win64-x64.msi">https://cmake.org/files/v3.7/cmake-3.7.2-win64-x64.msi</A></TD>
</TR>
<TR>
<TD>GNU flex, GNU bison and GIT</TD>
<TD><A HREF="http://cygwin.com/setup-x86.exe">http://cygwin.com/setup-x86.exe</A> (32bit) or <A HREF="http://cygwin.com/setup-x86_64.exe">http://cygwin.com/setup-x86_64.exe</A> (64bit)</TD>
</TR>
<TR>
<TD>OSGeo4W</TD>
<TD><A HREF="http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86.exe">http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86.exe</A> (32bit) or <A HREF="http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe">http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe</A> (64bit)</TD>
</TR>
<TR>
<TD>ninja</TD>
<TD><A HREF="https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip">https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip</A></TD>
</TR>
</TABLE>
<P>
OSGeo4W does not only provide ready packages for the current QGIS release and
nightly builds of master, but also offers most of the dependencies needs to
build it.
</P>
<P>
For the QGIS build you need to install following packages from cygwin:
</P>
<UL>
<LI>bison
<LI>flex
<LI>git
</UL>
<P>
and from OSGeo4W (select <I>Advanced Installation</I>):
</P>
<UL>
<LI>expat
<LI>fcgi
<LI>gdal
<LI>grass
<LI>gsl-devel
<LI>iconv
<LI>libzip-devel
<LI>libspatialindex-devel
<LI>pyqt5
<LI>python3-devel
<LI>python3-qscintilla
<LI>python3-nose2
<LI>python3-future
<LI>python3-pyyaml
<LI>python3-mock
<LI>python3-six
<LI>qca-qt5-devel
<LI>qca-qt5-libs
<LI>qscintilla-qt5
<LI>qt5-devel
<LI>qt5-libs-debug
<LI>qtwebkit-qt5-devel
<LI>qtwebkit-qt5-libs-debug
<LI>qwt-devel-qt5
<LI>sip-qt5
<LI>spatialite
<LI>oci
<LI>qtkeychain
<LI>libzip
</UL>
<P>
This will also select packages the above packages depend on.
</P>
<P>
If you install other packages, this might cause issues. Particularly, make sure
<B>not</B> to install the msinttypes package. It installs a stdint.h file in
OSGeo4W[64]\include, that conflicts with Visual Studio own stdint.h, which for
example breaks the build of the virtuallayer provider.
</P>
<P>
Earlier versions of this document also covered how to build all above
dependencies. If you're interested in that, check the history of this page in the Wiki
or the SVN repository.
</P>
<H3>4.1.3. Setting up the Visual Studio project with CMake</H3>
<P>
/!\ Consider this section as example. It tends to outdate, when OSGeo4W and
SDKs move on. <CODE>ms-windows/osgeo4w/package-nightly.cmd</CODE> is used for the
nightly builds and constantly updated and hence might contain necessary
updates that are not yet reflected here.
</P>
<P>
To start a command prompt with an environment that both has the VC++ and the OSGeo4W
variables create the following batch file (assuming the above packages were
installed in the default locations):
</P>
<div class="code"><PRE>
@echo off
set OSGEO4W_ROOT=C:\OSGeo4W
call "%OSGEO4W_ROOT%\bin\o4w_env.bat"
call "%OSGEO4W_ROOT%\bin\py3_env.bat"
call "%OSGEO4W_ROOT%\bin\qt5_env.bat"
set O4W_ROOT=%OSGEO4W_ROOT:\=/%
set LIB_DIR=%O4W_ROOT%
call "C:\Program Files\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
path %path%;C:\Program Files\Microsoft Visual Studio 14.0\VC\bin
path %PATH%;C:\Program Files\CMake\bin;c:\cygwin\bin
@set GRASS_PREFIX=c:/OSGeo4W/apps/grass/grass-7.2.1
@set INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\include
@set LIB=%LIB%;%OSGEO4W_ROOT%\lib;%OSGEO4W_ROOT%\lib
set LIB=%LIB%;%OSGEO4W_ROOT%\apps\Qt5\lib;%OSGEO4W_ROOT%\lib
set INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\apps\Qt5\include;%OSGEO4W_ROOT%\include
@cmd
</PRE></div>
<P>
Start the batch file and on the command prompt checkout the QGIS source from
git to the source directory <CODE>QGIS</CODE>:
</P>
<div class="code"><PRE>
git clone git://github.com/qgis/QGIS.git
</PRE></div>
<P>
Create a 'build' directory somewhere. This will be where all the build output
will be generated.
</P>
<P>
Now run <CODE>cmake-gui</CODE> (still from <CODE>cmd</CODE>) and in the <I>Where is the source code:</I>
box, browse to the top level QGIS directory.
</P>
<P>
In the <I>Where to build the binaries:</I> box, browse to the 'build' directory you
created.
</P>
<P>
If the path to bison and flex contains blanks, you need to use the short name
for the directory (i.e. <CODE>C:\Program Files</CODE> should be rewritten to
<CODE>C:\Progra~n</CODE>, where <CODE>n</CODE> is the number as shown in `dir /x C:\``).
</P>
<P>
Verify that the 'BINDINGS_GLOBAL_INSTALL' option is not checked, so that python
bindings are placed into the output directory when you run the INSTALL target.
</P>
<P>
Hit <CODE>Configure</CODE> to start the configuration and select <CODE>Visual Studio 9 2008</CODE>
and keep <CODE>native compilers</CODE> and click <CODE>Finish</CODE>.
</P>
<P>
The configuration should complete without any further questions and allow you to
click <CODE>Generate</CODE>.
</P>
<P>
Now close <CODE>cmake-gui</CODE> and continue on the command prompt by starting
<CODE>vcexpress</CODE>. Use File / Open / Project/Solutions and open the
qgis-x.y.z.sln File in your project directory.
</P>
<P>
Change <CODE>Solution Configuration</CODE> from <CODE>Debug</CODE> to <CODE>RelWithDebInfo</CODE> (Release
with Debug Info) or <CODE>Release</CODE> before you build QGIS using the ALL_BUILD
target (otherwise you need debug libraries that are not included).
</P>
<P>
After the build completed you should install QGIS using the INSTALL target.
</P>
<P>
Install QGIS by building the INSTALL project. By default this will install to
c:\Program Files\qgis<version> (this can be changed by changing the
CMAKE_INSTALL_PREFIX variable in cmake-gui).
</P>
<P>
You will also either need to add all the dependency DLLs to the QGIS install
directory or add their respective directories to your PATH.
</P>
<H3>4.1.4. Packaging</H3>
<P>
To create a standalone installer there is a perl script named 'creatensis.pl'
in 'qgis/ms-windows/osgeo4w'. It downloads all required packages from OSGeo4W
and repackages them into an installer using NSIS.
</P>
<P>
The script can be run on both Windows and Linux.
</P>
<P>
On Debian/Ubuntu you can just install the 'nsis' package.
</P>
<P>
NSIS for Windows can be downloaded at:
</P>
<BLOCKQUOTE>
<A HREF="http://nsis.sourceforge.net">http://nsis.sourceforge.net</A>
</BLOCKQUOTE>
<P>
And Perl for Windows (including other requirements like 'wget', 'unzip', 'tar'
and 'bzip2') is available at:
</P>
<BLOCKQUOTE>
<A HREF="http://cygwin.com">http://cygwin.com</A>
</BLOCKQUOTE>
<H3>4.1.5. Packaging your own build of QGIS</H3>
<P>
Assuming you have completed the above packaging step, if you want to include
your own hand built QGIS executables, you need to copy them in from your
windows installation into the ms-windows file tree created by the creatensis
script.
</P>
<div class="code"><PRE>
cd ms-windows/
rm -rf osgeo4w/unpacked/apps/qgis/*
cp -r /tmp/qgis1.7.0/* osgeo4w/unpacked/apps/qgis/
</PRE></div>
<P>
Now create a package.
</P>
<div class="code"><PRE>
./quickpackage.sh
</PRE></div>
<P>
After this you should now have a nsis installer containing your own build
of QGIS and all dependencies needed to run it on a windows machine.
</P>
<H3>4.1.6. Osgeo4w packaging</H3>
<P>
The actual packaging process is currently not documented, for now please take a
look at:
</P>
<P>
<I>ms-windows/osgeo4w/package.cmd</I>
</P>
<A NAME="toc15"></A>
<H2>4.2. Building using MinGW</H2>
<P>
<B>Note:</B> This section might be outdated as nowadays Visual C++ is use to build
the "official" packages.
</P>
<P>
<B>Note:</B> For a detailed account of building all the dependencies yourself you
can visit Marco Pasetti's website here:
</P>
<P>
<A HREF="http://www.webalice.it/marco.pasetti/qgis+grass/BuildFromSource.html">http://www.webalice.it/marco.pasetti/qgis+grass/BuildFromSource.html</A>
</P>
<P>
Read on to use the simplified approach with pre-built libraries...
</P>
<H3>4.2.1. MSYS</H3>
<P>
MSYS provides a unix style build environment under windows. We have created a
zip archive that contains just about all dependencies.
</P>
<P>
Get this:
</P>
<P>
<A HREF="http://download.osgeo.org/qgis/win32/msys.zip">http://download.osgeo.org/qgis/win32/msys.zip</A>
</P>
<P>
and unpack to c:\msys
</P>
<P>
If you wish to prepare your msys environment yourself rather than using
our pre-made one, detailed instructions are provided elsewhere in this
document.
</P>
<H3>4.2.2. Qt</H3>
<P>
Download Qt opensource precompiled edition exe and install (including the
download and install of mingw) from here:
</P>
<P>