Mapnik on Debian Etch.

Late last year I went to the Ordnance Survey to see a demonstration of their new OpenSpace mapping service. It was there that I met Artem Pavlenko, who wrote Mapnik. We talked briefly about a few things, one of which was the Boost C++ libraries. I suggested that using such libraries makes software harder to build and install… “Oh no,” he said, “Boost’s all in the header files, so there are no library dependency problems.”

Well that turned out to be a big fat lie.

I’ve just been trying to build Mapnik on my stock Debian Etch box. Mapnik’s build system couldn’t find the required Boost libraries on its own, and it wasn’t possible to just tell it where they were…

Checking for C++ library boost_filesystem-mt... no
Could not find header or shared library for boost filesystem, exiting!

Mapnik doesn’t use makefiles or Autoconf – instead it uses “Scons”, a build system written in Python. Now, I love Python, but it’s not the solution to every problem. It’s hard to write makefiles that work on a wide variety of platforms. Autoconf largely solves that problem, but it too is hard to learn and use. Using C++ makes for even more problems. That’s tough – it simply is a hard problem. If you want to make a cross platform source distribution, you will have to work at it.

Scons seems to be an immature tool, that simply doesn’t solve half the problems that Autoconf does. It’s probably easy to use, but why bother if it doesn’t deliver the goods either. It’s pretty easy to write a plain makefile that compiles the code on your chosen OS. If you can’t be bothered to go through the pain of making it cross platform (and I don’t blame you), then don’t use something half-arsed like Scons – that just makes everyone’s life harder.

Anyway, rant over. I eventually got Mapnik to build on Debian Etch by adding symbolic links, with the names Scons expected to see:

mkdir -p /usr/local/lib
cd /usr/lib
`ls libboost*.so | grep -v -- '-gcc-' | sed 's%\(.*\)[.]so%ln -s /usr/lib/& /usr/local/lib/\1-mt.so; %'` 
echo /usr/local/lib > /etc/ld.so.conf.d/usr-local-lib.conf
ldconfig

Comment · RSS · TrackBack

  1. David said,

    19 December, 2008 @ 21:48

    So true. I had the same problem in another distro. Now I have a completely different problem… again with boost in mapnik… :(

  2. Thomas said,

    30 January, 2009 @ 07:01

    Finally! After a number of hours messing with compiling mapnik on etch I though to Google and this post solves all my problems (or, at least, enough of them to get scons — piece of shit that it is — to actually compile some code).

    Thanks!

  3. Darko said,

    3 October, 2013 @ 15:11

    Quote: scons — piece of shit that it is

    Absolutely agree. I actually searched for “scons piece of shit” to see if there are more suffering scons users. My condolences that your company too chose to use that crap. I think it deserves to be buried deep and given a huge monument with nice text.

Leave a Comment

Sponsors