root/tags/release-0.2.5a/INSTALL

Revision 132, 5.0 kB (checked in by pavlenko, 3 years ago)

new build system

Line 
1# $Id$
2
3INSTALLATION INSTRUCTIONS
4
5Prerequisites
6-------------
7
8First, here is a quick list of the software dependencies:
9
10- Linux/UNIX with g++ compiler
11
12- libboost 1.32.0 or greater with the following libraries included:
13        - thread
14        - wserialization
15        - filesystem
16        - regex
17        - (Optional) program_options
18        - (Optional) python
19
20- libpng
21- libjpeg
22- libtiff
23- libz
24- libfreetype2
25- (Optional) PostgreSQL libraries
26
27- Python 1.5.2 or greater to build Mapnik
28- (Optional) Python 2.2 or greater for the Python language bindings
29
30All of these will normally come with any modern Linux distribution.
31
32If your system does NOT have one of these installed, you will need to install the mandatory ones at the very least before proceeding further.  Instructions on how to do this will come with each individual package.
33
34
35Building
36--------
37
38Once you've installed the required software packages, the simplest way to build mapnik is to run "scons" (The software builder) without any options:
39
40$ cd /path/to/mapnik-sourcecode
41$ /path/to/python scons/scons.py
42
43This should compile and link the mapnik library, the input plugins and the python language binding (if possible).  If any mandatory dependencies are not found the build will fail, and you will need to specify custom paths to your libraries and include files (see below).
44
45Note that the python used to run "scons" does NOT have to be the same as the one used for the python bindings.
46
47"scons" accepts a variety of options to customize your build.  This allows you to specify which components are compiled, where to find dependencies, where to install mapnik, and so on.
48
49To see the list of available options, from the root of the source distribution, run:
50
51$ /path/to/python scons/scons.py -h
52
53You will get:
54
55PREFIX: The install path "prefix"
56    default: /usr/local
57    actual: /usr/local
58
59BOOST_INCLUDES: Search path for boost include files ( /path/to/BOOST_INCLUDES )
60    default: /usr/include
61    actual: /usr/include
62
63BOOST_LIBS: Search path for boost library files ( /path/to/BOOST_LIBS )
64    default: /usr/lib
65    actual: /usr/lib
66
67FREETYPE_INCLUDES: Search path for FreeType include files ( /path/to/FREETYPE_INCLUDES )
68    default: /usr/include
69    actual: /usr/include
70
71FREETYPE_LIBS: Search path for FreeType library files ( /path/to/FREETYPE_LIBS )
72    default: /usr/lib
73    actual: /usr/lib
74
75PNG_INCLUDES: Search path for libpng include files ( /path/to/PNG_INCLUDES )
76    default: /usr/include
77    actual: /usr/include
78
79PNG_LIBS: Search path for libpng include files ( /path/to/PNG_LIBS )
80    default: /usr/lib
81    actual: /usr/lib
82
83JPEG_INCLUDES: Search path for libjpeg include files ( /path/to/JPEG_INCLUDES )
84    default: /usr/include
85    actual: /usr/include
86
87JPEG_LIBS: Search path for libjpeg library files ( /path/to/JPEG_LIBS )
88    default: /usr/lib
89    actual: /usr/lib
90
91TIFF_INCLUDES: Search path for libtiff include files ( /path/to/TIFF_INCLUDES )
92    default: /usr/include
93    actual: /usr/include
94
95TIFF_LIBS: Search path for libtiff library files ( /path/to/TIFF_LIBS )
96    default: /usr/lib
97    actual: /usr/lib
98
99PGSQL_INCLUDES: Search path for PostgreSQL include files ( /path/to/PGSQL_INCLUDES )
100    default: /usr/include
101    actual: /usr/include
102
103PGSQL_LIBS: Search path for PostgreSQL library files ( /path/to/PGSQL_LIBS )
104    default: /usr/lib
105    actual: /usr/lib
106
107PYTHON: Python executable ( /path/to/PYTHON )
108    default: /usr/local/bin/python2.4
109    actual: /usr/local/bin/python2.4
110
111INPUT_PLUGINS: Input drivers to include
112    (all|none|comma-separated list of names)
113    allowed names: postgis shape raster
114    default: all
115    actual: postgis shape raster
116
117BINDINGS: Language bindings to build
118    (all|none|comma-separated list of names)
119    allowed names: python
120    default: all
121    actual: python
122
123This help should be self-explanatory!
124
125For example, if you compiled your own set of Boost libraries, you might use:
126
127$ /path/to/python scons/scons.py BOOST_INCLUDES=/usr/local/include/boost-1_33_1 BOOST_LIBS=/usr/local/lib
128
129
130Installation
131------------
132
133Once the build has successfully completed, you can install the various files on your system by executing:
134
135$ /path/to/python scons/scons.py install
136
137By default, everything will be installed under the PREFIX '/usr/local' as such:
138
139$PREFIX/lib: libmapnik.so
140$PREFIX/lib/mapnik/input: input plug-ins
141$PREFIX/include: mapnik include files
142$PREFIX/bin: shapeindex utility
143$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages/mapnik: Python bindings
144
145If you're using the default PREFIX, you will most likely need to be root to perform the install.
146
147
148Test
149----
150
151There currently are no easy way to test your setup, other than write some code to generate a map.
152
153One simple thing you can do is try to load the Python module, and make sure it does so without errors:
154
155$ /path/to/python
156Python 2.4.2 (#1, Jan 11 2006, 10:59:28)
157[GCC 3.4.4 20050721 (Red Hat 3.4.4-2)] on linux2
158Type "help", "copyright", "credits" or "license" for more information.
159>>> from mapnik import *
160registered datasource : shape
161registered datasource : raster
162registered datasource : postgis
163>>>
Note: See TracBrowser for help on using the browser.