@@ -1009,6 +1009,304 @@ $HOME/apps/bin/qgis
1009
1009
If all has worked properly the QGIS application should start up and appear
1010
1010
on your screen.
1011
1011
1012
+
1013
+ == A practical case: Building QGIS and GRASS from source on Ubuntu with ECW and MrSID formats support ==
1014
+
1015
+ The following procedure has been tested on Ubuntu 8.04, 8.10 and 9.04 32bit. If you want
1016
+ to use different versions of the software (gdal, grass, qgis), just make the
1017
+ necessary adjustments to the following code. This guide assumes that you don't have
1018
+ installed any previous version of gdal, grass and qgis.
1019
+
1020
+ === Step 1: install base packages ===
1021
+
1022
+ First you need to install the necessary packages required to download the source
1023
+ code and compile it. Open the terminal and issue the following command:
1024
+
1025
+ ```
1026
+ sudo apt-get install build-essential g++ subversion
1027
+ ```
1028
+
1029
+ === Step 2: compile and install the ecw libraries ===
1030
+
1031
+ Go to the ERDAS web site http://www.erdas.com/ and follow the links
1032
+ "'''products --> ECW JPEG2000 Codec SDK --> downloads'''"
1033
+ then download the "'''Image Compression SDK Source Code 3.3'''" (you'll need to make a registration
1034
+ and accept a license).
1035
+
1036
+ Uncompress the arquive in a proper location (this guide assumes
1037
+ that all the downloaded source code will be placed in the user home)
1038
+ and the enter the newly created folder
1039
+
1040
+ ```
1041
+ cd /libecwj2-3.3
1042
+ ```
1043
+
1044
+ Compile the code with the standard commands
1045
+
1046
+ ```
1047
+ ./configure
1048
+ ```
1049
+
1050
+ then
1051
+
1052
+ ```
1053
+ make
1054
+ ```
1055
+
1056
+ then
1057
+
1058
+ ```
1059
+ sudo make install
1060
+ ```
1061
+
1062
+ leave the folder
1063
+
1064
+ ```
1065
+ cd ..
1066
+ ```
1067
+
1068
+ === Step 3: download the MrSID binaries ===
1069
+
1070
+ Go to the LIZARDTECH web site http://www.lizardtech.com/ and follow the links
1071
+ "'''download --> Developer SDKs'''",
1072
+ then download the "'''GeoExpress SDK for Linux (x86) - gcc 4.1 32-bit'''"
1073
+ (you'll need to make a registration and accept a license).
1074
+
1075
+ Uncompress the downloaded file. The resulting directory name should be similar to "Geo_DSDK-7.0.0.2167"
1076
+
1077
+ === Step 4: compile and install the gdal libraries ===
1078
+
1079
+ Download the latest gdal source code
1080
+
1081
+ ```
1082
+ svn checkout https://svn.osgeo.org/gdal/trunk/gdal gdal
1083
+ ```
1084
+
1085
+ then copy a few files from the MrSID binaries folder to the folder with the gdal source code
1086
+ ('''replace "USERNAME" with your actual account username''')
1087
+
1088
+ ```
1089
+ cp /home/USERNAME/Geo_DSDK-7.0.0.2167/include/*.* /home/USERNAME/gdal/frmts/mrsid/
1090
+ ```
1091
+
1092
+ enter the gdal source code folder
1093
+
1094
+ ```
1095
+ cd /gdal
1096
+ ```
1097
+
1098
+ and run configure with a few specific parameters
1099
+
1100
+ ```
1101
+ ./configure --without-grass --with-mrsid=../Geo_DSDK-7.0.0.2167 --without-jp2mrsid
1102
+ ```
1103
+
1104
+ at the end of the configuration process you should read something like
1105
+
1106
+ ```
1107
+ ...
1108
+ GRASS support: no
1109
+ ...
1110
+ ...
1111
+ ...
1112
+ ECW support: yes
1113
+ MrSID support yes
1114
+ ...
1115
+ ```
1116
+
1117
+ then compile normally
1118
+
1119
+ ```
1120
+ make
1121
+ ```
1122
+
1123
+ and
1124
+
1125
+ ```
1126
+ sudo make install
1127
+ ```
1128
+
1129
+ finish the process by creating the necessary links to the most recent shared libraries
1130
+
1131
+ ```
1132
+ sudo ldconfig
1133
+ ```
1134
+
1135
+ at this point you may want to check if gdal was compiled correctly with MrSID and ECW
1136
+ support by issuing one (or both) of the following commands
1137
+
1138
+ ```
1139
+ gdalinfo --formats | grep 'ECW'
1140
+ ```
1141
+
1142
+ ```
1143
+ gdalinfo --formats | grep 'SID'
1144
+ ```
1145
+
1146
+ leave the folder
1147
+
1148
+ ```
1149
+ cd ..
1150
+ ```
1151
+
1152
+ === Step 5: compile and install GRASS ===
1153
+
1154
+ Before downloading and compile GRASS source code you need to install a few
1155
+ other libraries and programs. We can do this trough apt
1156
+
1157
+ ```
1158
+ sudo apt-get install flex bison libreadline5-dev libncurses5-dev lesstif2-dev debhelper dpatch libtiff4-dev \
1159
+ tcl8.4-dev tk8.4-dev fftw-dev xlibmesa-gl-dev libfreetype6-dev autoconf2.13 autotools-dev \
1160
+ libgdal1-dev proj libjpeg62-dev libpng12-dev libpq-dev unixodbc-dev doxygen fakeroot cmake \
1161
+ python-dev python-qt4-common python-qt4-dev python-sip4 python2.5-dev sip4 libglew1.5-dev libxmu6 \
1162
+ libqt4-dev libgsl0-dev python-qt4 swig python-wxversion python-wxgtk2.8 libwxgtk2.8-0 libwxbase2.8-0 tcl8.4-dev \
1163
+ tk8.4-dev tk8.4 libfftw3-dev libfftw3-3
1164
+ ```
1165
+
1166
+ At this point we can get the GRASS source code: you may want to download it
1167
+ trough svn or maybe you want just to download the latest available source code arquive.
1168
+ For example the GRASS 6.4rc4 is available at http://grass.itc.it/grass64/source/grass-6.4.0RC4.tar.gz
1169
+
1170
+ Uncompress the arquive, enter the newly created folder and run configure with a few specific parameters
1171
+
1172
+ ```
1173
+ ./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
1174
+ ```
1175
+
1176
+ then as usual (it will take a while)
1177
+
1178
+ ```
1179
+ make
1180
+ ```
1181
+
1182
+ and
1183
+
1184
+ ```
1185
+ sudo make install
1186
+ ```
1187
+
1188
+ leave the folder
1189
+
1190
+ ```
1191
+ cd ..
1192
+ ```
1193
+
1194
+ you have now compiled and installed GRASS (also with the new wxpyhton interface) so you
1195
+ may want to give it a try
1196
+
1197
+ ```
1198
+ grass64 -wxpython
1199
+ ```
1200
+
1201
+ === Step 6: compile and install the GDAL-GRASS libraries ===
1202
+
1203
+ Create a plain text file named "grass.conf" inside the folder "/etc/ld.so.conf.d"
1204
+
1205
+ ```
1206
+ sudo gedit /etc/ld.so.conf.d/grass.conf
1207
+ ```
1208
+
1209
+ and add the following line
1210
+
1211
+ ```
1212
+ /usr/local/grass-6.4.0RC4/lib/
1213
+ ```
1214
+
1215
+ save and exit.
1216
+
1217
+ Download the latest version of the gdal-grass library (gdal-grass-1.4.3.tar.gz) from
1218
+ http://download.osgeo.org/gdal/
1219
+
1220
+ uncompress the arquive and enter the newly created folder
1221
+
1222
+ ```
1223
+ cd /gdal-grass-1.4.3
1224
+ ```
1225
+
1226
+ run configure
1227
+
1228
+ ```
1229
+ ./configure --with-grass=/usr/local/grass-6.4.0RC4
1230
+ ```
1231
+
1232
+ then as usual
1233
+
1234
+ ```
1235
+ make
1236
+ ```
1237
+
1238
+ and
1239
+
1240
+ ```
1241
+ sudo make install
1242
+ ```
1243
+
1244
+ and finish the process by creating the necessary links to the most recent shared libraries
1245
+
1246
+ ```
1247
+ sudo ldconfig
1248
+ ```
1249
+
1250
+ leave the folder
1251
+
1252
+ ```
1253
+ cd ..
1254
+ ```
1255
+
1256
+ === Step 6: compile and install QGIS ===
1257
+
1258
+ As for GRASS you can obtain the QGIS source code from different sources,
1259
+ for instance from svn or just by downloading one of the source code arquives available
1260
+ at http://www.qgis.org/download/sources.html
1261
+
1262
+ For example download the QGIS 1.1.0 source code here http://download.osgeo.org/qgis/src/qgis_1.1.0.tar.gz
1263
+
1264
+ uncompress the arquive and enter the newly created folder
1265
+
1266
+ ```
1267
+ cd /qgis_1.1.0
1268
+ ```
1269
+
1270
+ then run ccmake
1271
+
1272
+ ```
1273
+ ccmake .
1274
+ ```
1275
+
1276
+ press the "c" key, then when the option list will appear we need to manually
1277
+ configure the "GRASS_PREFIX" parameter. Scroll down until the "GRASS_PREFIX" will appear,
1278
+ press enter and manually set it to
1279
+
1280
+ ```
1281
+ /usr/local/grass-6.4.0RC4
1282
+ ```
1283
+
1284
+ then press enter again.
1285
+
1286
+ Press the "c" again and the option "Press [g] to generate and exit" will appear.
1287
+ Press the "g" key to generate and exit.
1288
+
1289
+ then as usual (it will take a while)
1290
+
1291
+ ```
1292
+ make
1293
+ ```
1294
+
1295
+ and
1296
+
1297
+ ```
1298
+ sudo make install
1299
+ ```
1300
+
1301
+ At the end of the process you should have QGIS and GRASS working with MrSID and ECW
1302
+ raster format support.
1303
+
1304
+ To run QGIS just use this command
1305
+
1306
+ ```
1307
+ qgis
1308
+ ```
1309
+
1012
1310
% -----------------------------------------------------------------------------
1013
1311
% ----Please leave this break marker here for clarity - it wont be rendered ---
1014
1312
% -----------------------------------------------------------------------------
0 commit comments