root/tags/release-0.4.0/INSTALL

Revision 233, 6.1 kB (checked in by jdoyon, 3 years ago)

OK, final fixes to the WMS stuff, cleaned up documentation, and so on.

Things should be good to go for a first try by the wider community!

  • 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.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 (For PostGIS support)
26- (Optional) PROJ.4 (More on this below)
27
28- Python 1.5.2 or greater to build Mapnik
29- (Optional) Python 2.2 or greater for the Python language bindings
30
31All of these will normally come with any modern Linux distribution.
32
33If 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.
34
35Also, a minimum of 256MB of RAM is recommended for the build process.
36
37
38Building
39--------
40
41Once you've installed the required software packages, the simplest way to build mapnik is to run "scons" (The software builder) without any options:
42
43$ cd /path/to/mapnik-sourcecode
44$ /path/to/python scons/scons.py
45
46This 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).
47
48Note that the python used to run "scons" does NOT have to be the same as the one used for the python bindings.
49
50"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.
51
52To see the list of available options, from the root of the source distribution, run:
53
54$ /path/to/python scons/scons.py -h
55
56You will get:
57
58PREFIX: The install path "prefix"
59    default: /usr/local
60    actual: /usr/local
61
62BOOST_INCLUDES: Search path for boost include files ( /path/to/BOOST_INCLUDES )
63    default: /usr/include
64    actual: /usr/include
65
66BOOST_LIBS: Search path for boost library files ( /path/to/BOOST_LIBS )
67    default: /usr/lib
68    actual: /usr/lib
69
70FREETYPE_CONFIG: The path to the freetype-config executable. ( /path/to/FREETYPE_CONFIG )
71    default: /usr/bin/freetype-config
72    actual: /usr/bin/freetype-config
73
74PNG_INCLUDES: Search path for libpng include files ( /path/to/PNG_INCLUDES )
75    default: /usr/include
76    actual: /usr/include
77
78PNG_LIBS: Search path for libpng include files ( /path/to/PNG_LIBS )
79    default: /usr/lib
80    actual: /usr/lib
81
82JPEG_INCLUDES: Search path for libjpeg include files ( /path/to/JPEG_INCLUDES )
83    default: /usr/include
84    actual: /usr/include
85
86JPEG_LIBS: Search path for libjpeg library files ( /path/to/JPEG_LIBS )
87    default: /usr/lib
88    actual: /usr/lib
89
90TIFF_INCLUDES: Search path for libtiff include files ( /path/to/TIFF_INCLUDES )
91    default: /usr/include
92    actual: /usr/include
93
94TIFF_LIBS: Search path for libtiff library files ( /path/to/TIFF_LIBS )
95    default: /usr/lib
96    actual: /usr/lib
97
98PGSQL_INCLUDES: Search path for PostgreSQL include files ( /path/to/PGSQL_INCLUDES )
99    default: /usr/include
100    actual: /usr/include
101
102PGSQL_LIBS: Search path for PostgreSQL library files ( /path/to/PGSQL_LIBS )
103    default: /usr/lib
104    actual: /usr/lib
105
106PROJ_INCLUDES: Search path for PROJ.4 include files ( /path/to/PROJ_INCLUDES )
107    default: /usr/local/include
108    actual: /usr/local/include
109
110PROJ_LIBS: Search path for PROJ.4 include files ( /path/to/PROJ_LIBS )
111    default: /usr/local/lib
112    actual: /usr/local/lib
113
114PYTHON: Python executable ( /path/to/PYTHON )
115    default: /usr/bin/python
116    actual: /usr/bin/python
117
118INPUT_PLUGINS: Input drivers to include
119    (all|none|comma-separated list of names)
120    allowed names: postgis shape raster
121    default: all
122    actual: postgis shape raster
123
124BINDINGS: Language bindings to build
125    (all|none|comma-separated list of names)
126    allowed names: python
127    default: all
128    actual: python
129
130DEBUG: Compile a debug version of mapnik
131    default:
132    actual:
133
134This help should be self-explanatory!
135
136For example, if you compiled your own set of Boost libraries, you might use:
137
138$ /path/to/python scons/scons.py BOOST_INCLUDES=/usr/local/include/boost-1_33_1 BOOST_LIBS=/usr/local/lib
139
140
141Installation
142------------
143
144Once the build has successfully completed, you can install the various files on your system by executing:
145
146$ /path/to/python scons/scons.py install
147
148By default, everything will be installed under the PREFIX '/usr/local' as such:
149
150$PREFIX/lib: libmapnik.so
151$PREFIX/lib/mapnik/input: input plug-ins
152$PREFIX/include: mapnik include files
153$PREFIX/bin: shapeindex utility
154$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages/mapnik: Python bindings
155
156If you're using the default PREFIX, you will most likely need to be root to perform the install.
157
158
159A note on projection support
160----------------------------
161
162At this time Mapnik's core C++ library and map rendering engine does NOT support on-the-fly cartographic
163reprojections.
164
165Mapnik can however be configured to build the Python API to the PROJ.4 library.  This provides projection
166support through Python, and is used by the WMS ogcserver feature, since that server is written in Python.
167
168Here is an example on how to use it:
169
170>>> from mapnik import Projection
171registered datasource : raster
172registered datasource : shape
173registered datasource : postgis
174>>> p = Projection(['init=epsg:42304'])
175>>> p.Inverse(12345.245,143225.56)
176[-94.825927695613018, 50.290732340975467]
177>>>
178
179The Projection() instance provides Inverse() and Forward() methods.  For details on the possible parameters,
180see the PROJ.4 documentation.
181
182
183Test
184----
185
186There currently is no easy way to test your setup, other than write some code to generate a map.
187
188One simple thing you can do is try to load the Python module, and make sure it does so without errors:
189
190$ /path/to/python
191Python 2.4.2 (#1, Jan 11 2006, 10:59:28)
192[GCC 3.4.4 20050721 (Red Hat 3.4.4-2)] on linux2
193Type "help", "copyright", "credits" or "license" for more information.
194>>> from mapnik import *
195registered datasource : shape
196registered datasource : raster
197registered datasource : postgis
198>>>
Note: See TracBrowser for help on using the browser.