2011-08-23 20:10:52 +02:00
|
|
|
# Mapnik Installation
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2015-04-25 08:21:59 +02:00
|
|
|
Mapnik runs on Linux, OS X, Windows, and BSD systems.
|
2005-06-15 22:50:02 +02:00
|
|
|
|
2016-01-14 20:00:38 +01:00
|
|
|
First clone mapnik from github and initialize submodules
|
|
|
|
|
|
|
|
```bash
|
|
|
|
git clone https://github.com/mapnik/mapnik.git
|
|
|
|
git submodule update --init
|
|
|
|
```
|
|
|
|
|
2013-01-15 19:50:02 +01:00
|
|
|
To configure and build Mapnik do:
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2014-09-03 23:57:27 +02:00
|
|
|
```bash
|
2015-07-01 01:12:22 +02:00
|
|
|
./configure
|
|
|
|
make
|
2014-09-03 23:57:27 +02:00
|
|
|
```
|
|
|
|
|
2014-09-23 20:24:54 +02:00
|
|
|
To trigger parallel compilation you can pass a JOBS value to make:
|
|
|
|
|
|
|
|
```bash
|
2015-07-01 01:12:22 +02:00
|
|
|
JOBS=4 make
|
2014-09-23 20:24:54 +02:00
|
|
|
```
|
|
|
|
|
2015-07-01 01:12:22 +02:00
|
|
|
Mapnik needs > 2 GB of RAM to build. If you use parallel compilation it needs more.
|
|
|
|
|
|
|
|
If you are on a system with less memory make sure you only build with one JOB:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
JOBS=1 make
|
|
|
|
```
|
2014-09-23 20:24:54 +02:00
|
|
|
|
2014-09-03 23:57:27 +02:00
|
|
|
To use a Python interpreter that is not named `python` for your build, do
|
|
|
|
something like the following instead:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ PYTHON=python2 ./configure
|
|
|
|
$ make PYTHON=python2
|
|
|
|
```
|
2013-01-15 19:50:02 +01:00
|
|
|
|
2013-03-22 22:14:36 +01:00
|
|
|
NOTE: the above will not work on windows, rather see https://github.com/mapnik/mapnik/wiki/WindowsInstallation
|
2013-01-15 19:50:02 +01:00
|
|
|
|
|
|
|
Then to run the tests locally (without needing to install):
|
|
|
|
|
2015-04-25 08:21:59 +02:00
|
|
|
make test
|
2013-01-15 19:50:02 +01:00
|
|
|
|
|
|
|
Install like:
|
|
|
|
|
2015-04-25 08:21:59 +02:00
|
|
|
make install
|
2009-03-31 19:46:05 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
If you need to uninstall do:
|
2009-03-31 19:46:05 +02:00
|
|
|
|
2015-04-25 08:21:59 +02:00
|
|
|
make uninstall
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2013-01-15 19:50:02 +01:00
|
|
|
For more details see the `Building` Section below.
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2012-08-16 21:27:58 +02:00
|
|
|
Platform specific install guides at https://github.com/mapnik/mapnik/wiki/Mapnik-Installation
|
2009-02-27 00:46:19 +01:00
|
|
|
|
2012-08-16 21:27:58 +02:00
|
|
|
For troubleshooting help see https://github.com/mapnik/mapnik/wiki/InstallationTroubleshooting
|
2009-02-27 00:46:19 +01:00
|
|
|
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
## Depends
|
2008-11-15 00:25:17 +01:00
|
|
|
|
2013-01-15 19:50:02 +01:00
|
|
|
Build system dependencies are:
|
2010-01-11 20:39:59 +01:00
|
|
|
|
2014-10-02 22:24:00 +02:00
|
|
|
* C++ compiler supporting `-std=c++11` (like >= g++ 4.8 or >= clang++ 3.4)
|
2014-09-05 09:14:10 +02:00
|
|
|
* >= 2 GB RAM (> 5 GB for g++)
|
2013-01-15 19:50:02 +01:00
|
|
|
* Python 2.4-2.7
|
|
|
|
* Scons (a copy is bundled)
|
2008-11-15 00:25:17 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
Mapnik Core depends on:
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2012-01-09 00:55:47 +01:00
|
|
|
* Boost
|
2014-10-14 02:43:14 +02:00
|
|
|
- >= 1.47 is required and >= 1.56 recommended
|
2013-01-15 19:50:02 +01:00
|
|
|
- These libraries are used:
|
2012-01-09 00:55:47 +01:00
|
|
|
- filesystem
|
|
|
|
- system
|
|
|
|
- regex (optionally built with icu regex support)
|
|
|
|
- program_options (optionally for mapnik command line programs)
|
2011-08-23 20:10:52 +02:00
|
|
|
* libicuuc >= 4.0 (ideally >= 4.2) - International Components for Unicode
|
2013-01-15 19:50:02 +01:00
|
|
|
* libz - Zlib compression
|
|
|
|
* libfreetype - Freetype2 for font support (Install requires freetype-config)
|
2011-08-23 20:10:52 +02:00
|
|
|
* libxml2 - XML parsing (Install requires xml2-config)
|
2014-09-30 17:57:54 +02:00
|
|
|
* libharfbuzz - an OpenType text shaping engine (>=0.9.34 needed for CSS font-feature-settings support)
|
2013-07-19 07:09:17 +02:00
|
|
|
|
|
|
|
Mapnik Core optionally depends on:
|
|
|
|
|
|
|
|
* libpng >= 1.2.x - PNG graphics (Default enabled, if found)
|
|
|
|
* libjpeg - JPEG graphics (Default enabled, if found)
|
|
|
|
* libtiff - TIFF graphics (Default enabled, if found)
|
|
|
|
* libwebp - WEBP graphics (Default enabled, if found)
|
|
|
|
* libproj - PROJ.4 projection library (Default enabled, if found)
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2013-07-19 07:09:17 +02:00
|
|
|
Additional optional dependencies:
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2013-05-25 01:45:02 +02:00
|
|
|
* Cairo >= 1.6.0 - Graphics library for output formats like PDF, PS, and SVG
|
2009-02-01 21:32:23 +01:00
|
|
|
- pkg-config - Required for building with cairo support
|
2013-06-07 17:38:30 +02:00
|
|
|
* PostgreSQL (for PostGIS plugin support)
|
|
|
|
- libpq - PostreSQL libraries
|
|
|
|
- pg_config - PostgreSQL installation capabilities
|
2011-08-23 20:10:52 +02:00
|
|
|
* libgdal - GDAL/OGR input (For gdal and ogr plugin support)
|
2013-01-15 19:50:02 +01:00
|
|
|
* libsqlite3 - SQLite input (needs RTree support builtin) (sqlite plugin support)
|
2015-10-02 18:12:15 +02:00
|
|
|
|
2010-10-02 14:30:53 +02:00
|
|
|
Instructions for installing many of these dependencies on
|
2013-01-15 19:50:02 +01:00
|
|
|
various platforms can be found at the Mapnik Wiki:
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2013-01-15 19:50:02 +01:00
|
|
|
https://github.com/mapnik/mapnik/wiki/Mapnik-Installation
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2005-06-15 22:50:02 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
## Building
|
2006-04-14 05:45:46 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
The build system uses SCons, a pure python equivalent to autotools or cmake.
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
We provide a simple Makefile wrapper that can be used like:
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
./configure && make && make install
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2013-01-15 19:50:02 +01:00
|
|
|
For help on what options are accepted do:
|
|
|
|
|
|
|
|
./configure --help
|
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
To interact with the local copy of scons directly you can do:
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
python scons/scons.py configure
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
You can also use a globally installed scons:
|
2008-11-15 00:25:17 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
scons configure
|
2009-02-01 21:32:23 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
If you want to clean your build do:
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
make clean
|
2009-03-31 19:46:05 +02:00
|
|
|
|
2013-01-15 19:50:02 +01:00
|
|
|
If you experience odd configure errors, try cleaning the configure caches:
|
2009-03-31 19:46:05 +02:00
|
|
|
|
2013-01-15 19:50:02 +01:00
|
|
|
make distclean
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
To install in a custom location do:
|
|
|
|
|
|
|
|
./configure PREFIX=/opt/mapnik
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
To pass custom CXXFLAGS or LDFLAGS do:
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
./configure CUSTOM_CXXFLAGS="-g -I/usr/include" CUSTOM_LDFLAGS="-L/usr/lib"
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
To pass custom paths to a dependency, like boost, do:
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
./configure BOOST_INCLUDES=/opt/boost/include BOOST_LIBS=/opt/boost/lib
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
To pass custom paths to a dependency, like icu, do:
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
./configure ICU_INCLUDES=/usr/local/include ICU_LIBS=/usr/local/include
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2013-01-15 19:50:02 +01:00
|
|
|
For more details on usage see:
|
2011-08-23 20:10:52 +02:00
|
|
|
|
2012-08-16 21:27:58 +02:00
|
|
|
https://github.com/mapnik/mapnik/wiki/UsingScons
|
2006-02-01 00:09:52 +01:00
|
|
|
|
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
## Testing Installation
|
2005-06-15 22:50:02 +02:00
|
|
|
|
2013-01-15 19:50:02 +01:00
|
|
|
You can run the Mapnik tests locally (without installing) like:
|
2005-06-15 22:50:02 +02:00
|
|
|
|
2015-04-25 08:21:59 +02:00
|
|
|
make test
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2015-10-02 18:08:59 +02:00
|
|
|
## Python Bindings
|
|
|
|
|
|
|
|
Python bindings are not included by default. You'll need to add those separately.
|
|
|
|
|
2015-10-02 18:12:15 +02:00
|
|
|
* Build from source: https://github.com/mapnik/python-mapnik
|
2015-10-02 18:08:59 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
## Learning Mapnik
|
|
|
|
|
2013-01-15 19:50:02 +01:00
|
|
|
### Help
|
2011-08-23 20:10:52 +02:00
|
|
|
|
2013-01-15 19:50:02 +01:00
|
|
|
Mapnik has an active community of talented users and developers making beautiful maps.
|
2011-08-23 20:10:52 +02:00
|
|
|
|
2013-01-15 19:50:02 +01:00
|
|
|
If you need help or want to participate starting points include:
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2013-01-15 19:50:02 +01:00
|
|
|
- Sign up and post to the mailing list: http://mapnik.org/contact/
|
|
|
|
- Join and ask questions on the #mapnik channel on irc://irc.freenode.net/mapnik
|
|
|
|
- Add your help questions to https://github.com/mapnik/mapnik-support
|
2009-02-01 21:32:23 +01:00
|
|
|
|
2013-01-15 19:50:02 +01:00
|
|
|
### Cartographers
|
2009-02-01 21:32:23 +01:00
|
|
|
|
2013-01-15 19:50:02 +01:00
|
|
|
TileMill, which uses Mapnik internally, offers great step by step tutorials for
|
|
|
|
learning advanced map styling: http://mapbox.com/tilemill/docs/crashcourse/introduction/
|
2009-02-01 21:32:23 +01:00
|
|
|
|
2013-01-15 19:50:02 +01:00
|
|
|
### Programmers
|
2009-02-01 21:32:23 +01:00
|
|
|
|
2013-01-15 19:50:02 +01:00
|
|
|
Mapnik is great for building your own mapping applications. Visit
|
|
|
|
https://github.com/mapnik/mapnik/wiki/LearningMapnik for basic
|
|
|
|
tutorials on how to programmatically use Mapnik.
|
2009-02-01 21:32:23 +01:00
|
|
|
|
2013-01-15 19:50:02 +01:00
|
|
|
### Contributers
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2015-06-30 23:28:16 +02:00
|
|
|
Read docs/contributing.md for resources for getting involved with Mapnik development.
|