root/tags/release-0.5.1/INSTALL

Revision 641, 5.8 kB (checked in by artem, 11 months ago)

updated to reflect latest changes

  • Property svn:keywords set to Id
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.33.0 or greater with the following libraries included:
13        - thread
14        - system (boost >= 1.35 only)
15        - filesystem
16        - regex
17        - iostreams
18        - (Optional) program_options
19        - (Optional) python
20
21- libpng
22- libjpeg
23- libtiff
24- libz
25- libfreetype2
26- (Optional) PostgreSQL libraries (For PostGIS support)
27- (Optional) PROJ.4 (More on this below)
28- (Optional) GDAL
29- Python 1.5.2 or greater to build Mapnik
30- (Optional) Python 2.4 or greater for the Python language bindings
31
32All of these will normally come with any modern Linux distribution.
33
34If 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.
35
36Also, a minimum of 256MB of RAM is recommended for the build process.
37
38
39Building
40--------
41
42Once you've installed the required software packages, the simplest way to build mapnik is to run "scons" (The software builder) without any options:
43
44$ cd /path/to/mapnik-sourcecode
45$ /path/to/python scons/scons.py
46
47This 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).
48
49Note that the python used to run "scons" does NOT have to be the same as the one used for the python bindings.
50
51"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.
52
53To see the list of available options, from the root of the source distribution, run:
54
55$ /path/to/python scons/scons.py -h
56
57You will get:
58
59PREFIX: The install path "prefix"
60    default: /usr/local
61    actual: /usr/local
62
63BOOST_INCLUDES: Search path for boost include files ( /path/to/BOOST_INCLUDES )
64    default: /usr/include
65    actual: /usr/include
66
67BOOST_LIBS: Search path for boost library files ( /path/to/BOOST_LIBS )
68    default: /usr/lib
69    actual: /usr/lib
70
71FREETYPE_CONFIG: The path to the freetype-config executable. ( /path/to/FREETYPE_CONFIG )
72    default: /usr/bin/freetype-config
73    actual: /usr/bin/freetype-config
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
107PROJ_INCLUDES: Search path for PROJ.4 include files ( /path/to/PROJ_INCLUDES )
108    default: /usr/local/include
109    actual: /usr/local/include
110
111PROJ_LIBS: Search path for PROJ.4 include files ( /path/to/PROJ_LIBS )
112    default: /usr/local/lib
113    actual: /usr/local/lib
114
115PYTHON: Python executable ( /path/to/PYTHON )
116    default: /usr/bin/python
117    actual: /usr/bin/python
118
119INPUT_PLUGINS: Input drivers to include
120    (all|none|comma-separated list of names)
121    allowed names: postgis shape raster
122    default: all
123    actual: postgis shape raster
124
125BINDINGS: Language bindings to build
126    (all|none|comma-separated list of names)
127    allowed names: python
128    default: all
129    actual: python
130
131DEBUG: Compile a debug version of mapnik
132    default:
133    actual:
134
135This help should be self-explanatory!
136
137For example, if you compiled your own set of Boost libraries, you might use:
138
139$ /path/to/python scons/scons.py BOOST_INCLUDES=/usr/local/include/boost-1_33_1 BOOST_LIBS=/usr/local/lib
140
141
142Installation
143------------
144
145Once the build has successfully completed, you can install the various files on your system by executing:
146
147$ /path/to/python scons/scons.py install
148
149By default, everything will be installed under the PREFIX '/usr/local' as such:
150
151$PREFIX/lib: libmapnik.so
152$PREFIX/lib/mapnik/input: input plug-ins
153$PREFIX/include: mapnik include files
154$PREFIX/bin: shapeindex utility
155$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages/mapnik: Python bindings
156
157If you're using the default PREFIX, you will most likely need to be root to perform the install.
158
159
160A note on projection support
161----------------------------
162
163Mapnik's core C++ library and map rendering engine support on-the-fly cartographic
164reprojections.
165
166Here is an example on how to use it:
167
168>>> from mapnik import Projection,Coord
169>>> p = Projection('init=epsg:27700') # British National Grid
170>>> p.foward(Coord(-1.125,51.75))
171Coord(460396.904482,206113.130999)
172>>>
173
174The Projection() instance provides inverse() and forward() methods.  For details on the possible parameters,
175see the PROJ.4 documentation.
176
177
178Test
179----
180
181There currently is no easy way to test your setup, other than write some code to generate a map.
182
183One simple thing you can do is try to load the Python module, and make sure it does so without errors:
184
185$ /path/to/python
186Python 2.4.2 (#1, Jan 11 2006, 10:59:28)
187[GCC 3.4.4 20050721 (Red Hat 3.4.4-2)] on linux2
188Type "help", "copyright", "credits" or "license" for more information.
189>>> from mapnik import *
190>>>
Note: See TracBrowser for help on using the browser.