This file is indexed.

/usr/share/qgis/doc/INSTALL.html is in qgis-common 2.0.1-2build2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
<!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=iso-8859-1">
<TITLE>QGIS</TITLE>

<!-- Included /build/buildd/qgis-2.0.1/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>Monday March 24, 2014</H3>
</DIV>

<DIV CLASS="body" ID="body">
<P>
Last Updated: Monday March 24, 2014
Last Change : Tuesday September 10, 2013
</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 4.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)</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. A practical case: Building QGIS and GRASS from source on Ubuntu with ECW and MrSID formats support</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://www.qgis.org">http://www.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>
You can download this document as part of the QGIS 'User and 
Installation Guide' in HTML and PDF format via <A HREF="http://www.qgis.org">http://www.qgis.org</A>. A current 
version is also available at:
<A HREF="http://www.qgis.org/api/INSTALL.html">http://www.qgis.org/api/INSTALL.html</A>
</P>
<P>
Translations of this document can also be downloaded at the documentation area 
of the QGIS project at <A HREF="http://www.qgis.org">http://www.qgis.org</A>. More information is 
available via <A HREF="http://wiki.qgis.org/qgiswiki/DocumentationWritersCorner">http://wiki.qgis.org/qgiswiki/DocumentationWritersCorner</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 documented 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 (eg. 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 &gt;= 2.8.0
<LI>Flex
<LI>Bison &gt;= 2.4
</UL>

<P>
Required build deps:
</P>

<UL>
<LI>Qt &gt;= 4.5.0
<LI>Proj &gt;= 4.4.x
<LI>GEOS &gt;= 3.0
<LI>Sqlite3 &gt;= 3.0.0
<LI>GDAL/OGR &gt;= 1.4.x
<LI>Qwt &gt;= 5.0 &amp; (&lt; 6.1 with internal QwtPolar)
<LI>expat &gt;= 1.95
</UL>

<P>
Optional dependencies:
</P>

<UL>
<LI>for GRASS plugin - GRASS &gt;= 6.0.0 (libraries compiled with exceptions support on Linux 32bit)
<LI>for georeferencer - GSL &gt;= 1.8
<LI>for postgis support and SPIT plugin - PostgreSQL &gt;= 8.0.x
<LI>for gps plugin - gpsbabel
<LI>for mapserver export and PyQGIS - Python &gt;= 2.3 (2.5+ preferred)
<LI>for python support - SIP &gt;= 4.8, PyQt &gt;= must match Qt version, Qscintilla2
<LI>for qgis mapserver - FastCGI
</UL>

<A NAME="toc3"></A>
<H1>3. Building on GNU/Linux</H1>

<A NAME="toc4"></A>
<H2>3.1. Building QGIS with Qt 4.x</H2>

<P>
<B>Requires:</B> Ubuntu / Debian derived distro
</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>
<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>

<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"
<P></P>
Also you will need to be running (K)Ubuntu 'edgy' or higher in order for 
all dependencies to be met.
<P></P>
Now update your local sources database:
<P></P>

<div class="code"><PRE>
sudo apt-get update 
</PRE></div>

</OL>

<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>lucid</TD>
<TD><CODE>apt-get install bison cmake doxygen flex git-core graphviz grass-dev libexpat1-dev libfcgi-dev libgdal1-dev libgeos-dev libgsl0-dev libpq-dev libproj-dev libqt4-dev libqwt5-qt4-dev libspatialindex-dev libspatialite-dev libsqlite3-dev pkg-config pyqt4-dev-tools python python-dev python-qt4 python-qt4-dev python-sip python-sip-dev txt2tags xauth xfonts-base xvfb</CODE></TD>
</TR>
<TR>
<TD>maverick</TD>
<TD><CODE>apt-get install bison cmake doxygen flex git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal1-dev libgeos-dev libgsl0-dev libpq-dev libproj-dev libqt4-dev libqtwebkit-dev libqwt5-qt4-dev libspatialindex-dev libspatialite-dev libsqlite3-dev pkg-config pyqt4-dev-tools python python-dev python-qt4 python-qt4-dev python-sip python-sip-dev txt2tags xauth xfonts-base xvfb</CODE></TD>
</TR>
<TR>
<TD>natty</TD>
<TD><CODE>apt-get install bison cmake doxygen flex git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal1-dev libgeos-dev libgsl0-dev libpq-dev libproj-dev libqt4-dev libqtwebkit-dev libqwt5-qt4-dev libspatialindex-dev libspatialite-dev libsqlite3-dev pkg-config pyqt4-dev-tools python python-dev python-qt4 python-qt4-dev python-sip python-sip-dev txt2tags xauth xfonts-base xvfb</CODE></TD>
</TR>
<TR>
<TD>oneiric</TD>
<TD><CODE>apt-get install bison cmake doxygen flex git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal1-dev libgeos-dev libgsl0-dev libpq-dev libproj-dev libqt4-dev libqtwebkit-dev libqwt5-qt4-dev libspatialindex-dev libspatialite-dev libsqlite3-dev pkg-config pyqt4-dev-tools python python-dev python-qt4 python-qt4-dev python-sip python-sip-dev txt2tags xauth xfonts-base xvfb</CODE></TD>
</TR>
<TR>
<TD>precise</TD>
<TD><CODE>apt-get install bison cmake doxygen flex git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal1-dev libgeos-dev libgsl0-dev libopenscenegraph-dev libosgearth-dev libpq-dev libproj-dev libqt4-dev libqt4-opengl-dev libqtwebkit-dev libqwt5-qt4-dev libspatialindex-dev libspatialite-dev libsqlite3-dev pkg-config pyqt4-dev-tools python python-dev python-qt4 python-qt4-dev python-sip python-sip-dev txt2tags xauth xfonts-base xvfb</CODE></TD>
</TR>
<TR>
<TD>sid</TD>
<TD><CODE>apt-get install bison cmake doxygen flex git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal1-dev libgeos-dev libgsl0-dev libopenscenegraph-dev libosgearth-dev libpq-dev libproj-dev libqt4-dev libqt4-opengl-dev libqtwebkit-dev libqwt-dev libspatialindex-dev libspatialite-dev libsqlite3-dev pkg-config pyqt4-dev-tools python python-dev python-qt4 python-qt4-dev python-sip python-sip-dev txt2tags xauth xfonts-base xvfb</CODE></TD>
</TR>
<TR>
<TD>squeeze</TD>
<TD><CODE>apt-get install bison cmake doxygen flex git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal1-dev libgeos-dev libgsl0-dev libpq-dev libproj-dev libqt4-dev libqwt5-qt4-dev libspatialindex-dev libspatialite-dev libsqlite3-dev pkg-config pyqt4-dev-tools python python-dev python-qt4 python-qt4-dev python-sip python-sip-dev txt2tags xauth xfonts-base xvfb</CODE></TD>
</TR>
<TR>
<TD>wheezy</TD>
<TD><CODE>apt-get install bison cmake doxygen flex git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal1-dev libgeos-dev libgsl0-dev libopenscenegraph-dev libosgearth-dev libpq-dev libproj-dev libqt4-dev libqt4-opengl-dev libqtwebkit-dev libqwt-dev libspatialindex-dev libspatialite-dev libsqlite3-dev pkg-config pyqt4-dev-tools python python-dev python-qt4 python-qt4-dev python-sip python-sip-dev txt2tags xauth xfonts-base xvfb</CODE></TD>
</TR>
</TABLE>

<P>
(extracted from the respective control files in <CODE>debian/</CODE>)
</P>
<P>
/!\ <B>A Special Note:</B> If you are following this set of instructions on
a system where you already have Qt3 development tools installed, there will
be a conflict between Qt3 tools and Qt4 tools. For example, qmake will
point to the Qt3 version, not the Qt4. Ubuntu Qt4 and Qt3 packages are
designed to live alongside each other. This means that, for example, if you
have them both installed, you will have three qmake exe's:
</P>

<div class="code"><PRE>
/usr/bin/qmake -&gt; /etc/alternatives/qmake 
/usr/bin/qmake-qt3
/usr/bin/qmake-qt4 
</PRE></div>

<P>
The same applies to all other Qt binaries. You will notice above that the
canonical 'qmake' is managed by apt alternatives, so before we start to
build QGIS, we need to make Qt4 the default. To return Qt3 to default later
you can use this same process.
</P>
<P>
You can use apt alternatives to correct this so that the Qt4 version of
applications is used in all cases:
</P>

<div class="code"><PRE>
sudo update-alternatives --config qmake
sudo update-alternatives --config uic 
sudo update-alternatives --config designer 
sudo update-alternatives --config assistant 
sudo update-alternatives --config qtconfig 
sudo update-alternatives --config moc 
sudo update-alternatives --config lupdate 
sudo update-alternatives --config lrelease 
sudo update-alternatives --config linguist 
</PRE></div>

<P>
Use the simple command line dialog that appears after running each of the
above commands to select the Qt4 version of the relevant applications.
</P>
<P>
/!\ <B>Note:</B> For python language bindings SIP &gt;= 4.5 and PyQt4 &gt;= 4.1 is required! Some stable GNU/Linux
distributions (e.g. Debian or SuSE) only provide SIP &lt; 4.5 and PyQt4 &lt; 4.1. To include support for python 
language bindings you may need to build and install those packages from source.
</P>

<A NAME="toc7"></A>
<H2>3.4. Setup ccache (Optional)</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>

<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/&lt;language&gt;, 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/Quantum-GIS.git
</PRE></div>

<P>
2. Developer Checkout
</P>

<div class="code"><PRE>
cd ${HOME}/dev/cpp 
git clone git@github.com:qgis/Quantum-GIS.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 Quantum-GIS
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 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>
Now on with the build:
</P>

<div class="code"><PRE>
make
make install
</PRE></div>

<P>
It may take a little while to build depending on your platform.
</P>
<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.
</P>

<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 Lucid:
</P>

<div class="code"><PRE>
dch -l ~lucid  --force-distribution --distribution lucid "lucid 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> 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>
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. A practical case: Building QGIS and GRASS from source on Ubuntu with ECW and MrSID formats support</H2>

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

<H3>3.9.1. Step 1: install base packages</H3>

<P>
First you need to install the necessary packages required to download the source 
code and compile it. Open the terminal and issue the following command:
</P>

<div class="code"><PRE>
sudo apt-get install build-essential g++ subversion
</PRE></div>

<H3>3.9.2. Step 2: compile and install the ecw libraries</H3>

<P>
Go to the ERDAS web site <A HREF="http://www.erdas.com/">http://www.erdas.com/</A> and follow the links
"'products --> ECW JPEG2000 Codec SDK --> downloads'" 
then download the "'Image Compression SDK Source Code 3.3'" (you'll need to make a registration 
and accept a license).
</P>
<P>
Uncompress the archive in a proper location (this guide assumes 
that all the downloaded source code will be placed in the user home) 
and the enter the newly created folder
</P>

<div class="code"><PRE>
cd /libecwj2-3.3
</PRE></div>

<P>
Compile the code with the standard commands
</P>

<div class="code"><PRE>
./configure
</PRE></div>

<P>
then
</P>

<div class="code"><PRE>
make
</PRE></div>

<P>
then
</P>

