Skip to content

Commit 3f6c7c1

Browse files
author
rblazek
committed
GDAL-GRASS driver no more necessary, new requirement: exceptions support for GRASS
git-svn-id: http://svn.osgeo.org/qgis/trunk@13060 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 172f28b commit 3f6c7c1

File tree

2 files changed

+26
-311
lines changed

2 files changed

+26
-311
lines changed

INSTALL

+20-169
Original file line numberDiff line numberDiff line change
@@ -63,23 +63,20 @@ Building QGIS from source - step by step
6363
5.12.3. Step 3: download the MrSID binaries
6464
5.12.4. Step 4: compile and install the gdal libraries
6565
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
6867
6. Creation of MSYS environment for compilation of Quantum GIS
6968
6.1. Initial setup
7069
6.1.1. MSYS
7170
6.1.2. MinGW
7271
6.1.3. Flex and Bison
7372
6.2. Installing dependencies
7473
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
8380
6.3. Cleanup
8481
7. Building with MS Visual Studio
8582
7.1. Setup Visual Studio
@@ -190,7 +187,7 @@ for the existence of cmake and provides some clues to build QGIS.
190187
* GDAL/OGR >= 1.4.x
191188

192189
'''Optional dependencies:'''
193-
* for GRASS plugin - GRASS >= 6.0.0
190+
* for GRASS plugin - GRASS >= 6.0.0 (libraries compiled with exceptions support)
194191
* for georeferencer - GSL >= 1.8
195192
* for postgis support and SPIT plugin - PostgreSQL >= 8.0.x
196193
* for gps plugin - expat >= 1.95
@@ -1185,11 +1182,9 @@ skip this section.
11851182
Now you can install grass from dapper:
11861183

11871184

1188-
sudo apt-get install grass libgrass-dev libgdal1-1.4.0-grass
1185+
sudo apt-get install grass libgrass-dev
11891186

11901187

1191-
/!\ You may need to explicitly state your grass version e.g. libgdal1-1.3.2-grass
1192-
11931188

11941189
5.6. Setup ccache (Optional)
11951190
============================
@@ -1524,10 +1519,12 @@ For example the GRASS 6.4rc4 is available at http://grass.itc.it/grass64/source/
15241519
Uncompress the arquive, enter the newly created folder and run configure with a few specific parameters
15251520

15261521

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
15281523

15291524

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)
15311528

15321529

15331530
make
@@ -1553,64 +1550,7 @@ may want to give it a try
15531550

15541551

15551552

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
16141554
========================================
16151555

16161556
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):
17471687
Unpack the whole package to c:\msys\local
17481688

17491689

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
18161691
============
18171692

18181693
Grab sources from CVS or use a weekly snapshot, see:
@@ -1839,31 +1714,7 @@ By the way, these pages might be useful:
18391714
- http://geni.ath.cx/grass.html
18401715

18411716

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
18671718
===========
18681719

18691720
Download the sources:
@@ -1893,7 +1744,7 @@ Now, in MSYS console, go to the source directory and run:
18931744

18941745

18951746

1896-
6.2.6. SQLITE
1747+
6.2.4. SQLITE
18971748
=============
18981749

18991750
You can use precompiled DLL, no need to compile from source:
@@ -1911,7 +1762,7 @@ Then download this archive:
19111762
and copy sqlite3.h to c:\msys\local\include
19121763

19131764

1914-
6.2.7. GSL
1765+
6.2.5. GSL
19151766
==========
19161767

19171768
Download sources:
@@ -1929,7 +1780,7 @@ Run from MSYS console in the source directory:
19291780

19301781

19311782

1932-
6.2.8. EXPAT
1783+
6.2.6. EXPAT
19331784
============
19341785

19351786
Download sources:
@@ -1947,7 +1798,7 @@ Run from MSYS console in the source directory:
19471798

19481799

19491800

1950-
6.2.9. POSTGRES
1801+
6.2.7. POSTGRES
19511802
===============
19521803

19531804
We're going to use precompiled binaries. Use the link below for download:

0 commit comments

Comments
 (0)