1
- Compiling QGIS From Source
2
- Tim Sutton 2007
3
1
%!encoding: iso-8859-1
4
2
5
3
@@ -681,7 +679,7 @@ If all built without errors you can then install it:
681
679
5.1. Building QGIS with Qt4.x
682
680
=============================
683
681
684
- *Requires:* Ubuntu Edgy
682
+ *Requires:* Ubuntu Edgy / Debian derived distro
685
683
686
684
These notes are for if you want to build QGIS from source. One of the major
687
685
aims here is to show how this can be done using binary packages for *all*
@@ -718,7 +716,7 @@ Now update your local sources database:
718
716
================
719
717
720
718
721
- sudo apt-get install libqt4-core libqt4-debug libqt4-debug-dev \
719
+ sudo apt-get install libqt4-core libqt4-debug \
722
720
libqt4-dev libqt4-gui libqt4-qt3support libqt4-sql lsb-qt4 qt4-designer \
723
721
qt4-dev-tools qt4-doc qt4-qtconfig uim-qt gcc libapt-pkg-perl resolvconf
724
722
@@ -765,11 +763,13 @@ above commands to select the Qt4 version of the relevant applications.
765
763
766
764
767
765
sudo apt-get install gdal-bin libgdal1-dev libgeos-dev proj libtool \
768
- libgdal-doc libhdf4g-dev libhdf4g-run autoconf2.13 automake1.9 python-dev \
766
+ libgdal-doc libhdf4g-dev libhdf4g-run python-dev \
769
767
swig libgsl0-dev g++ libjasper-1.701-dev libtiff4-dev subversion gsl-bin \
770
- libsqlite3-dev sqlite3 ccache make libpq-dev flex bison firefox
768
+ libsqlite3-dev sqlite3 ccache make libpq-dev flex bison
771
769
772
770
771
+ /!\ Debian users should use libgdal-dev above rather
772
+
773
773
774
774
5.5. GRASS Specific Steps
775
775
=========================
@@ -783,6 +783,8 @@ Now you can install grass from dapper:
783
783
sudo apt-get install grass libgrass-dev libgdal1-grass
784
784
785
785
786
+ /!\ You may need to explicitly state your grass version e.g. libgdal1-1.3.2-grass
787
+
786
788
787
789
5.6. Setup ccache (Optional)
788
790
============================
@@ -862,23 +864,46 @@ development version. I suggest you do something similar:
862
864
mkdir -p ${HOME}/apps
863
865
864
866
865
- The script will carry on to build QGIS - it may take a little while to go
866
- and have a cup of your favourite beverage while you wait...
867
+ Now we create a build directory and run ccmake:
868
+
869
+
870
+ cd qgis
871
+ mkdir build
872
+ ccmake ..
873
+
874
+
875
+ When you run ccmake (note the .. is required!), a menu will appear where
876
+ you can configure various aspects of the build. If you do not have root
877
+ access or do not want to overwrite existing QGIS installs (by your
878
+ packagemanager for example), set the CMAKE_BUILD_PREFIX to somewhere you
879
+ have write access to (I usually use /home/timlinux/apps). Now press
880
+ 'c' to configure, 'e' to dismiss any error messages that may appear.
881
+ and 'g' to generate the make files. Note that sometimes 'c' needs to
882
+ be pressed several times before the 'g' option becomes available.
883
+ After the 'g' generation is complete, press 'q' to exit the ccmake
884
+ interactive dialog.
885
+
886
+ Now on with the build:
887
+
888
+
889
+ make
890
+ make install
891
+
892
+
893
+ It may take a little while to build depending on your platform.
867
894
868
895
869
896
5.10. Running QGIS
870
897
==================
871
898
872
- Once the compile is complete it should pop up a page in firefox with unit
873
- test results. At the time of writing the unit tests are just stubs - we
874
- still need to create the test implementations - so dont worry to much about
875
- their output at the moment.
876
-
877
899
Now you can try to run QGIS:
878
900
879
901
902
+ export LD_LIBRARY_PATH=/home/apps/lib
880
903
$HOME/apps/bin/qgis
881
904
905
+ /!\ Note the export LD_LIBRARY_PATH is only needed if you are installing
906
+ into a path not covered by your system's ld.so.conf.
882
907
883
908
If all has worked properly the QGIS application should start up and appear
884
909
on your screen.
@@ -1008,13 +1033,25 @@ programs will be dynamically linked to it...
1008
1033
g++ -s gdaltindex.o -o gdaltindex.exe -L/usr/local/lib -lpng -lz -lgdal
1009
1034
g++ -s gdal_rasterize.o -o gdal_rasterize.exe -L/usr/local/lib -lpng -lz -lgdal
1010
1035
install gdalinfo.exe gdal_translate.exe gdaladdo.exe gdalwarp.exe gdal_contour.exe gdaltindex.exe gdal_rasterize.exe /usr/local/bin
1036
+
1011
1037
1012
1038
1013
1039
Finally, manually edit gdal-config in c:\msys\local\bin to replace the static library reference with -lgdal:
1014
1040
1015
1041
1016
1042
CONFIG_LIBS="-L/usr/local/lib -lpng -lz -lgdal"
1017
1043
1044
+ GDAL build procedure can be greatly simplified to use libtool with a libtool line patch:
1045
+ configure gdal as below:
1046
+ ./configure --with-ngpython --with-xerces=/local/ --with-jasper=/local/ --with-grass=/local/grass-6.3.cvs/ --with-pg=/local/pgsql/bin/pg_config.exe
1047
+
1048
+ Then fix libtool with:
1049
+ mv libtool libtool.orig
1050
+ cat libtool.orig | sed 's/max_cmd_len=8192/max_cmd_len=32768/g' > libtool
1051
+
1052
+ 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.
1053
+
1054
+ Make and make install should be hassle free after this.
1018
1055
1019
1056
1020
1057
5.12.3. GRASS
0 commit comments