<div class="code"><PRE>
sudo make install
</PRE></div>

<P>
leave the folder 
</P>

<div class="code"><PRE>
cd ..
</PRE></div>

<H3>3.9.3. Step 3: download the MrSID binaries</H3>

<P>
Go to the LIZARDTECH web site <A HREF="http://www.lizardtech.com/">http://www.lizardtech.com/</A> and follow the links
"'download --> Developer SDKs'", 
then download the "'GeoExpress SDK for Linux (x86) - gcc 4.1 32-bit'"
(you'll need to make a registration and accept a license).
</P>
<P>
Uncompress the downloaded file. The resulting directory name should be similar to "Geo_DSDK-7.0.0.2167"
</P>

<H3>3.9.4. Step 4: compile and install the gdal libraries</H3>

<P>
Download the latest gdal source code
</P>

<div class="code"><PRE>
svn checkout https://svn.osgeo.org/gdal/trunk/gdal gdal
</PRE></div>

<P>
then copy a few files from the MrSID binaries folder to the folder with the gdal source code
('replace "USERNAME" with your actual account username')
</P>

<div class="code"><PRE>
cp /home/USERNAME/Geo_DSDK-7.0.0.2167/include/*.* /home/USERNAME/gdal/frmts/mrsid/
</PRE></div>

<P>
enter the gdal source code folder
</P>

<div class="code"><PRE>
cd /gdal
</PRE></div>

<P>
and run configure with a few specific parameters
</P>

<div class="code"><PRE>
./configure --without-grass --with-mrsid=../Geo_DSDK-7.0.0.2167 --without-jp2mrsid
</PRE></div>

<P>
at the end of the configuration process you should read something like
</P>

<div class="code"><PRE>
...
GRASS support:             no
...
...
...
ECW support:               yes
MrSID support              yes			
...
</PRE></div>

<P>
then compile normally
</P>

<div class="code"><PRE>
make
</PRE></div>

<P>
and
</P>

<div class="code"><PRE>
sudo make install
</PRE></div>

<P>
finish the process by creating the necessary links to the most recent shared libraries
</P>

<div class="code"><PRE>
sudo ldconfig
</PRE></div>

<P>
at this point you may want to check if gdal was compiled correctly with MrSID and ECW
support by issuing one (or both) of the following commands
</P>

<div class="code"><PRE>
gdalinfo --formats | grep 'ECW'
</PRE></div>

<div class="code"><PRE>
gdalinfo --formats | grep 'SID'
</PRE></div>

<P>
leave the folder 
</P>

<div class="code"><PRE>
cd ..
</PRE></div>

<H3>3.9.5. Step 5: compile and install GRASS</H3>

<P>
Before downloading and compile GRASS source code you need to install a few
other libraries and programs. We can do this through apt
</P>

<div class="code"><PRE>
sudo apt-get install flex bison libreadline5-dev libncurses5-dev lesstif2-dev \
debhelper dpatch libtiff4-dev tcl8.4-dev tk8.4-dev fftw-dev xlibmesa-gl-dev \
libfreetype6-dev autoconf2.13 autotools-dev libgdal1-dev proj libjpeg62-dev \
libpng12-dev libpq-dev unixodbc-dev doxygen fakeroot cmake python-dev \
python-qt4-common python-qt4-dev python-sip4 python2.5-dev sip4 libglew1.5-dev \
libxmu6 \ libqt4-dev libgsl0-dev python-qt4 swig python-wxversion \
python-wxgtk2.8 libwxgtk2.8-0 libwxbase2.8-0 tcl8.4-dev tk8.4-dev tk8.4 \
libfftw3-dev libfftw3-3
</PRE></div>

<P>
At this point we can get the GRASS source code: you may want to download it
through svn or maybe you want just to download the latest available source code
archive.  For example the GRASS 6.4rc4 is available at
<A HREF="http://grass.itc.it/grass64/source/grass-6.4.0RC4.tar.gz">http://grass.itc.it/grass64/source/grass-6.4.0RC4.tar.gz</A>
</P>
<P>
Uncompress the archive, enter the newly created folder and run configure with a few specific parameters
</P>

<div class="code"><PRE>
CFLAGS="-fexceptions" ./configure \
--with-tcltk-includes=/usr/include/tcl8.4 \
--with-proj-share=/usr/share/proj \
--with-gdal=/usr/local/bin/gdal-config \
--with-python=/usr/bin/python2.5-config
</PRE></div>

<P>
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
<A HREF="http://trac.osgeo.org/grass/ticket/869">http://trac.osgeo.org/grass/ticket/869</A>
</P>
<P>
Then as usual (it will take a while)
</P>

<div class="code"><PRE>
make
</PRE></div>

<P>
and
</P>

<div class="code"><PRE>
sudo make install
</PRE></div>

<P>
leave the folder 
</P>

<div class="code"><PRE>
cd ..
</PRE></div>

<P>
you have now compiled and installed GRASS (also with the new wxpyhton interface) so you
may want to give it a try
</P>

<div class="code"><PRE>
grass64 -wxpython
</PRE></div>

<H3>3.9.6. Step 6: Compile and install QGIS</H3>

<P>
As for GRASS you can obtain the QGIS source code from different sources as described 
in section 2 above. Once you have the sources, create a build directory in them:
</P>

<div class="code"><PRE>
cd Quantum-GIS
mkdir build
cd build
</PRE></div>

<P>
then run ccmake
</P>

<div class="code"><PRE>
ccmake ..
</PRE></div>

<P>
Press the "c" key to do an initial configure.
Press the "c" again and the option "Press [g] to generate and exit" will appear.
Press the "g" key to generate and exit.
</P>
<P>
then as usual (it will take a while)
</P>

<div class="code"><PRE>
make
</PRE></div>

<P>
and
</P>

<div class="code"><PRE>
sudo make install
</PRE></div>

<P>
At the end of the process you should have QGIS and GRASS working with MrSID and ECW
raster format support.
</P>
<P>
To run QGIS just use this command 
</P>

<div class="code"><PRE>
qgis
</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++ Express Edition</H3>

<P>
The free (as in free beer) Express Edition installer is available under:
</P>
	<BLOCKQUOTE>
	<A HREF="http://download.microsoft.com/download/d/c/3/dc3439e7-5533-4f4c-9ba0-8577685b6e7e/vcsetup.exe">http://download.microsoft.com/download/d/c/3/dc3439e7-5533-4f4c-9ba0-8577685b6e7e/vcsetup.exe</A>
	</BLOCKQUOTE>
<P>
The optional products are not necessary.  In the process the Windows SDKs for
Visual Studio 2008 will also be downloaded and installed.
</P>
<P>
You also need the Microsoft Windows Server&reg; 2003 R2 Platform SDK (for setupapi):
</P>
	<BLOCKQUOTE>
	<A HREF="http://download.microsoft.com/download/f/a/d/fad9efde-8627-4e7a-8812-c351ba099151/PSDK-x86.exe">http://download.microsoft.com/download/f/a/d/fad9efde-8627-4e7a-8812-c351ba099151/PSDK-x86.exe</A>
	</BLOCKQUOTE>
<P>
You only need Microsoft Windows Core SDK / Build Environment (x86 32-Bit).
</P>

<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="http://www.cmake.org/files/v2.8/cmake-2.8.4-win32-x86.exe">http://www.cmake.org/files/v2.8/cmake-2.8.4-win32-x86.exe</A></TD>
</TR>
<TR>
<TD>Flex</TD>
<TD><A HREF="http://gnuwin32.sourceforge.net/downlinks/flex.php">http://gnuwin32.sourceforge.net/downlinks/flex.php</A></TD>
</TR>
<TR>
<TD>Bison</TD>
<TD><A HREF="http://gnuwin32.sourceforge.net/downlinks/bison.php">http://gnuwin32.sourceforge.net/downlinks/bison.php</A></TD>
</TR>
<TR>
<TD>SVN</TD>
<TD><A HREF="http://sourceforge.net/projects/win32svn/files/1.6.13/Setup-Subversion-1.6.13.msi/download">http://sourceforge.net/projects/win32svn/files/1.6.13/Setup-Subversion-1.6.13.msi/download</A></TD>
</TR>
<TR>
<TD>or GIT</TD>
<TD><A HREF="http://msysgit.googlecode.com/files/Git-1.7.4-preview20110204.exe">http://msysgit.googlecode.com/files/Git-1.7.4-preview20110204.exe</A></TD>
</TR>
<TR>
<TD>OSGeo4W</TD>
<TD><A HREF="http://download.osgeo.org/osgeo4w/osgeo4w-setup.exe">http://download.osgeo.org/osgeo4w/osgeo4w-setup.exe</A></TD>
</TR>
</TABLE>

<P>
OSGeo4W does not only provide ready packages for the current QGIS release and
nightly builds of the trunk, but also offers most of the dependencies needs to
build it.
</P>
<P>
For the QGIS build you need to install following packages from OSGeo4W (select
<I>Advanced Installation</I>):
</P>

<UL>
<LI>expat
<LI>fcgi
<LI>gdal
<LI>grass
<LI>gsl-devel
<LI>iconv
<LI>pyqt4
<LI>qt4-devel
<LI>qwt5-devel-qt4
<LI>sip
<LI>spatialite
<LI>libspatialindex-devel
<LI>python-qscintilla
</UL>

<P>
This will also select packages the above packages depend on.
</P>
<P>
Additionally QGIS also needs the include file <CODE>unistd.h</CODE>, which normally
doesn't exist on Windows.  It's shipped with Flex/Bison in <CODE>GnuWin32\include</CODE>
and needs to be copied into the <CODE>VC\include</CODE> directory of your Visual C++
installation.
</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>
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
path %SYSTEMROOT%\system32;%SYSTEMROOT%;%SYSTEMROOT%\System32\Wbem;%PROGRAMFILES%\CMake 2.8\bin;%PROGRAMFILES%\subversion\bin;%PROGRAMFILES%\GnuWin32\bin
set PYTHONPATH=

set VS90COMNTOOLS=%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\Tools\
call "%PROGRAMFILES%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86

set INCLUDE=%INCLUDE%;%PROGRAMFILES%\Microsoft Platform SDK for Windows Server 2003 R2\include
set LIB=%LIB%;%PROGRAMFILES%\Microsoft Platform SDK for Windows Server 2003 R2\lib

set OSGEO4W_ROOT=C:\OSGeo4W
call "%OSGEO4W_ROOT%\bin\o4w_env.bat"

@set GRASS_PREFIX=c:/OSGeo4W/apps/grass/grass-6.4.0
@set INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\include
@set LIB=%LIB%;%OSGEO4W_ROOT%\lib;%OSGEO4W_ROOT%\lib

@cmd
</PRE></div>

<P>
Start the batch file and on the command prompt checkout the QGIS source from
git to the source directory <CODE>Quantum-GIS</CODE>:
</P>

<div class="code"><PRE>
git clone git://github.com/qgis/Quantum-GIS.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&lt;version&gt; (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 either be run on Windows, but also can be run on 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>
<A HREF="http://qt.nokia.com/downloads/">http://qt.nokia.com/downloads/</A>
</P>
<P>
When the installer will ask for MinGW, you don't need to download and install
it, just point the installer to c:\msys\mingw
</P>
<P>
When Qt installation is complete:
</P>
<P>
Edit C:\Qt\4.7.0\bin\qtvars.bat and add the following lines:
</P>

<div class="code"><PRE>
set PATH=%PATH%;C:\msys\local\bin;c:\msys\local\lib 
set PATH=%PATH%;"C:\Program Files\Subversion\bin" 
</PRE></div>

<P>
I suggest you also add C:\Qt\4.7.0\bin\ to your Environment Variables Path in
the windows system preferences.
</P>
<P>
If you plan to do some debugging, you'll need to compile debug version of Qt:
C:\Qt\4.7.0\bin\qtvars.bat compile_debug
</P>
<P>
Note: there is a problem when compiling debug version of Qt 4.7, the script ends with
this message  "mingw32-make: *** No rule to make target `debug'.  Stop.". To 
compile the debug version you have to go out of src directory and execute the
following command:
</P>

<div class="code"><PRE>
c:\Qt\4.7.0 make 
</PRE></div>

<H3>4.2.3. Flex and Bison</H3>

<P>
Get Flex
<A HREF="http://sourceforge.net/project/showfiles.php?group_id=23617&amp;package_id=16424">http://sourceforge.net/project/showfiles.php?group_id=23617&amp;package_id=16424</A>
(the zip bin) and extract it into c:\msys\mingw\bin
</P>

<H3>4.2.4. Python stuff (optional)</H3>

<P>
Follow this section in case you would like to use Python bindings for QGIS.  To
be able to compile bindings, you need to compile SIP and PyQt4 from sources as
their installer doesn't include some development files which are necessary.
</P>

<H4>4.2.4.1. Download and install Python - use Windows installer</H4>

<P>
(It doesn't matter to what folder you'll install it)
</P>
<P>
<A HREF="http://python.org/download/">http://python.org/download/</A>
</P>

<H4>4.2.4.2. Download SIP and PyQt4 sources</H4>

<P>
<A HREF="http://www.riverbankcomputing.com/software/sip/download">http://www.riverbankcomputing.com/software/sip/download</A>
<A HREF="http://www.riverbankcomputing.com/software/pyqt/download">http://www.riverbankcomputing.com/software/pyqt/download</A>
</P>
<P>
Extract each of the above zip files in a temporary directory. Make sure
to get versions that match your current Qt installed version.
</P>

<H4>4.2.4.3. Compile SIP</H4>

<div class="code"><PRE>
c:\Qt\4.7.0\bin\qtvars.bat 
python configure.py -p win32-g++ 
make 
make install 
</PRE></div>

<H4>4.2.4.4. Compile PyQt</H4>

<div class="code"><PRE>
c:\Qt\4.7.0\bin\qtvars.bat 
python configure.py 
make 
make install 
</PRE></div>

<H4>4.2.4.5. Final python notes</H4>

<P>
/!\ You can delete the directories with unpacked SIP and PyQt4 sources after a
successfull install, they're not needed anymore.
</P>

<H3>4.2.5. git</H3>

<P>
In order to check out QGIS sources from the repository, you need a git client.
This installer should work fine:
</P>
<P>
<A HREF="http://msysgit.googlecode.com/files/Git-1.7.4-preview20110204.exe">http://msysgit.googlecode.com/files/Git-1.7.4-preview20110204.exe</A>
</P>

<H3>4.2.6. CMake</H3>

<P>
CMake is build system used by QGIS. Download it from here:
</P>
<P>
<A HREF="http://www.cmake.org/files/v2.8/cmake-2.8.2-win32-x86.exe">http://www.cmake.org/files/v2.8/cmake-2.8.2-win32-x86.exe</A>
</P>

<H3>4.2.7. QGIS</H3>

<P>
Start a cmd.exe window ( Start -&gt; Run -&gt; cmd.exe ) Create development 
directory and move into it
</P>

<div class="code"><PRE>
md c:\dev\cpp 
cd c:\dev\cpp 
</PRE></div>

<P>
Check out sources from GIT:
</P>

<div class="code"><PRE>
git clone git://github.com/qgis/Quantum-GIS.git
</PRE></div>

<H3>4.2.8. Compiling</H3>

<P>
As a background read the generic building with CMake notes at the end of 
this document.
</P>
<P>
Start a cmd.exe window ( Start -&gt; Run -&gt; cmd.exe ) if you don't have one
already.  Add paths to compiler and our MSYS environment:
</P>

<div class="code"><PRE>
c:\Qt\4.7.0\bin\qtvars.bat 
</PRE></div>

<P>
For ease of use add c:\Qt\4.7.0\bin\ to your system path in system
properties so you can just type qtvars.bat when you open the cmd console.
Create build directory and set it as current directory:
</P>

<div class="code"><PRE>
cd c:\dev\cpp\qgis 
md build 
cd build 
</PRE></div>

<H3>4.2.9. Configuration</H3>

<div class="code"><PRE>
cmakesetup ..  
</PRE></div>

<P>
<B>Note:</B> You must include the '..' above.
</P>
<P>
Click 'Configure' button.  When asked, you should choose 'MinGW Makefiles' as
generator.
</P>
<P>
There's a problem with MinGW Makefiles on Win2K. If you're compiling on this
platform, use 'MSYS Makefiles' generator instead.
</P>
<P>
All dependencies should be picked up automatically, if you have set up the
Paths correctly. The only thing you need to change is the installation
destination (CMAKE_INSTALL_PREFIX) and/or set 'Debug'.
</P>
<P>
For compatibility with NSIS packaging scripts I recommend to leave the install
prefix to its default c:\program files\
</P>
<P>
When configuration is done, click 'OK' to exit the setup utility.
</P>

<H3>4.2.10. Compilation and installation</H3>

<div class="code"><PRE>
 make make install 
</PRE></div>

<H3>4.2.11. Run qgis.exe from the directory where it's installed (CMAKE_INSTALL_PREFIX)</H3>

<P>
Make sure to copy all .dll:s needed to the same directory as the qgis.exe
binary is installed to, if not already done so, otherwise QGIS will complain
about missing libraries when started.
</P>
<P>
A possibility is to run qgis.exe when your path contains c:\msys\local\bin and
c:\msys\local\lib directories, so the DLLs will be used from that place.
</P>

<H3>4.2.12. Create the installation package: (optional)</H3>

<P>
Download and install NSIS from (<A HREF="http://nsis.sourceforge.net/Main_Page">http://nsis.sourceforge.net/Main_Page</A>)
</P>
<P>
Now using windows explorer, enter the win_build directory in your QGIS source
tree. Read the READMEfile there and follow the instructions. Next right click
on qgis.nsi and choose the option 'Compile NSIS Script'. 
</P>

<A NAME="toc16"></A>
<H2>4.3. Creation of MSYS environment for compilation of QGIS</H2>

<H3>4.3.1. Initial setup</H3>

<H4>4.3.1.1. MSYS</H4>

<P>
This is the environment that supplies many utilities from UNIX world in Windows and is needed
by many dependencies to be able to compile.
</P>
<P>
Download from here:
</P>
	<BLOCKQUOTE>
	<A HREF="http://puzzle.dl.sourceforge.net/sourceforge/mingw/MSYS-1.0.11-2004.04.30-1.exe">http://puzzle.dl.sourceforge.net/sourceforge/mingw/MSYS-1.0.11-2004.04.30-1.exe</A>
	</BLOCKQUOTE>
<P>
Install to <CODE>c:\msys</CODE>
</P>
<P>
All stuff we're going to compile is going to get to this directory (resp. its subdirs).
</P>

<H4>4.3.1.2. MinGW</H4>

<P>
Download from here:
</P>
	<BLOCKQUOTE>
	<A HREF="http://puzzle.dl.sourceforge.net/sourceforge/mingw/MinGW-5.1.3.exe">http://puzzle.dl.sourceforge.net/sourceforge/mingw/MinGW-5.1.3.exe</A>
	</BLOCKQUOTE>
<P>
Install to <CODE>c:\msys\mingw</CODE>
</P>
<P>
It suffices to download and install only <CODE>g++</CODE> and <CODE>mingw-make</CODE> components.
</P>

<H4>4.3.1.3. Flex and Bison</H4>

<P>
Flex and Bison are tools for generation of parsers, they're needed for GRASS and also QGIS compilation.
</P>
<P>
Download the following packages:
</P>
	<BLOCKQUOTE>
	<A HREF="http://gnuwin32.sourceforge.net/downlinks/flex-bin-zip.php">http://gnuwin32.sourceforge.net/downlinks/flex-bin-zip.php</A>
	</BLOCKQUOTE>
	<BLOCKQUOTE>
	<A HREF="http://gnuwin32.sourceforge.net/downlinks/bison-bin-zip.php">http://gnuwin32.sourceforge.net/downlinks/bison-bin-zip.php</A>
	</BLOCKQUOTE>
	<BLOCKQUOTE>
	<A HREF="http://gnuwin32.sourceforge.net/downlinks/bison-dep-zip.php">http://gnuwin32.sourceforge.net/downlinks/bison-dep-zip.php</A>
	</BLOCKQUOTE>
<P>
Unpack them all to <CODE>c:\msys\local</CODE>
</P>

<H3>4.3.2. Installing dependencies</H3>

<H4>4.3.2.1. Getting ready</H4>

<P>
Paul Kelly did a great job and prepared a package of precompiled libraries for GRASS.
The package currently includes:
</P>

<UL>
<LI>zlib-1.2.3
<LI>libpng-1.2.16-noconfig
<LI>xdr-4.0-mingw2
<LI>freetype-2.3.4
<LI>fftw-2.1.5
<LI>PDCurses-3.1
<LI>proj-4.5.0
<LI>gdal-1.4.1
</UL>

<P>
It's available for download here:
</P>
	<BLOCKQUOTE>
	<A HREF="http://www.stjohnspoint.co.uk/grass/wingrass-extralibs.tar.gz">http://www.stjohnspoint.co.uk/grass/wingrass-extralibs.tar.gz</A>
	</BLOCKQUOTE>
<P>
Moreover he also left the notes how to compile it (for those interested):
</P>
	<BLOCKQUOTE>
	<A HREF="http://www.stjohnspoint.co.uk/grass/README.extralibs">http://www.stjohnspoint.co.uk/grass/README.extralibs</A>
	</BLOCKQUOTE>
<P>
Unpack the whole package to <CODE>c:\msys\local</CODE>
</P>

<H4>4.3.2.2. GRASS</H4>

<P>
Grab sources from CVS or use a weekly snapshot, see:
</P>
	<BLOCKQUOTE>
	<A HREF="http://grass.itc.it/devel/cvs.php">http://grass.itc.it/devel/cvs.php</A>
	</BLOCKQUOTE>
<P>
In MSYS console go to the directory where you've unpacked or checked out sources
(e.g. <CODE>c:\msys\local\src\grass-6.3.cvs</CODE>)
</P>
<P>
Run these commands:
</P>

<div class="code"><PRE>
export PATH="/usr/local/bin:/usr/local/lib:$PATH"
./configure --prefix=/usr/local --bindir=/usr/local --with-includes=/usr/local/include --with-libs=/usr/local/lib --with-cxx --without-jpeg \
--without-tiff --with-postgres=yes --with-postgres-includes=/local/pgsql/include --with-pgsql-libs=/local/pgsql/lib --with-opengl=windows --with-fftw \
--with-freetype --with-freetype-includes=/mingw/include/freetype2 --without-x --without-tcltk --enable-x11=no --enable-shared=yes \
--with-proj-share=/usr/local/share/proj
make
make install
</PRE></div>

<P>
It should get installed to <CODE>c:\msys\local\grass-6.3.cvs</CODE>
</P>
<P>
By the way, these pages might be useful:
</P>

<UL>
<LI><A HREF="http://grass.gdf-hannover.de/wiki/WinGRASS_Current_Status">http://grass.gdf-hannover.de/wiki/WinGRASS_Current_Status</A>
<LI><A HREF="http://geni.ath.cx/grass.html">http://geni.ath.cx/grass.html</A>
</UL>

<H4>4.3.2.3. GEOS</H4>

<P>
Download the sources:
</P>
	<BLOCKQUOTE>
	<A HREF="http://geos.refractions.net/geos-2.2.3.tar.bz2">http://geos.refractions.net/geos-2.2.3.tar.bz2</A>
	</BLOCKQUOTE>
<P>
Unpack to e.g. <CODE>c:\msys\local\src</CODE>
</P>
<P>
To compile, I had to patch the sources: in file <CODE>source/headers/timeval.h</CODE> line 13.
Change it from:
</P>

<div class="code"><PRE>
#ifdef _WIN32
</PRE></div>

<P>
to:
</P>

<div class="code"><PRE>
#if defined(_WIN32) &amp;&amp; defined(_MSC_VER)
</PRE></div>

<P>
Now, in MSYS console, go to the source directory and run:
</P>

<div class="code"><PRE>
./configure --prefix=/usr/local
make
make install
</PRE></div>

<H4>4.3.2.4. SQLITE</H4>

<P>
You can use precompiled DLL, no need to compile from source:
</P>
<P>
Download this archive:
</P>
	<BLOCKQUOTE>
	<A HREF="http://www.sqlite.org/sqlitedll-3_3_17.zip">http://www.sqlite.org/sqlitedll-3_3_17.zip</A>
	</BLOCKQUOTE>
<P>
and copy sqlite3.dll from it to <CODE>c:\msys\local\lib</CODE>
</P>
<P>
Then download this archive:
</P>
	<BLOCKQUOTE>
	<A HREF="http://www.sqlite.org/sqlite-source-3_3_17.zip">http://www.sqlite.org/sqlite-source-3_3_17.zip</A>
	</BLOCKQUOTE>
<P>
and copy sqlite3.h to <CODE>c:\msys\local\include</CODE>
</P>

<H4>4.3.2.5. GSL</H4>

<P>
Download sources:
</P>
	<BLOCKQUOTE>
	<A HREF="ftp://ftp.gnu.org/gnu/gsl/gsl-1.9.tar.gz">ftp://ftp.gnu.org/gnu/gsl/gsl-1.9.tar.gz</A>
	</BLOCKQUOTE>
<P>
Unpack to <CODE>c:\msys\local\src</CODE>
</P>
<P>
Run from MSYS console in the source directory:
</P>

<div class="code"><PRE>
./configure
make
make install
</PRE></div>

<H4>4.3.2.6. EXPAT</H4>

<P>
Download sources:
</P>
	<BLOCKQUOTE>
	<A HREF="http://dfn.dl.sourceforge.net/sourceforge/expat/expat-2.0.0.tar.gz">http://dfn.dl.sourceforge.net/sourceforge/expat/expat-2.0.0.tar.gz</A>
	</BLOCKQUOTE>
<P>
Unpack to <CODE>c:\msys\local\src</CODE>
</P>
<P>
Run from MSYS console in the source directory:
</P>

<div class="code"><PRE>
./configure
make
make install
</PRE></div>

<H4>4.3.2.7. POSTGRES</H4>

<P>
We're going to use precompiled binaries. Use the link below for download:
</P>
	<BLOCKQUOTE>
	<A HREF="http://wwwmaster.postgresql.org/download/mirrors-ftp?file=%2Fbinary%2Fv8.2.4%2Fwin32%2Fpostgresql-8.2.4-1-binaries-no-installer.zip">http://wwwmaster.postgresql.org/download/mirrors-ftp?file=%2Fbinary%2Fv8.2.4%2Fwin32%2Fpostgresql-8.2.4-1-binaries-no-installer.zip</A>
	</BLOCKQUOTE>
<P>
copy contents of pgsql directory from the archive to <CODE>c:\msys\local</CODE>
</P>

<H3>4.3.3. Cleanup</H3>

<P>
We're done with preparation of MSYS environment. Now you can delete all stuff in <CODE>c:\msys\local\src</CODE> - it takes quite a lot
of space and it's not necessary at all.
</P>

<A NAME="toc17"></A>
<H1>5. Building on MacOS X</H1>

<P>
In this approach I will try to avoid as much as possible building dependencies
from source and rather use frameworks wherever possible.
</P>
<P>
"Universal", SDK and non-default arch builds require more complex options and
some fiddling with the system. It is best to stick with a single, default,
architecture build and follow these instructions for an initial build.
Included are notes for building on Mac OS X 10.5 (<U>Leopard</U>), 10.6
(<U>Snow Leopard</U>), 10.7 (<U>Lion</U>) and 10.8 (<U>Mt. Lion</U>).
(These names will be used throughout the instructions.)
Make sure to read each section completely before typing the first command you see.
</P>
<P>
<U>General note on Terminal usage:</U>  When I say "cd" to a folder in a Terminal,
it means type "cd " (without the quotes, make sure to type a space after) and
then type the path to said folder, then &lt;return&gt;.  A simple way to do this
without having to know and type the full path is, after type the "cd " part,
drag the folder (use the icon in its window title bar, or drag a folder from
within a window) from the Desktop to the Terminal, then tap &lt;return&gt;.
</P>
<P>
<U>Parallel Compilation:</U> On multiprocessor/multicore Macs, it's possible to
speed up compilation, but it's not automatic.  Whenever you type "make" (but
NOT "make install"), instead type:
</P>

<div class="code"><PRE>
make -j [#cpus]
</PRE></div>

<P>
Replace [#cpus] with the number of cores and/or processors your Mac has.  On recent
models with hyperthreading processors this can be double the physical count of
processors and cores.
</P>
<P>
ie: Mac Pro "8 Core" model (2 quad core processors) = 8
</P>
<P>
ie: Macbook Pro i5 (hyperthreading) = 2 cores X 2 = 4
</P>
<P>
To find out how many CPUs you have available, run the following in Terminal:
</P>

<div class="code"><PRE>
/usr/sbin/sysctl -n hw.ncpu
</PRE></div>

<P>
which can be used in build shell scripts like:
</P>

<div class="code"><PRE>
make -j $(/usr/sbin/sysctl -n hw.ncpu)
</PRE></div>

<P>
<U>Note:</U> if you get an error in parallel compilation, try removing the -j # flag,
so it's just 'make', or using a smaller number.  Sometimes make can hiccup on too
many threads.
</P>

<A NAME="toc18"></A>
<H2>5.1. Install Developer Tools</H2>

<P>
Developer tools are not a part of a standard OS X installation.  Up through
Snow Leopard, the Developer Tools, later called Xcode, were included with the
system install disks, though it's best to download the latest version compatible
with your system to get important updates fixing various issues.
Starting with Lion, Xcode is available as a download and from the App Store.
</P>
<P>
Downloading Xcode/Developer Tools for up through Snow Leopard requires a free developer account at
developer.apple.com.  Up through Snow Leopard, get the latest <U>Xcode</U> that is
supported for your system.  For Lion and above, you can get Xcode from either a
free developer account or for a minimal fee from the app store.
When installing Xcode up through Snow Leopard, make sure to
do a custom install and install the Unix Development or Command Line Tools option.
</P>
<P>
On Lion, if you have installed Xcode 4.0 - 4.2 and are upgrading to 4.3, it's
a good idea to uninstall the old version first with:
</P>

<div class="code"><PRE>
sudo /Developer/Library/uninstall-devtools
</PRE></div>

<P>
On Lion and Mt. Lion, using Xcode 4.4+, the developer command line tools can be
installed via the Xcode preferences.
</P>
<P>
Xcode 4.3+ also introduces the clang frontend to the LLVM compiler as default.
</P>
<P>
<B>Note:</B> In XCODE 4.5 installed from the app store, you need to install the
command line tools from XCode -&gt; Preferences -&gt; Downloads and choose command line tools.
</P>
<P>
<A HREF="http://clang.llvm.org/">http://clang.llvm.org/</A>
</P>
<P>
The supplied clang version 4 can compile QGIS, but presents many warnings
compared to just using LLVM. You can specifically use LLVM by exporting paths to
the compilers in Terminal, or shell scripts, prior to building QGIS:
</P>

<div class="code"><PRE>
export CC=/usr/bin/llvm-gcc
export CXX=/usr/bin/llvm-g++
</PRE></div>

<P>
If you have trouble building some of the dependencies listed below with clang
(e.g. OSG &amp; osgEarth), try using only the LLVM compilers.
</P>

<A NAME="toc19"></A>
<H2>5.2. Install Qt4 from disk image</H2>

<P>
You need a minimum of Qt-4.4.0. I suggest getting the latest (Qt 4, not 5).  There is no need
for the full Qt SDK, so save yourself some download time and get the frameworks
only.  This is available in the Libraries section of the Qt download page.
</P>
<P>
<U>Snow Leopard+ note:</U> If you are building on Snow Leopard+, you will need to
decide between 32-bit support in the older Qt Carbon branch, or 64-bit
support in the Qt Cocoa branch. Appropriate installers are available for both
as of Qt-4.5.2, though they stopped making Carbon packages at Qt 4.7.4.
Qt 4.6+ is recommended for Cocoa.
Starting with Lion, Carbon may not work properly, if at all.
Starting with Qt 4.8, only 64bit Cocoa installers are available.
</P>
<P>
<U>General note:</U> Support for new system versions in any given Qt version may
not be present and may cause a 'This version of Mac OS X
is unsupported' error when building QGIS.  Try the next Qt version.
</P>
<P>
<U>PPC note:</U> The readymade Qt Cocoa installers don't include PPC support, you'd
have to compile Qt yourself.  But, there appear to be issues with Qt Cocoa on
PPC Macs anyways.  Qt Carbon is recommended on PPC Macs.
</P>
<P>
<A HREF="http://qt-project.org/downloads">http://qt-project.org/downloads</A>
</P>
<P>
If you want debug frameworks, Qt also provides a separate download with these.
These are in addition to the non-debug frameworks.
</P>
<P>
Earlier OS X systems may need an old Qt version - check the requirements of the
current Qt version.  To get old Qt downloads, there is an FTP link at the bottom
of the download page.  Files are in the qt/source (yes, even the binary packages).
</P>
<P>
Once downloaded open the disk image and run the installer. Note you need admin
privileges to install.
</P>
<P>
<U>Leopard+ note:</U> Qt includes a couple non-framework libraries in /usr/lib.
When using a system SDK these libraries will not be found.  To fix this problem,
add symlinks to /usr/local:
</P>

<div class="code"><PRE>
sudo ln -s /usr/lib/libQtUiTools.a /usr/local/lib/
sudo ln -s /usr/lib/libQtCLucene.dylib /usr/local/lib/
</PRE></div>

<P>
These should then be found automatically.  Earlier systems
may need some help by adding '-L/usr/local/lib' to CMAKE_SHARED_LINKER_FLAGS,
CMAKE_MODULE_LINKER_FLAGS and CMAKE_EXE_LINKER_FLAGS in the cmake build.
</P>

<A NAME="toc20"></A>
<H2>5.3. Install CMake for OSX</H2>

<P>
Get the latest source release from here:
</P>
<P>
<A HREF="http://www.cmake.org/cmake/resources/software.html">http://www.cmake.org/cmake/resources/software.html</A>
</P>
<P>
Binary installers are available for OS X, but they are not recommended
(2.4 versions install in /usr instead of /usr/local, and 2.6+ versions are a
strange application). Instead, download the source.
NOTE: 2.8.5 is broken for detecting part of Qt.  Fixed in 2.8.6.
Double-click the source tarball to unpack it, then cd to the source folder and:
</P>

<div class="code"><PRE>
./bootstrap --docdir=/share/doc/CMake --mandir=/share/man
make -j [#cpus]
sudo make install
</PRE></div>

<H3>5.3.1. Optional setup: ccache</H3>

<P>
<U>Xcode 4.4+ note:</U> You will probably not need to install ccache if you are using
the clang frontend to LLVM compiler, a setup that already provides fairly quick
compile times.
</P>
<P>
Setup ccache to significantly speed up compile times after initial build.
(Switching git branches will again cause longer initial build times unless
separate build directories are used for each branch.)
</P>
<P>
Get the latest source release from here:
</P>
<P>
<A HREF="http://ccache.samba.org/">http://ccache.samba.org/</A>
</P>
<P>
Double-click the source tarball to unpack, then, in Terminal.app, cd to the
source folder and:
</P>

<div class="code"><PRE>
./configure
make
sudo make install
</PRE></div>

<P>
After install, symbolically link compilers to /usr/local/bin/ccache.
(Note: this differs from instructions at <A HREF="http://ccache.samba.org/manual.html">http://ccache.samba.org/manual.html</A>
Changing the /usr/bin:/usr/local/bin order in PATH is not recommended on OS X.
</P>

<div class="code"><PRE>
sudo mkdir /usr/local/bin/compilers &amp;&amp; cd /usr/local/bin/compilers
sudo ln -s ../ccache gcc
sudo ln -s ../ccache g++
sudo ln -s ../ccache cc
sudo ln -s ../ccache c++
</PRE></div>

<P>
Add the following to the end of your ~/.bash_profile (and optionally ~/.bashrc)
to allow your login shell to discover the symbolically linked compilers before
/usr/bin compilers and to easily toggle using ccache off, by commenting out the
line and starting a new login session in Terminal.
</P>

<div class="code"><PRE>
export PATH=/usr/local/bin/compilers:$PATH
</PRE></div>

<P>
If you have trouble building some of the dependencies listed below (e.g. OSG &amp;
osgEarth), try bypassing ccache.
</P>

<A NAME="toc21"></A>
<H2>5.4. Install development frameworks for QGIS dependencies</H2>

<P>
Download William Kyngesburye's excellent GDAL Complete package that includes
PROJ, GEOS, GDAL, SQLite3, Spatialite, and image libraries, as frameworks.
There are also GSL and FreeType frameworks.
</P>
<P>
<A HREF="http://www.kyngchaos.com/software/frameworks">http://www.kyngchaos.com/software/frameworks</A>
</P>
<P>
Once downloaded, open and install the frameworks.
</P>
<P>
William provides an additional installer package for Postgresql (for PostGIS
support).  QGIS just needs the libpq client library, so unless you want to
setup the full Postgres + PostGIS server, all you need is the client-only
package.  It's available here:
</P>
<P>
<A HREF="http://www.kyngchaos.com/software/postgres">http://www.kyngchaos.com/software/postgres</A>
</P>
<P>
Also available is a GRASS application:
</P>
<P>
<A HREF="http://www.kyngchaos.com/software/grass">http://www.kyngchaos.com/software/grass</A>
</P>
<P>
Old versions of these packages for older systems are available in the
software archive section.
</P>

<H3>5.4.1. Additional dependencies: General compatibility note</H3>

<P>
There are some additional dependencies that, at the time of writing, are not
provided as frameworks or installers so we will need to build these from source.
If you are wanting to build QGIS as a 64-bit application, you will need to
provide the appropriate build commands to produce 64-bit support in dependencies.
Likewise, for 32-bit support on Snow Leopard, you will need to override the
default system architecture, which is 64-bit, according to instructions for
individual dependency packages.
</P>
<P>
Stable release versions are preferred.  Beta and other development versions may
have problems and you are on your own with those.
</P>

<H3>5.4.2. Additional dependencies: Expat</H3>

<P>
<U>Snow Leopard+ note:</U> Snow Leopard includes a usable expat, so this step is
not necessary on Snow Leopard or above.
</P>
<P>
Get the expat sources:
</P>
<P>
<A HREF="http://sourceforge.net/project/showfiles.php?group_id=10127">http://sourceforge.net/project/showfiles.php?group_id=10127</A>
</P>
<P>
Double-click the source tarball to unpack, then, in Terminal.app, cd to the
source folder and:
</P>

<div class="code"><PRE>
./configure
make
sudo make install
</PRE></div>

<H3>5.4.3. Additional dependencies: Spatialindex</H3>

<P>
Get the libspatialindex sources:
</P>
<P>
<A HREF="http://download.osgeo.org/libspatialindex/">http://download.osgeo.org/libspatialindex/</A>
</P>
<P>
Double-click the source tarball to unpack, then, in Terminal.app, cd to the
source folder and:
</P>

<div class="code"><PRE>
./configure --disable-dependency-tracking CFLAGS=-Os
make
sudo make install
</PRE></div>

<H3>5.4.4. Additional dependencies: Python</H3>

<P>
<U>Leopard+ note:</U> Starting with Leopard a usable Python is included
in the system.  This is Python 2.5, 2.6 and 2.7, respectively for Leo, Snow and Lion+.
So there is no need to install Python on Leopard and newer.
You can still install Python from python.org if preferred.
</P>
<P>
If installing from python.org, make sure you install the latest Python
2.x from
</P>
<P>
<A HREF="http://www.python.org/download/">http://www.python.org/download/</A>
</P>
<P>
Python 3 is a major change, and may have compatibility issues, so try it at
your own risk.
</P>

<H3>5.4.5. Additional dependencies: SIP</H3>

<P>
<U>Mt Lion note:</U> SIP 4.15.7 appears to not work on Mt Lion.  Install 4.14.6.
(or a later working version when available)
</P>
<P>
Retrieve the python bindings toolkit SIP from
</P>
<P>
<A HREF="http://www.riverbankcomputing.com/software/sip/download">http://www.riverbankcomputing.com/software/sip/download</A>
</P>
<P>
Double-click the source tarball to unpack it, then, in Terminal.app,
cd to the source folder.  Then for your chosen Python:
</P>
<P>
<U>python.org Python</U>
</P>

<div class="code"><PRE>
python configure.py
make
sudo make install
</PRE></div>

<P>
<U>Leopard system Python</U>
</P>
<P>
SIP wants to install in the system path -- this is not a good idea.
More configuration is needed to install outside the system path:
</P>

<div class="code"><PRE>
python configure.py -n -d /Library/Python/2.5/site-packages -b /usr/local/bin \
-e /usr/local/include -v /usr/local/share/sip -s MacOSX10.5.sdk
</PRE></div>

<P>
<U>Snow Leopard system Python</U>
</P>
<P>
Similar to Leopard, you should install outside the system Python path.
Also, you need to specify the architecture you want (requires at least SIP
4.9), and make sure to run the versioned python binary (this one responds to
the 'arch' command, 'python' does not).
Substitute '2.7' for python version and 10.7 for SDK version below for Lion.
</P>
<P>
If you are using 32-bit Qt (Qt Carbon):
</P>

<div class="code"><PRE>
python2.6 configure.py -n -d /Library/Python/2.6/site-packages -b /usr/local/bin \
-e /usr/local/include -v /usr/local/share/sip --arch=i386 -s MacOSX10.6.sdk
</PRE></div>

<P>
For 64-bit Qt (Qt Cocoa), use this configure line:
</P>

<div class="code"><PRE>
python2.6 configure.py -n -d /Library/Python/2.6/site-packages -b /usr/local/bin \
-e /usr/local/include -v /usr/local/share/sip --arch=x86_64 -s MacOSX10.6.sdk
</PRE></div>

<P>
<U>Lion+ system Python</U>
</P>
<P>
Similar to Snow Leopard, you should install outside the system Python path.
The SDK option should match the system you are compiling on:
</P>
<P>
for Lion:
</P>

<div class="code"><PRE>
python2.7 configure.py -d /Library/Python/2.7/site-packages -b /usr/local/bin \
-e /usr/local/include -v /usr/local/share/sip --arch=x86_64 -s MacOSX10.7.sdk
</PRE></div>

<P>
for Mt. Lion:
</P>

<div class="code"><PRE>
python2.7 configure.py -d /Library/Python/2.7/site-packages -b /usr/local/bin \
-e /usr/local/include -v /usr/local/share/sip --arch=x86_64 -s MacOSX10.8.sdk
</PRE></div>

<P>
<U>continue...</U>
</P>
<P>
Then continue with compilation and installation:
</P>

<div class="code"><PRE>
make
sudo make install
</PRE></div>

<H3>5.4.6. Additional dependencies: QScintilla2</H3>

<P>
Retrieve the Qt version of the Scintilla-based text editor widget from
</P>
<P>
<A HREF="http://www.riverbankcomputing.co.uk/software/qscintilla/download">http://www.riverbankcomputing.co.uk/software/qscintilla/download</A>
</P>
<P>
Double-click the tarball to unpack it. Then, cd to the QScintilla2.x.x source
folder in a Terminal.
</P>
<P>
QScintilla2 wants to install in the system path -- with libraries going into
/Library/Frameworks and headers into /usr/include/Qsci -- this is not a good
idea, and it also basically breaks the QtDesigner plugin. More configuration
is needed to install outside the system path, in /usr/local/:
</P>

<div class="code"><PRE>
cd Qt4Qt5
</PRE></div>

<P>
Edit QScintilla-gpl-2.x.x/Qt4Qt5/qscintilla.pro in the following manner:
</P>

<div class="code"><PRE>
current line --&gt; new line

target.path = $$[QT_INSTALL_LIBS]  --&gt;  target.path = /usr/local/lib
header.path = $$[QT_INSTALL_HEADERS]  --&gt;  header.path = /usr/local/include
</PRE></div>

<P>
Save the qscintilla.pro file and build the QScintilla2 C++ library (adjust the install_name_tool command for the version installed):
</P>

<div class="code"><PRE>
qmake -spec macx-g++ qscintilla.pro
make -j [#cpus]
sudo make install

sudo install_name_tool -id /usr/local/lib/libqscintilla2.9.dylib \
  /usr/local/lib/libqscintilla2.9.dylib
</PRE></div>

<P>
This installs QScintilla2's dylib in /usr/local/lib/ and the header files in
/usr/local/include/Qsci/, both of which should be automatically found when
building QGIS.
</P>

<H4>5.4.6.1. Optional setup: QScintilla2 QtDesigner plugin</H4>

<P>
The plugin allows QScintilla2 widgets to be used within QtDesigner.
</P>

<div class="code"><PRE>
cd &lt;QScintilla2 source directory&gt;
cd designer-Qt4Qt5
qmake -spec macx-g++ designer.pro
make
sudo make install
</PRE></div>

<P>
Installs in /Developer/Applications/Qt/plugins/designer/
</P>

<H3>5.4.7. Additional dependencies: PyQt</H3>

<P>
Retrieve the python bindings toolkit for Qt from
</P>
<P>
<A HREF="http://www.riverbankcomputing.com/software/pyqt/download">http://www.riverbankcomputing.com/software/pyqt/download</A>
</P>
<P>
Double-click the source tarball to unpack it, then, in Terminal.app,
cd to the source folder.  Then for your chosen Python:
</P>
<P>
<U>python.org Python</U>
</P>

<div class="code"><PRE>
python configure.py -n /usr/local/Qt4.8/qsci
yes
</PRE></div>

<P>
<U>Leopard system Python</U>
</P>
<P>
PyQt wants to install in the system path -- this is not a good idea.
More configuration is needed to install outside the system path:
</P>

<div class="code"><PRE>
python configure.py -d /Library/Python/2.5/site-packages -b /usr/local/bin -n /usr/local/Qt4.8/qsci -v /usr/local/share/sip/PyQt4
</PRE></div>

<P>
<U>Snow Leopard system Python</U>
</P>
<P>
Similar to Leopard, you should install outside the system Python path.
Also, you need to specify the architecture you want (requires at least PyQt 4.6),
and make sure to run the versioned python binary (this one responds to the
'arch' command, which is important for pyuic4, 'python' does not).
Substitute '2.7' for python version and 10.7 for SDK version below for Lion.
</P>
<P>
If you are using 32-bit Qt (Qt Carbon):
</P>

<div class="code"><PRE>
python2.6 configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin \
-n /usr/local/Qt4.8/qsci -v /usr/local/share/sip/PyQt4 --use-arch i386
</PRE></div>

<P>
For 64-bit Qt (Qt Cocoa), use this configure line:
</P>

<div class="code"><PRE>
python2.6 configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin \
-n /usr/local/Qt4.8/qsci -v /usr/local/share/sip/PyQt4 --use-arch x86_64
</PRE></div>

<P>
<U>Lion and Mt. Lion system Python</U>
</P>
<P>
Similar to Snow Leopard, you should install outside the system Python path.
But you don't need the use-arch option:
</P>

<div class="code"><PRE>
python2.7 configure.py -d /Library/Python/2.7/site-packages -b /usr/local/bin -n /usr/local/Qt4.8/qsci -v /usr/local/share/sip/PyQt4
</PRE></div>

<P>
<U>continue...</U>
</P>

<div class="code"><PRE>
make -j [#cpus]
sudo make install
</PRE></div>

<P>
If there is a problem with undefined symbols in QtOpenGL on Leopard, edit
QtOpenGL/makefile and add -undefined dynamic_lookup to LFLAGS.
Then make again.
</P>

<H3>5.4.8. Additional dependencies: QScintilla2 Python Module</H3>

<P>
This will create the Qsci.so module in /Library/Python/2.x/site-packages/PyQt4.
Like PyQt, it needs help to not install in system locations.
</P>
<P>
<U>Snow Leopard:</U> substitute '2.6' for Python version
</P>

<div class="code"><PRE>
cd &lt;QScintilla2 source dir&gt;
cd Python
python2.7 configure.py -o /usr/local/lib -n /usr/local/include \
-d /Library/Python/2.7/site-packages/PyQt4 -v /usr/local/share/sip/PyQt4 \
--sip-incdir=/usr/local/include --pyqt-sipdir=/usr/local/share/sip/PyQt4
cat &gt;&gt;Qsci.pro &lt;&lt;EOF
QMAKE_LFLAGS_PLUGIN -= -dynamiclib
QMAKE_LFLAGS_PLUGIN += -bundle
EOF
qmake -spec macx-g++ Qsci.pro
make -j [#cpus]
sudo make install
</PRE></div>

<P>
The -o and -n options should match the QScintilla2 C++ dylib install options.
</P>

<H3>5.4.9. Additional dependencies: Qwt</H3>

<P>
The GPS tracking feature uses Qwt.
</P>
<P>
NOTE: PyQwt is not compatible with PyQt 4.9, so we will skip that.
</P>
<P>
Download the latest Qwt 6.0 source (6.1 does not work with the QwtPolar in QGIS) from:
</P>
<P>
<A HREF="http://sourceforge.net/projects/qwt">http://sourceforge.net/projects/qwt</A>
</P>
<P>
Double-click the tarball to unpack it. Now, cd to the qwt source folder in a
Terminal.
</P>
<P>
Type these commands to build and install 6.0.x (assumes v6.0.2, adjust commands
for other version as needed):
</P>

<div class="code"><PRE>
cat &gt;&gt; qwtconfig.pri &lt;&lt;EOF
QWT_CONFIG -= QwtFramework
EOF
qmake -spec macx-g++
make -j [#cpus]
sudo make install

sudo install_name_tool -id /usr/local/qwt-6.0.2/lib/libqwt.6.dylib \
  /usr/local/qwt-6.0.2/lib/libqwt.6.dylib
</PRE></div>

<P>
The Qwt shared library is now installed in /usr/local/qwt-6.0.x (x is
the point version).  Remember this for QGIS configuration.
</P>

<H3>5.4.10. Additional dependencies: Bison</H3>

<P>
The version of bison available by default on Mac OS X is too old so you
need to get a more recent one on your system. Download at least version 2.4 from:
</P>

<div class="code"><PRE>
ftp.gnu.org/gnu/bison/
</PRE></div>

<P>
Now build and install it to a prefix of /usr/local. Double-click the source
tarball to unpack it, then cd to the source folder and:
</P>

<div class="code"><PRE>
./configure --disable-dependency-tracking CFLAGS=-Os
make
sudo make install
</PRE></div>

<H3>5.4.11. Additional dependencies: gpsbabel</H3>

<P>
For integrated GPS Tools functions, a gpsbabel executable is required. You can
find this at:
</P>
<P>
<A HREF="http://www.gpsbabel.org/">http://www.gpsbabel.org/</A>
</P>
<P>
Download the GPSBabel OS X package, and copy GPSBabelFE.app from the disk image to
/Applications.
</P>

<H3>5.4.12. Optional dependencies: libfcgi</H3>

<P>
If you want to use the QGIS Mapserver, you need libfcgi.  This is included on
systems up through Snow Leopard, but was dropped at Lion.  So, on Lion you need
to get the source from:
</P>
<P>
<A HREF="http://www.fastcgi.com/dist/">http://www.fastcgi.com/dist/</A>
</P>
<P>
Grab the latest fcgi SNAP package there. Double-click the source
tarball to unpack it, then cd to the source folder and:
</P>

<div class="code"><PRE>
./configure --disable-dependency-tracking CFLAGS=-Os
make
sudo make install
</PRE></div>

<H3>5.4.13. Optional dependencies: OSG &amp; osgEarth</H3>

<P>
If you want the Globe plugin in QGIS (default OFF), OSG and osgEarth are needed.
</P>
<P>
First, <B>OpenSceneGraph</B>.  The main site is very out of date, just go to
github:
</P>
<P>
<A HREF="http://github.com/openscenegraph/osg/tags">http://github.com/openscenegraph/osg/tags</A>
</P>
<P>
Download the latest 3.1 version (you can select a tarball when you hover over
the entry).  Double-click the source tarball to unpack it.
(There is a version numbering oddity in the source, but since we'll be
bundling OSG as it's meant to be, it really doesn't matter).
</P>
<P>
Installation is a bit out of touch with OS X standards, so we'll stage it to a
temporary location first.  You could stage it to the folder that the OSG source
folder is in, or a common staging area like /Users/Shared/unix/osg.  Pick a
folder not hidden and that doesn't need admin permissions to write to for simplicity.
</P>
<P>
If you are building on Leopard, its configure forces a old ppc/i386 32bit build.
If you want 64bit you need to fix CMakeLists.txt - in a text editor, find the
if-block that starts with:
</P>

<div class="code"><PRE>
ELSEIF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.6" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.5")
</PRE></div>

<P>
In that section before the next ELSEIF, change:
</P>

<div class="code"><PRE>
ppc;i386
</PRE></div>

<P>
to:
</P>

<div class="code"><PRE>
i386;x86_64
</PRE></div>

<P>
and change:
</P>

<div class="code"><PRE>
mmacosx-version-min=10.5
</PRE></div>

<P>
to:
</P>

<div class="code"><PRE>
mmacosx-version-min=10.6
</PRE></div>

<P>
In a new Terminal cd to the source folder and:
</P>

<div class="code"><PRE>
mkdir build
cd build
cmake -D CMAKE_INSTALL_PREFIX=/path/to/some/staging/folder \
-D OSG_COMPILE_FRAMEWORKS=ON \
-D OSG_PLUGIN_SEARCH_INSTALL_DIR_FOR_PLUGINS=OFF \
-D JASPER_LIBRARY=/Library/Frameworks/UnixImageIO.framework \
-D JASPER_INCLUDE_DIR=/Library/Frameworks/UnixImageIO.framework/Headers \
-D TIFF_LIBRARY=/Library/Frameworks/UnixImageIO.framework \
-D TIFF_INCLUDE_DIR=/Library/Frameworks/UnixImageIO.framework/Headers \
..
make
make install
sudo mkdir -p "/Library/Application Support/OpenSceneGraph/PlugIns"
</PRE></div>

<P>
Open the staging folder you chose for the CMAKE_INSTALL_PREFIX option above.
</P>
<P>
Now move all .frameworks from the lib/ folder in the staging area to /Library/Frameworks.  Move the files in the osgPlugins folder in the lib/ folder
to /Library/Application Support/OpenSceneGraph/PlugIns.  The bin/ executables
can be left where they are.
</P>
<P>
Next up is <B>libzip</B>.  Get the latest tarball at:
</P>
<P>
<A HREF="http://nih.at/libzip/">http://nih.at/libzip/</A>
</P>
<P>
Double-click the source tarball to unpack it.
In a new Terminal cd to the source folder and:
</P>

<div class="code"><PRE>
./configure --disable-dependency-tracking --disable-shared CFLAGS=-Os
make
sudo make install
</PRE></div>

<P>
Then it's time for <B>osgEarth</B>.  Downloads are also on github:
</P>
<P>
<A HREF="http://github.com/gwaldron/osgearth/tags">http://github.com/gwaldron/osgearth/tags</A>
</P>
<P>
Download a tarball for the latest stable release (sorting can be confusing here).
Double-click the source tarball to unpack it.
</P>
<P>
<U>Note:</U> for now stick with version 2.3.  There are compile errors in 2.4 that need attention.
</P>
<P>
This one also needs an intermediate staging area.  Choose a folder similar to OSG.
</P>
<P>
In a new Terminal cd to the source folder and:
</P>

<div class="code"><PRE>
mkdir build
cd build
export PATH="/path/to/osg/staging/folder/bin:$PATH"
cmake -D CMAKE_INSTALL_PREFIX=/path/to/some/staging/folder \
-D CMAKE_BUILD_TYPE=MinSizeRel \
-D OSGEARTH_BUILD_FRAMEWORKS=true \
..
make
make install
sudo mkdir -p "/Library/Application Support/OpenSceneGraph/Headers"
</PRE></div>

<P>
Open the staging folder you chose for the CMAKE_INSTALL_PREFIX option above.
Also open the OSG staging path /bin folder from the OSG build.
</P>
<P>
Move all the .frameworks from the lib/ folder to /Library/Frameworks.
Move the files in the osgPlugins folder in the lib/ folder to
/Library/Application Support/OpenSceneGraph/PlugIns.  Move the osgEarthDrivers
folder in the include/ folder to /Library/Application Support/OpenSceneGraph/Headers.
(you may need to create this folder)
And as for OSG, you can leave the bin/ executables where they are.
</P>

<A NAME="toc22"></A>
<H2>5.5. API documentation</H2>

<P>
If you want to build a local copy of the API docs (like those at
<A HREF="http://doc.qgis.org/api">http://doc.qgis.org/api</A>) you will need Graphviz and Doxygen installed:
</P>
<P>
<A HREF="http://www.graphviz.org/Download_macos.php">http://www.graphviz.org/Download_macos.php</A>
</P>
<P>
<A HREF="http://www.stack.nl/~dimitri/doxygen/download.html">http://www.stack.nl/~dimitri/doxygen/download.html</A>
</P>
<P>
Graphviz is simply installed via a regular Mac package installer. Install it
first. It will place some of its binaries in /usr/local/bin/.
</P>
<P>
For Doxygen, compiling the source is recommended over installing the app.
Double-click the source tarball to unpack it, then cd to the source folder and:
</P>

<div class="code"><PRE>
./configure
make -j [#cpus]
sudo make install
</PRE></div>

<P>
The documentation will be output to the build directory, and if using more complete
QGIS.app bundling on install, inside the app in:
</P>
<P>
QGIS.app/Contents/Resources/doc
</P>

<A NAME="toc23"></A>
<H2>5.6. QGIS source</H2>

<P>
Unzip the QGIS source tarball to a working folder of your choice
(/usr/somewhere is not a good choice as it's hidden and requires root
privileges).  If you are reading this from the source, you've already done
this.
</P>
<P>
If you want to experiment with the latest development sources, go to the github
QGIS project page:
</P>
<P>
<A HREF="http://github.com/qgis/Quantum-GIS">http://github.com/qgis/Quantum-GIS</A>
</P>
<P>
It should default to the master branch.  Click the <U>Downloads</U> button and
select <U>Download .tar.gz</U>. Double-click the tarball to unzip it.
</P>
<P>
<I>Alternatively</I>, install git from <A HREF="http://git-scm.com">http://git-scm.com</A> and do the following.
</P>
<P>
Make a specific repository directory somewhere, e.g. ~/QGIS/Quantum-GIS, and cd
into it. The following will read-only clone the master branch to the directory:
</P>

<div class="code"><PRE>
git init
git remote add -f -t master -m master qgisupstream git://github.com/qgis/Quantum-GIS.git
git merge qgisupstream

</PRE></div>

<A NAME="toc24"></A>
<H2>5.7. Configure the build</H2>

<P>
CMake supports out of source build so we will create a 'build' dir for the
build process. OS X uses ${HOME}/Applications as a standard user app folder (it
gives it the system app folder icon).  If you have the correct permissions you
may want to build straight into your /Applications folder. The instructions
below assume you are building into a ${HOME}/Applications directory.
</P>
<P>
You have two interactive options for configuring the build: ccmake or run
Terminal commands. ccmake is a curses interface inside Terminal for CMake and
allows a tabular layout for viewing and editing ALL available QGIS source CMake
options. To get started initially run the Terminal method.
</P>
<P>
In a Terminal cd to the qgis source folder previously downloaded, then:
</P>

<div class="code"><PRE>
mkdir build
cd build
cmake -D CMAKE_INSTALL_PREFIX=~/Applications \
-D CMAKE_BUILD_TYPE=MINSIZEREL -D ENABLE_TESTS=FALSE \
-D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_PYSPATIALITE=FALSE \
-D SPATIALINDEX_LIBRARY=/usr/local/lib/libspatialindex.dylib \
-D SPATIALINDEX_INCLUDE_DIR=/usr/local/include/spatialindex \
-D QWT_LIBRARY=/usr/local/qwt-6.0.2/lib/libqwt.dylib \
-D QWT_INCLUDE_DIR=/usr/local/qwt-6.0.2/include \
-D BISON_EXECUTABLE=/usr/local/bin/bison \
..
</PRE></div>

<P>
<U>Note:</U> Don't forget the .. on the last line, which tells CMake to look for the
source files in one directory up.
</P>
<P>
After the initial Terminal configure, you can use ccmake to make further changes:
</P>

<div class="code"><PRE>
cd build
ccmake ..
</PRE></div>

<P>
This will automatically find and use the previously installed frameworks, and
the GRASS application if installed.  Remember to change the Qwt version if a
different version was installed, and possibly paths, e.g. for Qwt 6.0.2 installed
as a framework use:
</P>

<div class="code"><PRE>
-D QWT_LIBRARY=/usr/local/qwt-6.0.2/lib/qwt.framework/qwt \
-D QWT_INCLUDE_DIR=/usr/local/qwt-6.0.2/lib/qwt.framework/Headers \
</PRE></div>

<P>
If you want to use a newer PostgreSQL client than the default Mac OS X version,
e.g. install from kyngchaos.com, set the following option to pg_config's path:
</P>

<div class="code"><PRE>
-D POSTGRES_CONFIG=/usr/local/pgsql/bin/pg_config \
</PRE></div>

<P>
To build a local copy of the API docs (see API documentation section above):
</P>

<div class="code"><PRE>
-D WITH_APIDOC=TRUE \
</PRE></div>

<P>
<U>Snow Leopard note:</U> To handle 32-bit Qt (Carbon), create a 32bit python wrapper
script and add arch flags to the configuration:
</P>

<div class="code"><PRE>
sudo cat &gt;/usr/local/bin/python32 &lt;&lt;EOF
#!/bin/sh
exec arch -i386 /usr/bin/python2.6 \${1+"\$@"}
EOF

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

cmake -D CMAKE_INSTALL_PREFIX=~/Applications \
-D CMAKE_BUILD_TYPE=MINSIZEREL -D ENABLE_TESTS=FALSE \
-D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_PYSPATIALITE=FALSE \
-D SPATIALINDEX_LIBRARY=/usr/local/lib/libspatialindex.dylib \
-D SPATIALINDEX_INCLUDE_DIR=/usr/local/include/spatialindex \
-D QWT_LIBRARY=/usr/local/qwt-5.2.2/lib/libqwt.dylib \
-D QWT_INCLUDE_DIR=/usr/local/qwt-5.2.2/include \
-D BISON_EXECUTABLE=/usr/local/bin/bison \
-D CMAKE_OSX_ARCHITECTURES=i386 -D PYTHON_EXECUTABLE=/usr/local/bin/python32 \
..
</PRE></div>

<P>
<U>Mapserver note:</U> The QGIS Mapserver feature requires fastcgi support.  This is included in
Leopard and Snow Leopard, but was dropped at Lion.  To build the Mapserver
component on Leopard and Snow, add the following line before the last line in
the above configuration:
</P>

<div class="code"><PRE>
-D WITH_MAPSERVER=TRUE \
</PRE></div>

<P>
On Lion you are on your own to figure out how to install libfcgi and add fcgi
support to the system Apache.  Not recommended for the average user.
</P>
<P>
<U>Globe plugin note:</U> If you want the Globe plugin (and you compiled and installed OSG/osgEarth),
add the following lines before the last line in the above configuration:
</P>

<div class="code"><PRE>
-D WITH_GLOBE=true \
-D OSGEARTH_INCLUDE_DIR="/Library/Application Support/OpenSceneGraph/Headers" \
-D OSG_PLUGINS_PATH="/Library/Application Support/OpenSceneGraph/PlugIns" \
</PRE></div>

<P>
<U>Bundling note:</U> Older Qt versions may have problems with some Qt plugins and
QGIS.  The way to handle this is to bundle Qt inside the QGIS application.  The
default is to bundle Qt (and osg/osgEarth, if configured).
</P>
<P>
Even better for distribution purposes, to also bundle any extra non-framework,
non-standard, libs (ie postgres' libpq) set the bundle value to 2:
</P>

<div class="code"><PRE>
-D QGIS_MACAPP_BUNDLE=2 \
</PRE></div>

<A NAME="toc25"></A>
<H2>5.8. Building</H2>

<P>
Now we can start the build process (remember the parallel compilation note at
the beginning, this is a good place to use it, if you can):
</P>

<div class="code"><PRE>
make -j [#cpus]
</PRE></div>

<P>
If all built without errors you can then install it:
</P>

<div class="code"><PRE>
make install
</PRE></div>

<P>
or, for an /Applications build:
</P>

<div class="code"><PRE>
sudo make install
</PRE></div>

<A NAME="toc26"></A>
<H2>5.9. Post-Install</H2>

<P>
A couple things to take care of.
</P>
<P>
<B>gpsbabel</B>
</P>
<P>
For QGIS to <I>easily</I> find gpsbabel, you need to copy the gpsbabel executable
to the QGIS application.  Assuming you installed QGIS in your home folder:
</P>

<div class="code"><PRE>
cp -fp /Applications/GPSBabelFE.app/Contents/MacOS/gpsbabel ~/QGIS.app/Contents/MacOS/bin/
</PRE></div>

<P>
If you installed in /Applications, adjust the path accordingly and prefix the
whole command with 'sudo '.
</P>
<P>
<B>QGIS Mapserver</B>
</P>
<P>
See the QGIS Mapserver wiki page at:
</P>
<P>
<A HREF="http://hub.qgis.org/projects/quantum-gis/wiki/QGIS_Server_Tutorial">http://hub.qgis.org/projects/quantum-gis/wiki/QGIS_Server_Tutorial</A>
</P>
<P>
for instructions on setting up Apache fastcgi and testing Mapserver, including
installing the mod-fastcgi that is missing on Lion.
</P>

<A NAME="toc27"></A>
<H1>6. Setting up the WCS test server on GNU/Linux</H1>

<P>
<B>Requires:</B> Ubuntu / Debian derived distro
</P>
<P>
These notes are for Ubuntu - other versions and Debian derived distros may
require slight variations in package names.
</P>

<A NAME="toc28"></A>
<H2>6.1. Preparation</H2>

<P>
Note the git repo below will change to the default QGIS repo once this work
is integrated into master.
</P>
<P>
  git remote add blazek git://github.com/blazek/Quantum-GIS.git
  git fetch blazek
  git branch --track wcs2 blazek/wcs2
  git checkout wcs2
  cd /var/www/
  sudo mkdir wcs
  sudo chown timlinux wcs
  cd wcs/
  mkdir cgi-bin
  cd cgi-bin/
</P>

<A NAME="toc29"></A>
<H2>6.2. Setup mapserver</H2>

<P>
<CODE>`sudo apt-get install cgi-mapserver`</CODE>
</P>
<P>
Set the contents of cgi-bin/wcstest-1.9.0 to:
</P>

<div class="code"><PRE>
  #! /bin/sh
  MS_MAPFILE=/var/www/wcs/testdata/qgis-1.9.0/raster/wcs.map
  export MS_MAPFILE
  /usr/lib/cgi-bin/mapserv
</PRE></div>

<P>
Then do:
</P>

<div class="code"><PRE>
  chmod +x cgi-bin/wcstest-1.9.0
  mkdir -p /var/www/wcs/testdata/qgis-1.9.0/raster/
  cd /var/www/wcs/testdata/qgis-1.9.0/raster/
  cp -r /home/timlinux/Quantum-GIS/tests/testdata/raster/* .
</PRE></div>

<P>
Edit wcs.map and set the shapepath to this:
</P>

<div class="code"><PRE>
  SHAPEPATH "/var/www/wcs/testdata/qgis-1.9.0/raster"
</PRE></div>

<P>
Then create /var/www/wcs/7-wcs.qgis.org.conf setting the contents to this:
</P>

<div class="code"><PRE>
  &lt;VirtualHost *:80&gt;
  ServerName wcs.qgis.org
  ServerAdmin tim@linfiniti.com

  LogLevel warn
  LogFormat "%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{forensic-id}n\"" combined
  CustomLog /var/log/apache2/wcs_qgis.org/access.log combined
  ErrorLog /var/log/apache2/wcs_qgis.org/error.log

  DocumentRoot /var/www/wcs/html

  ScriptAlias /cgi-bin/ /var/www/wcs/cgi-bin/
  &lt;Directory "/var/www/wcs/cgi-bin"&gt;
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
  &lt;/Directory&gt;

  RewriteEngine on
  RewriteRule /1.9.0/wcs /cgi-bin/wcstest-1.9.0 [PT]

  &lt;/VirtualHost&gt;
</PRE></div>

<A NAME="toc30"></A>
<H2>6.3. Create a home page</H2>

<div class="code"><PRE>
  mkdir html
  vim html/index.html
</PRE></div>

<P>
Set the contents to:
</P>

<div class="code"><PRE>
  This is the test platform for QGIS' wcs client. You can use these services
  from QGIS directly (to try out WCS for example) by pointing your QGIS to:
  http://wcs.qgis.org/1.9.0/wcs
</PRE></div>

<A NAME="toc31"></A>
<H2>6.4. Now deploy it</H2>

<div class="code"><PRE>
  sudo mkdir /var/log/apache2/wcs_qgis.org
  sudo chown www-data /var/log/apache2/wcs_qgis.org
  cd /etc/apache2/sites-available/
  sudo ln -s /var/www/wcs/7-wcs.qgis.org.conf .
  cd /var/www/wcs/
  sudo a2ensite 7-wcs.qgis.org.conf
  sudo /etc/init.d/apache2 reload
</PRE></div>

<A NAME="toc32"></A>
<H2>6.5. Debugging</H2>

<div class="code"><PRE>
  sudo tail -f /var/log/apache2/wcs_qgis.org/error.log
</PRE></div>

<A NAME="toc33"></A>
<H1>7. Setting up a Jenkins Build Server</H1>

<P>
<B>Assumption:</B> You know how to make a working build environment and want to
deploy it under Jenkins for continuous integration testing now.
</P>
<P>
These notes are terse, I will expand on them later as the need arises. The 
procedure is:
</P>

<UL>
<LI>Install Jenkins and get it configured according to your own preferences
<LI>Make sure you have the git, github, junit etc plugins installed. A complete
  list of the plugins I have installed follows (note that you almost certainly
  don't need evey plugin listed here):
 <UL>
 <LI>External Monitor Job Type Plugin
 <LI>LDAP Plugin
 <LI>pam-auth
 <LI>javadoc
 <LI>ant
 <LI>Jenkins Subversion Plug-in
 <LI>Git Plugin
 <LI>Maven 2 Project Plugin
 <LI>Jenkins SLOCCount Plug-in
 <LI>Jenkins Sounds plugin
 <LI>Jenkins Translation Assistance plugin
 <LI>ruby-runtime
 <LI>Jenkins CVS Plug-in
 <LI>Coverage/Complexity Scatter Plot PlugIn
 <LI>Status Monitor Plugin
 <LI>Git Parameter Plug-In
 <LI>github-api
 <LI>GitHub plugin
 <LI>Jenkins Violations plugin
 <LI>git-notes Plugin
 <LI>Twitter plugin
 <LI>Jenkins Cobertura Plugin
 <LI>Jenkins Gravatar plugin
 <LI>Jenkins SSH Slaves plugin
 </UL>
<LI>Create a Job called 'QGIS'
<LI>Use the following options for your job:
 <UL>
 <LI>Job Name: QGIS
 <LI>Job Type: Build a free-style software project
 <LI>Tick enable project based security (you need to elsewhere configure your
   Jenkins security to per project settings)
 <LI>Allow Anonymous user Read and Discover access
 <LI>Set the github project to <A HREF="https://github.com/qgis/Quantum-GIS/">https://github.com/qgis/Quantum-GIS/</A>
 <LI>Set source code management to Git
 <LI>Set repository url to git://github.com/qgis/Quantum-GIS.git
 <LI>In advanced repository url settings set refspec to : 
 <P></P>

<div class="code"><PRE>
+refs/heads/master:refs/remotes/origin/master
</PRE></div>

 <P></P>
 <LI>Set branch to build to master
 <LI>Repository Browser: Auto
 <LI>Build triggers: set to Poll SCM and set schedule to <CODE>* * * * *</CODE> (polls every minute)
 <LI>Build - Execute shell and set shell script to:
 <P></P>

<div class="code"><PRE>
  cd build
  cmake ..
  xvfb-run --auto-servernum --server-num=1 \
           --server-args="-screen 0 1024x768x24" \
           make Experimental || true
  if [ -f Testing/TAG ] ; then
     xsltproc ../tests/ctest2junix.xsl \
       Testing/`head -n 1 &lt; Testing/TAG`/Test.xml &gt; \
       CTestResults.xml
  fi
</PRE></div>

 <P></P>
 <LI>Add Junit post build action and set 'Publish Junit test result report' to:
   <CODE>build/CTestResults.xml</CODE>
 <LI>Email notification: Send separate e-mails to individuals who broke the build
 <LI>Jenkins sounds - set up sounds for Failure, Success and Unstable.
 <LI>Save
 </UL>
<P></P>
Now open the Job dash board and push something to QGIS and wait a minute to
validate automated builds work.
<P></P>
<B>Note:</B> You will need to log in to the Jenkins user account and go to
/var/lib/jenkins/jobs/QGIS/workspace, then make a <CODE>build</CODE> directory and run
the initial cmake setup and then do test build. This process is the same as
described elsewhere in this doc.
<P></P>
I based some of the set up from this nice blog article here:
<P></P>
<A HREF="http://alexott.blogspot.com/2012/03/jenkins-cmakectest.html">http://alexott.blogspot.com/2012/03/jenkins-cmakectest.html</A>
</UL>

<A NAME="toc34"></A>
<H1>8. Debug output and running tests</H1>

<P>
If you are interested in seeing embedded debug output, change the following
CMake option:
</P>

<div class="code"><PRE>
-D CMAKE_BUILD_TYPE=DEBUG (or RELWITHDEBINFO)
</PRE></div>

<P>
This will flood your terminal or system log with lots of useful output from
QgsDebugMsg() calls in source code.
</P>
<P>
If you would like to run the test suite, you will need to do so from the build
directory, as it will not work with the installed/bundled app. First set the
CMake option to enable tests:
</P>

<div class="code"><PRE>
-D ENABLE_TESTS=TRUE
</PRE></div>

<P>
Then run all tests from build directory:
</P>

<div class="code"><PRE>
cd build
make test
</PRE></div>

<P>
To run all tests and report to <A HREF="http://dash.orfeo-toolbox.org/index.php?project=QGIS">http://dash.orfeo-toolbox.org/index.php?project=QGIS</A>
</P>

<div class="code"><PRE>
cd build
make Experimental
</PRE></div>

<P>
You can define the host name reported via 'make Experimental' by setting a CMake
option:
</P>

<div class="code"><PRE>
-D SITE="my.domain.org"
</PRE></div>

<P>
To run specific test(s) (see 'man ctest'):
</P>

<div class="code"><PRE>
cd build
# show listing of tests, without running them
ctest --show-only

# run specific C++ or Python test(s) matching a regular expression
ctest --verbose --tests-regex SomeTestName
</PRE></div>

<A NAME="toc35"></A>
<H1>9. Authors and Acknowledgments</H1>

<P>
The following people have contributed to this document:
</P>

<UL>
<LI>Windows MINGW Section
 <UL>
 <LI>Tim Sutton, Godofredo Contreras 2006
 <LI>CMake additions Magnus Homann 2007
 <LI>Python additions Martin Dobias 2007
 <LI>With thanks to Tisham Dhar for preparing the initial msys environment
 <P></P>
 </UL>
<LI>Windows MSVC Section (Detailed install)
 <UL>
 <LI>David Willis 2007
 <LI>MSVC install additions Tim Sutton 2007
 <LI>PostgreSQL, Qt compile, SIP, Python, AutoExp additions Juergen Fischer 2007
 <P></P>
 </UL>
<LI>Windows MSVC Section (Simplified install)
 <UL>
 <LI>Tim Sutton 2007
 <LI>Juergen Fischer 2007
 <LI>Florian Hillen 2010
 <P></P>
 </UL>
<LI>OSX Section
 <UL>
 <LI>Tim Sutton 2007
 <LI>With special thanks to Tom Elwertowski and William Kyngesburye
 <LI>Larry Shaffer 2012
 <P></P>
 </UL>
<LI>GNU/Linux Section
 <UL>
 <LI>Tim Sutton 2006
 <LI>Debian package section: Juergen Fischer 2008
 <P></P>
 </UL>
<LI>WCS Test Server Section
 <UL>
 <LI>Tim Sutton, Radim Blazek 2012
 <P></P>
 </UL>
<LI>Jenkins CI Configuration
 <UL>
 <LI>Tim Sutton 2012
 <P></P>
 </UL>
<LI>Latex Generator
 <UL>
 <LI>Tim Sutton 2011
 <P></P>
 </UL>
<LI>Debug Output/Tests Section
 <UL>
 <LI>Larry Shaffer 2012, by way of 'Test Friday' Tim Sutton
 </UL>
</UL>

</DIV>
<!-- html code generated by txt2tags 2.6 (http://txt2tags.org) -->
<!-- cmdline: txt2tags -o/build/buildd/qgis-2.0.1/obj-i686-linux-gnu/doc/INSTALL.html -t html /build/buildd/qgis-2.0.1/doc/INSTALL.t2t -->
</BODY></HTML>