Gary Sherman - Tim Sutton
The latest version of this document can always be found at http://qgis.org/docs/install.html.
QGIS can be installed with three levels of support for data stores:
Basic support uses the GDAL/OGR libraries and supports many raster and vector formats. For more information on the available formats, see http://www.remotesensing.org:16080/gdal/formats_list.html and http://www.remotesensing.org:16080/gdal/ogr/ogr_formats.html.
PostgreSQL/PostGIS support allows you to store spatial data in a PostgreSQL database. GRASS support provides access to GRASS mapsets.
Note: - If you plan to build QGIS with GRASS support, version 1.2.3 or higher of GDAL must be used.
Each of the requirements are discussed below. Note that the information given below is abstracted from the installation documentation for each of the libraries. See the install information for each library to get detailed instructions. In the documentation below, the file names and versions used are examples.
If you are building QGIS without PostgreSQL or GRASS support, skip to the section on Installing GDAL/OGR.
In addition, packages for many Linux distributions are independently maintained in various locations. See the Download section on http://qgis.org for the latest information on package locations.
Packages for most of the software/libraries discussed below can be found for almost all Linux distributions. While it is possible to mix compiling from source and installing packages to meet the requirements for QGIS, sometimes this becomes tricky. Following the steps below will generally ensure a successful installation. If you are using SuSE 9.1, the LinGIS distribution ftp://ftp.lingis.org is a good choice for installing QGIS and its dependencies.
tar -xzf postgresql-7.4.1.tar.gz
cd postgresql-7.4.1
./configure --prefix=/usr/local/pgsql
make
make install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
cd /usr/local/pgsql
./bin/initdb -D /usr/local/pgsql/data
./bin/pg_ctl start -o "-i" -D /usr/local/pgsql/data -l /home/postgres/serverlog
./bin/createdb test
psql test select version(); version ------------------------------------------------------------------------------------- PostgreSQL 7.4.1 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.1 (SuSE Linux) (1 row) \q
Note: As of version 0.6, GEOS is a requirement in order to build QGIS.
QGIS uses GEOS to properly fetch features from the the underlying datastore when doing an identify or select operation.
To install GEOS:
tar -xzf geos-2.0.0.tar.gz
cd geos-2.0-.0
./configure make make install
NOTE - You must edit the PostGIS Makefile and make sure that USE_GEOS=1 is set. Also adjust GEOS_DIR to point to your GEOS installation directory.
cd contrib gunzip postgis-0.8.0.tar.gz tar xvf postgis-0.8.0.tar cd postgis-0.8.0 make make install createlang plpgsql yourtestdatabase psql -d yourtestdatabase -f postgis.sql psql -d yourtestdatabase -f spatial_ref_sys.sql
The GRASS software is available for download at http://grass.itc.it/download.html.
Note: A Linux binary of GDAL is available at http://www.remotesensing.org/gdal. If you choose to install the binary you will also need to download and unpack the source tree since QGIS needs the header files in order to compile.
To install GDAL/OGR from source:
tar xfvz /../path/../gdal-x.x.x.tar.gz
cd gdal-x.x.x
./configureor if you want GRASS support
./configure --with-grass=<full path to grass install>Depending on the GDAL version you are building, it may be necessary to specify -without-ogdi when running configure if you don't have the OGDI libary avaiable on your system.
make su make install
export PATH=/../path/../gdal-config:$PATH
gdal-config --prefix
If you've had problems during the installation, refer to this manual, where the whole process is described with some more detail: http://www.remotesensing.org/gdal/gdal_building.html
find ./ -name qglobal.h 2>/dev/null | xargs grep QT_VERSION_STRIf you have the locate utility installed you can do the same more quickly using:
locate qglobal.h | xargs grep QT_VERSION_STRIn either case the result should look something like this:
#define QT_VERSION_STR "3.3.1"In the example above, Qt 3.3.1 is installed.
If Qt is not installed, you will have to install the Qt development package for your distribution. If you are not able to install the required Qt packages, you will have to build from source.
To install Qt from source:
./configure -thread
After you have installed the required libraries, you are ready to build QGIS. Download and untar the QGIS distribution and change to the QGIS source directory. You have two options for building and installing QGIS: Quick and Dirty and the right way.
./configure make make installThe above assumes that the gdal-config program is in your PATH See the next section for the full configuration instructions.
./configure --helpAmong other options, there are three that are important to the success of the build:
--with-qtdir=DIR Qt installation directory default=$QTDIR --with-gdal=path/gdal-config Full path to 'gdal-config' script, e.g. '--with-gdal=/usr/local/bin/gdal-config' --with-pg=path/pg_config PostgreSQL (PostGIS) Support (full path to pg_config) --with-grass=DIR GRASS Support (full path to GRASS binary package)
/configure --with-gdal=/usr/mystuff/bin/gdal-config
./configure --with-pg=/usr/local/psql/bin/pg_config
./configure --with-grass=/usr/local/grass-5.7.0This assumes that GRASS is installed in the default location. Change the path to match the location of your GRASS installation.
./configure --prefix=/usr/local/qgis \ --with-gdal=/usr/local/gdal/bin/gdal-config \ --with-pg=/usr/local/psql/bin/pg_config \ --with-grass=/usr/local/grass-5.7.0This will configure QGIS to use GDAL, GRASS, and PostgreSQL. QGIS will be installed in /usr/local/qgis.
If QTDIR is set and gdal-config and pg_config are both in the PATH, there is no need to use the -with-gdal and -with-pg options. The configure script will properly detect and configure GDAL and PostgreSQL. You must still use the -with-grass option if building with GRASS support.
make make installNOTE - As of version 0.1, you can no longer run QGIS from the src directory. You must do a make install and start QGIS from the installed location. In the case of the example above, the QGIS binary resides in the bin subdirectory of the directory specified with the prefix option (/usr/local/qgis/bin).
For information on using QGIS see the QGIS User Guide.
This document was generated using the LaTeX2HTML translator Version 2002-2-1 (1.70)
Copyright © 1993, 1994, 1995, 1996,
Nikos Drakos,
Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999,
Ross Moore,
Mathematics Department, Macquarie University, Sydney.
The command line arguments were:
latex2html -dir html -nonavigation -split 0 install.tex
The translation was initiated by Gary Sherman on 2004-12-19