- Download PostgreSQL source from www.postgresql.org
- Extract the source
tar -xzf postgresql-7.4.1.tar.gz
- Change to the source directory
cd postgresql-7.4.1
- Configure PostgreSQL:
./configure --prefix=/usr/local/pgsql
- Build
make
- Install
make install
- As root, create the postgres user and setup the database (following taken from PostgreSQL INSTALL file with modification)
- Create the postgres user
adduser postgres
- Create the directory for the PostgreSQL database
mkdir /usr/local/pgsql/data
- Change ownership of the data directory to the postgres user
chown postgres /usr/local/pgsql/data
- su to the postgres user (or login as postgres)
su - postgres
- Change to the PostgreSQL install directory
cd /usr/local/pgsql
- Initialize the database
./bin/initdb -D /usr/local/pgsql/data
- Start the PostgreSQL daemon
./bin/pg_ctl start -o "-i" -D /usr/local/pgsql/data -l /home/postgres/serverlog
- Create the test database
./bin/createdb test
- Create the postgres user
- PostgreSQL should now be running. Logon as the postgres user (or use su - postgres). You should be able to connect to the test database and execute a test query with the following commands:
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 - PostgreSQL install is done
To install GEOS:
- Download GEOS source from http://geos.refractions.net
- Untar GEOS
tar -xzf geos-2.0.0.tar.gz
- Change to the GEOS source dir
cd geos-2.0-.0
- Follow the instructions in the GEOS README file to complete the installation. Typically the install goes like this:
./configure
make
make install
PostGIS
- Download PostGIS source from http://postgis.refractions.net
- Untar PostGIS into the contrib subdirectory of the postgresql build directory. The contrib subdirectory is located in the directory created in step 3 of the PostgreSQL installation process.
- Change to the postgis subdirectory
- Edit the Makefile to enable GEOS support (see the note above)
- PostGIS provides a manual in the doc/html subdirectory that explains the build process (see the Installation section)
- The quick and dirty steps to install PostGIS are:
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
GRASS
GDAL/OGR
TTo install GDAL/OGR from source:
- Download the GDAL distribution from http://www.remotesensing.org/gdal. You should use version 1.1.9 or higher. Versions prior to 1.1.9 contained a bug that caused problems when a null feature was encountered. If you want to build vector support for GRASS, you must use GDAL 1.2.3.
- Untar the distribution
tar xfvz /../path/../gdal-x.x.x.tar.gz
- Change to the gdal-x.x.x subdirectory that was created by step 2
cd gdal-x.x.x
- Configure GDAL
./configure
or if you want GRASS support./configure --with-grass=
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. - Build and install GDAL:
make
su
make install - In order to run GDAL after installing it is necessary for the shared library to be findable. This can often be accomplished by setting LD_LIBRARY_PATH to include /usr/local/lib. On Linux, you can add /usr/local/lib (or whatever path you used for installing GDAL) to /etc/ld.so.conf and run ldconfig as root.
- Make sure that gdal-config (found in the bin subdirectory where GDAL was installed) is included in the PATH. If necessary, add the path to gdal-config to the PATH environment variable.
export PATH=/../path/../gdal-config:$PATH
- Check the install by running:
gdal-config --prefix
Qt 3.1.2 or higher is required in order to compile QGIS. You may already have Qt on your system. If so, check to see if you have version 3.1.2 or later. You can check the Qt version using the find command:
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:
- Download Qt from http://www.trolltech.com/developer (choose the Qt/X11 Free Edition)
- Unpack the distribution
- Follow directions provided in the distribution directory (doc/html/install-x11.html)
- Use whatever configure options you like but make sure you include -thread for use with QGIS. You can configure Qt with minimal options:
./configure -thread
- Complete the installation per the instructions provided in the Qt documentation (see step 3)
Building QGIS
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.
Quick and Dirty
If you don't need PostgreSQL support and have installed GDAL , you can configure and build QGIS by changing to the distribution directory and typing:./configureThe above assumes that the gdal-config program is in your PATH See the next section for the full configuration instructions.
make
make install
Configuring QGIS the Right Way
To see the configure options available, change the the QGIS directory and enter:./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)
Qt
The configure script will detect Qt, unless it is installed in a non-standard location. Setting the QTDIR environment variable will make ensure that the detection succeeds. You can also specify the path using the -with-qtdir option.GDAL
If the gdal-config script is in the PATH, configure will automatically detect and configure GDAL support. If not in the path, you can specify the full path to gdal-config using the -with-gdal option. For example:/configure --with-gdal=/usr/mystuff/bin/gdal-config
PostgreSQL
If the pg_config script is in the PATH, configure will automatically detect and configure PostgreSQL support. If not, you can use the -with-pg option to specify the full path to pg_config. For example:./configure --with-pg=/usr/local/psql/bin/pg_config
GRASS
To build QGIS with GRASS support you must specify the full path to the installed GRASS binary package:./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.
Example Use of Configure
An example of use of configure for building QGIS with all options:./configure --prefix=/usr/local/qgis \This will configure QGIS to use GDAL, GRASS, and PostgreSQL. QGIS will be installed in /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.0
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.
Compiling and Installing QGIS
Once properly configured simply issue the following commands:makeNOTE - 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).
make install
For information on using QGIS see the QGIS User Guide.
Building Plugins
The QGIS source distribution contains a number of "core" plugins. These are built along with QGIS using the instructions above. Additional external plugins are available from the QGIS community website at http://community.qgis.org. Instructions for building an external plugin can be found at http://wiki.qgis.org/qgiswiki/StepByStepBuildInstructions. Some external plugins may include instructions on building. If so, follow the instructions provided with the plugin rather than those provided in the wiki.About this document ...
Building and Installing QGISThis 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
1 comment:
dear friend ,
this is sandeep das .i have installed GRASS 6.2.3 .But facing one problem while running it .when i enter in GRASS it gives me an error
g.region:error while loading shared library libgdal.so.l :there is no such file or directory .I have installed gdal-grass-1.4.1 version .after installing grass so if you can help me then please help me .I would like you to send me a mail if possible at sandeepdas.cse@gmail.com
atleast send any kind of confirmation that you have post it on your blog .
Post a Comment