@@ -63,23 +63,20 @@ Building QGIS from source - step by step
63
63
5.12.3. Step 3: download the MrSID binaries
64
64
5.12.4. Step 4: compile and install the gdal libraries
65
65
5.12.5. Step 5: compile and install GRASS
66
- 5.12.6. Step 6: compile and install the GDAL-GRASS libraries
67
- 5.12.7. Step 6: compile and install QGIS
66
+ 5.12.6. Step 6: compile and install QGIS
68
67
6. Creation of MSYS environment for compilation of Quantum GIS
69
68
6.1. Initial setup
70
69
6.1.1. MSYS
71
70
6.1.2. MinGW
72
71
6.1.3. Flex and Bison
73
72
6.2. Installing dependencies
74
73
6.2.1. Getting ready
75
- 6.2.2. GDAL level one
76
- 6.2.3. GRASS
77
- 6.2.4. GDAL level two
78
- 6.2.5. GEOS
79
- 6.2.6. SQLITE
80
- 6.2.7. GSL
81
- 6.2.8. EXPAT
82
- 6.2.9. POSTGRES
74
+ 6.2.2. GRASS
75
+ 6.2.3. GEOS
76
+ 6.2.4. SQLITE
77
+ 6.2.5. GSL
78
+ 6.2.6. EXPAT
79
+ 6.2.7. POSTGRES
83
80
6.3. Cleanup
84
81
7. Building with MS Visual Studio
85
82
7.1. Setup Visual Studio
@@ -190,7 +187,7 @@ for the existence of cmake and provides some clues to build QGIS.
190
187
* GDAL/OGR >= 1.4.x
191
188
192
189
'''Optional dependencies:'''
193
- * for GRASS plugin - GRASS >= 6.0.0
190
+ * for GRASS plugin - GRASS >= 6.0.0 (libraries compiled with exceptions support)
194
191
* for georeferencer - GSL >= 1.8
195
192
* for postgis support and SPIT plugin - PostgreSQL >= 8.0.x
196
193
* for gps plugin - expat >= 1.95
@@ -1185,11 +1182,9 @@ skip this section.
1185
1182
Now you can install grass from dapper:
1186
1183
1187
1184
1188
- sudo apt-get install grass libgrass-dev libgdal1-1.4.0-grass
1185
+ sudo apt-get install grass libgrass-dev
1189
1186
1190
1187
1191
- /!\ You may need to explicitly state your grass version e.g. libgdal1-1.3.2-grass
1192
-
1193
1188
1194
1189
5.6. Setup ccache (Optional)
1195
1190
============================
@@ -1524,10 +1519,12 @@ For example the GRASS 6.4rc4 is available at http://grass.itc.it/grass64/source/
1524
1519
Uncompress the arquive, enter the newly created folder and run configure with a few specific parameters
1525
1520
1526
1521
1527
- ./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
1522
+ 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
1528
1523
1529
1524
1530
- then as usual (it will take a while)
1525
+ The additional gcc option -fexceptions is necessary to enable exceptions support in GRASS libraries. It is currently the only way to avoid QGIS crashes if a fatal error happens in GRASS library. See also http://trac.osgeo.org/grass/ticket/869
1526
+
1527
+ Then as usual (it will take a while)
1531
1528
1532
1529
1533
1530
make
@@ -1553,64 +1550,7 @@ may want to give it a try
1553
1550
1554
1551
1555
1552
1556
- 5.12.6. Step 6: compile and install the GDAL-GRASS libraries
1557
- ============================================================
1558
-
1559
- Create a plain text file named "grass.conf" inside the folder "/etc/ld.so.conf.d"
1560
-
1561
-
1562
- sudo gedit /etc/ld.so.conf.d/grass.conf
1563
-
1564
-
1565
- and add the following line
1566
-
1567
-
1568
- /usr/local/grass-6.4.0RC4/lib/
1569
-
1570
-
1571
- save and exit.
1572
-
1573
- Download the latest version of the gdal-grass library (gdal-grass-1.4.3.tar.gz) from
1574
- http://download.osgeo.org/gdal/
1575
-
1576
- uncompress the arquive and enter the newly created folder
1577
-
1578
-
1579
- cd /gdal-grass-1.4.3
1580
-
1581
-
1582
- run configure
1583
-
1584
-
1585
- ./configure --with-grass=/usr/local/grass-6.4.0RC4
1586
-
1587
-
1588
- then as usual
1589
-
1590
-
1591
- make
1592
-
1593
-
1594
- and
1595
-
1596
-
1597
- sudo make install
1598
-
1599
-
1600
- and finish the process by creating the necessary links to the most recent shared libraries
1601
-
1602
-
1603
- sudo ldconfig
1604
-
1605
-
1606
- leave the folder
1607
-
1608
-
1609
- cd ..
1610
-
1611
-
1612
-
1613
- 5.12.7. Step 6: compile and install QGIS
1553
+ 5.12.6. Step 6: compile and install QGIS
1614
1554
========================================
1615
1555
1616
1556
As for GRASS you can obtain the QGIS source code from different sources,
@@ -1747,72 +1687,7 @@ Moreover he also left the notes how to compile it (for those interested):
1747
1687
Unpack the whole package to c:\msys\local
1748
1688
1749
1689
1750
- 6.2.2. GDAL level one
1751
- =====================
1752
-
1753
- Since Quantum GIS needs GDAL with GRASS support, we need to compile GDAL
1754
- from source - Paul Kelly's package doesn't include GRASS support in GDAL.
1755
- The idea is following:
1756
-
1757
- 1. compile GDAL without GRASS
1758
- 2. compile GRASS
1759
- 3. compile GDAL with GRASS
1760
-
1761
- So, start with downloading GDAL sources:
1762
-
1763
- http://download.osgeo.org/gdal/gdal141.zip
1764
-
1765
- Unpack it to some directory, preferably c:\msys\local\src.
1766
-
1767
- Start MSYS console, go to gdal-1.4.1 directory and run the commands below.
1768
- You can put them all to a script, e.g. build-gdal.sh and run them at once.
1769
- The recipe is taken from Paul Kelly's instructions - basically they
1770
- just make sure that the library will be created as DLL and the utility
1771
- programs will be dynamically linked to it...
1772
-
1773
-
1774
- CFLAGS="-O2 -s" CXXFLAGS="-O2 -s" LDFLAGS=-s ./configure --without-libtool --prefix=/usr/local --enable-shared --disable-static --with-libz=/usr/local --with-png=/usr/local
1775
- make
1776
- make install
1777
- rm /usr/local/lib/libgdal.a
1778
- g++ -s -shared -o ./libgdal.dll -L/usr/local/lib -lz -lpng ./frmts/o/*.o ./gcore/*.o ./port/*.o ./alg/*.o ./ogr/ogrsf_frmts/o/*.o ./ogr/ogrgeometryfactory.o ./ogr/ogrpoint.o ./ogr/ogrcurve.o ./ogr/ogrlinestring.o ./ogr/ogrlinearring.o ./ogr/ogrpolygon.o ./ogr/ogrutils.o ./ogr/ogrgeometry.o ./ogr/ogrgeometrycollection.o ./ogr/ogrmultipolygon.o ./ogr/ogrsurface.o ./ogr/ogrmultipoint.o ./ogr/ogrmultilinestring.o ./ogr/ogr_api.o ./ogr/ogrfeature.o ./ogr/ogrfeaturedefn.o ./ogr/ogrfeaturequery.o ./ogr/ogrfeaturestyle.o ./ogr/ogrfielddefn.o ./ogr/ogrspatialreference.o ./ogr/ogr_srsnode.o ./ogr/ogr_srs_proj4.o ./ogr/ogr_fromepsg.o ./ogr/ogrct.o ./ogr/ogr_opt.o ./ogr/ogr_srs_esri.o ./ogr/ogr_srs_pci.o ./ogr/ogr_srs_usgs.o ./ogr/ogr_srs_dict.o ./ogr/ogr_srs_panorama.o ./ogr/swq.o ./ogr/ogr_srs_validate.o ./ogr/ogr_srs_xml.o ./ogr/ograssemblepolygon.o ./ogr/ogr2gmlgeometry.o ./ogr/gml2ogrgeometry.o
1779
- install libgdal.dll /usr/local/lib
1780
- cd ogr
1781
- g++ -s ogrinfo.o -o ogrinfo.exe -L/usr/local/lib -lpng -lz -lgdal
1782
- g++ -s ogr2ogr.o -o ogr2ogr.exe -lgdal -L/usr/local/lib -lpng -lz -lgdal
1783
- g++ -s ogrtindex.o -o ogrtindex.exe -lgdal -L/usr/local/lib -lpng -lz -lgdal
1784
- install ogrinfo.exe ogr2ogr.exe ogrtindex.exe /usr/local/bin
1785
- cd ../apps
1786
- g++ -s gdalinfo.o -o gdalinfo.exe -L/usr/local/lib -lpng -lz -lgdal
1787
- g++ -s gdal_translate.o -o gdal_translate.exe -L/usr/local/lib -lpng -lz -lgdal
1788
- g++ -s gdaladdo.o -o gdaladdo.exe -L/usr/local/lib -lpng -lz -lgdal
1789
- g++ -s gdalwarp.o -o gdalwarp.exe -L/usr/local/lib -lpng -lz -lgdal
1790
- g++ -s gdal_contour.o -o gdal_contour.exe -L/usr/local/lib -lpng -lz -lgdal
1791
- g++ -s gdaltindex.o -o gdaltindex.exe -L/usr/local/lib -lpng -lz -lgdal
1792
- g++ -s gdal_rasterize.o -o gdal_rasterize.exe -L/usr/local/lib -lpng -lz -lgdal
1793
- install gdalinfo.exe gdal_translate.exe gdaladdo.exe gdalwarp.exe gdal_contour.exe gdaltindex.exe gdal_rasterize.exe /usr/local/bin
1794
-
1795
-
1796
-
1797
- Finally, manually edit gdal-config in c:\msys\local\bin to replace the static library reference with -lgdal:
1798
-
1799
-
1800
- CONFIG_LIBS="-L/usr/local/lib -lpng -lz -lgdal"
1801
-
1802
- GDAL build procedure can be greatly simplified to use libtool with a libtool line patch:
1803
- configure gdal as below:
1804
- ./configure --with-ngpython --with-xerces=/local/ --with-jasper=/local/ --with-grass=/local/grass-6.3.cvs/ --with-pg=/local/pgsql/bin/pg_config.exe
1805
-
1806
- Then fix libtool with:
1807
- mv libtool libtool.orig
1808
- cat libtool.orig | sed 's/max_cmd_len=8192/max_cmd_len=32768/g' > libtool
1809
-
1810
- Libtool on windows assumes a line length limit of 8192 for some reason and tries to page the linking and fails miserably. This is a work around.
1811
-
1812
- Make and make install should be hassle free after this.
1813
-
1814
-
1815
- 6.2.3. GRASS
1690
+ 6.2.2. GRASS
1816
1691
============
1817
1692
1818
1693
Grab sources from CVS or use a weekly snapshot, see:
@@ -1839,31 +1714,7 @@ By the way, these pages might be useful:
1839
1714
- http://geni.ath.cx/grass.html
1840
1715
1841
1716
1842
- 6.2.4. GDAL level two
1843
- =====================
1844
-
1845
- At this stage, we'll use GDAL sources we've used before, only the compilation will be a bit different.
1846
-
1847
- But first in order to be able to compile GDAL sources with current GRASS CVS, you need to patch them, here's what you need to change:
1848
-
1849
- http://trac.osgeo.org/gdal/attachment/ticket/1587/plugin_patch_grass63.diff
1850
- (you can patch it by hand or use patch.exe in c:\msys\bin)
1851
-
1852
- Now in MSYS console go to the GDAL sources directory and run the same commands as in level one, only with these differences:
1853
-
1854
- 1. when running ./configure add this argument: --with-grass=/usr/local/grass-6.3.cvs
1855
- 2. when calling g++ on line 5 (which creates libgdal.dll), add these arguments: -L/usr/local/grass-6.3.cvs/lib -lgrass_vect -lgrass_dig2 -lgrass_dgl -lgrass_rtree -lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase -lgrass_I -lgrass_gproj -lgrass_vask -lgrass_gmath -lgrass_gis -lgrass_datetime
1856
-
1857
- Then again, edit gdal-config and change line with CONFIG_LIBS
1858
-
1859
-
1860
- CONFIG_LIBS="-L/usr/local/lib -lpng -L/usr/local/grass-6.3.cvs/lib -lgrass_vect -lgrass_dig2 -lgrass_dgl -lgrass_rtree -lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase -lgrass_I -lgrass_gproj -lgrass_vask -lgrass_gmath -lgrass_gis -lgrass_datetime -lz -L/usr/local/lib -lgdal"
1861
-
1862
-
1863
- Now, GDAL should be able to work also with GRASS raster layers.
1864
-
1865
-
1866
- 6.2.5. GEOS
1717
+ 6.2.3. GEOS
1867
1718
===========
1868
1719
1869
1720
Download the sources:
@@ -1893,7 +1744,7 @@ Now, in MSYS console, go to the source directory and run:
1893
1744
1894
1745
1895
1746
1896
- 6.2.6 . SQLITE
1747
+ 6.2.4 . SQLITE
1897
1748
=============
1898
1749
1899
1750
You can use precompiled DLL, no need to compile from source:
@@ -1911,7 +1762,7 @@ Then download this archive:
1911
1762
and copy sqlite3.h to c:\msys\local\include
1912
1763
1913
1764
1914
- 6.2.7 . GSL
1765
+ 6.2.5 . GSL
1915
1766
==========
1916
1767
1917
1768
Download sources:
@@ -1929,7 +1780,7 @@ Run from MSYS console in the source directory:
1929
1780
1930
1781
1931
1782
1932
- 6.2.8 . EXPAT
1783
+ 6.2.6 . EXPAT
1933
1784
============
1934
1785
1935
1786
Download sources:
@@ -1947,7 +1798,7 @@ Run from MSYS console in the source directory:
1947
1798
1948
1799
1949
1800
1950
- 6.2.9 . POSTGRES
1801
+ 6.2.7 . POSTGRES
1951
1802
===============
1952
1803
1953
1804
We're going to use precompiled binaries. Use the link below for download:
0 commit comments