Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Mapnik on Amazon Linux AMI (Fedora)
# http://aws.amazon.com/amazon-linux-ami/
# http://aws.amazon.com/amazon-linux-ami/faqs/
# login
ssh -i key.pem ec2-user@ec2...compute.amazonaws.com
# update
sudo yum -y update
sudo yum -y upgrade
# enable EPEL6 by changing enabled=0 -> enabled=1
sudo vim /etc/yum.repos.d/epel.repo
# install deps
sudo yum -y install make clang gcc46 bzip2-devel libtool-ltdl-devel libpng-devel libtiff-devel zlib-devel libjpeg-devel libxml2-devel python-setuptools htop git-all python-nose python26-devel python26 proj-devel proj proj-epsg proj-nad libtool-ltdl-devel libtool-ltdl freetype-devel freetype libicu-devel libicu gdal-devel gdal postgresql-devel sqlite-devel sqlite libcurl-devel libcurl cairo-devel cairo pycairo-devel pycairo geos-devel geos
# setup gcc46
sudo ln -s /usr/bin/gcc46 /usr/bin/gcc
sudo ln -s /usr/bin/g++46 /usr/bin/g++
export CC=gcc
export CXX=g++
alias cc=$CC
# source compile of cairomm
wget http://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.2/libsigc++-2.2.10.tar.bz2
tar xf libsigc++-2.2.10.tar.bz2
cd libsigc++-2.2.10
./configure && make && sudo make install
cd ../
wget http://www.cairographics.org/releases/cairomm-1.8.0.tar.gz
tar xf cairomm-1.8.0.tar.gz
cd cairomm-1.8.0
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
./configure && make && sudo make install
# build recent boost
wget http://voxel.dl.sourceforge.net/project/boost/boost/1.51.0/boost_1_51_0.tar.bz2
tar xf boost_1_51_0.tar.bz2
cd boost_1_51_0
./bootstrap.sh
./b2 -j8 \
--with-thread \
--with-filesystem \
--with-python \
--with-regex -sHAVE_ICU=1 \
--with-program_options \
--with-system \
link=shared \
toolset=gcc \
stage
sudo ./b2 -j8 \
--with-thread \
--with-filesystem \
--with-python \
--with-regex -sHAVE_ICU=1 \
--with-program_options \
--with-system \
toolset=gcc \
link=shared \
install
cd ../
# set up support for libraries installed in /usr/local/lib
sudo bash -c "echo '/usr/local/lib' > /etc/ld.so.conf.d/boost.conf"
sudo ldconfig
# mapnik
git clone https://github.com/mapnik/mapnik
cd mapnik
./configure
# node
wget http://nodejs.org/dist/v0.8.7/node-v0.8.7.tar.gz
tar xf node-v0.8.7.tar.gz
cd node-v0.8.7
./configure
sudo bash -c "CC=gcc46 make install"
cd ../
# node-mapnik
git clone https://github.com/mapnik/node-mapnik
cd node-mapnik
./configure && make
npm install mocha
make test
cd ../
# tilemill
git clone https://github.com/mapbox/tilemill
cd tilemill
vim package.json # remove the 'topcube' line since the GUI will not work on fedora due to lacking gtk/webkit
npm install
./index.js --server=true # view on http://localhost:20009, more info: http://mapbox.com/tilemill/docs/guides/ubuntu-service/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment