artemp/mapnik — Issue #823: [PATCH] Build of mapnik r3151 on Debian Sid
Author: artemp
Created: 2011-10-11 16:38:00+00:00
State: open
Labels: Scons_Build_Scripts

After some svn up's I bumped into a problem: mapnik doesn't compile anymore on two of my systems, both debian sid.

Here's error message:

{{{
python scons/scons.py -j 4
scons: Reading SConscript files ...
Using previous successful configuration...
Re-configure by running "python scons/scons.py configure".

Welcome to Mapnik...

*********************************************
You are compiling Mapnik trunk (aka Mapnik2)
See important details at:
http://trac.mapnik.org/wiki/Mapnik2
*********************************************

scons: done reading SConscript files.
scons: Building targets ...
g++ -o bindings/python/mapnik_python.os -c -DHAVE_JPEG -DBOOST_REGEX_HAS_ICU -ansi -Wall -pthread -ftemplate-depth-200 -DLINUX -DBOOST_SPIRIT_THREADSAFE -DMAPNIK_THREADSAFE -O3 -finline-functions -Wno-inline -DNDEBUG -DSVN_REVISION=3151 -DHAVE_CAIRO -DHAVE_PYCAIRO -pthread -fPIC -Iagg/include -I. -Iinclude -I/usr/local/include -I/usr/include -I/usr/include/freetype2 -I/usr/include/libxml2 -I/usr/include/gdal -I/usr/include/postgresql -I/usr/include/python2.6 -I/usr/include/cairomm-1.0 -I/usr/lib/cairomm-1.0/include -I/usr/include/cairo -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/pycairo bindings/python/mapnik_python.cpp
g++ -o plugins/input/postgis/postgis_datasource.os -c -DHAVE_JPEG -DBOOST_REGEX_HAS_ICU -ansi -Wall -pthread -ftemplate-depth-200 -DLINUX -DBOOST_SPIRIT_THREADSAFE -DMAPNIK_THREADSAFE -O3 -finline-functions -Wno-inline -DNDEBUG -fPIC -Iagg/include -I. -Iinclude -I/usr/local/include -I/usr/include -I/usr/include/freetype2 -I/usr/include/libxml2 -I/usr/include/gdal -I/usr/include/postgresql plugins/input/postgis/postgis_datasource.cpp
g++ -o plugins/input/postgis/postgis_featureset.os -c -DHAVE_JPEG -DBOOST_REGEX_HAS_ICU -ansi -Wall -pthread -ftemplate-depth-200 -DLINUX -DBOOST_SPIRIT_THREADSAFE -DMAPNIK_THREADSAFE -O3 -finline-functions -Wno-inline -DNDEBUG -fPIC -Iagg/include -I. -Iinclude -I/usr/local/include -I/usr/include -I/usr/include/freetype2 -I/usr/include/libxml2 -I/usr/include/gdal -I/usr/include/postgresql plugins/input/postgis/postgis_featureset.cpp
g++ -o plugins/input/sqlite/sqlite_datasource.os -c -DHAVE_JPEG -DBOOST_REGEX_HAS_ICU -ansi -Wall -pthread -ftemplate-depth-200 -DLINUX -DBOOST_SPIRIT_THREADSAFE -DMAPNIK_THREADSAFE -O3 -finline-functions -Wno-inline -DNDEBUG -fPIC -Iagg/include -I. -Iinclude -I/usr/local/include -I/usr/include -I/usr/include/freetype2 -I/usr/include/libxml2 -I/usr/include/gdal -I/usr/include/postgresql plugins/input/sqlite/sqlite_datasource.cpp
In file included from bindings/python/python_grid_utils.hpp:33:0,
from bindings/python/mapnik_python.cpp:82:
include/mapnik/grid/grid_util.hpp: In function ‘void mapnik::scale_grid(mapnik::hit_grid::data_type&, const data_type&, double, double)’:
include/mapnik/grid/grid_util.hpp:53:20: warning: variable ‘yprt1’ set but not used [-Wunused-but-set-variable]
include/mapnik/grid/grid_util.hpp:53:33: warning: variable ‘xprt1’ set but not used [-Wunused-but-set-variable]
g++ -o plugins/input/sqlite/sqlite_featureset.os -c -DHAVE_JPEG -DBOOST_REGEX_HAS_ICU -ansi -Wall -pthread -ftemplate-depth-200 -DLINUX -DBOOST_SPIRIT_THREADSAFE -DMAPNIK_THREADSAFE -O3 -finline-functions -Wno-inline -DNDEBUG -fPIC -Iagg/include -I. -Iinclude -I/usr/local/include -I/usr/include -I/usr/include/freetype2 -I/usr/include/libxml2 -I/usr/include/gdal -I/usr/include/postgresql plugins/input/sqlite/sqlite_featureset.cpp
g++ -o tests/cpp_tests/font_registration_test tests/cpp_tests/font_registration_test.o -Lagg -Lsrc -L/usr/local/lib -L/usr/lib -lagg -lfreetype -lltdl -lpng -ltiff -lz -ljpeg -lproj -licuuc -lboost_filesystem -lboost_regex -lxml2 -lboost_thread -lcairomm-1.0 -lcairo -lsigc-2.0 -lmapnik2
/usr/bin/ld: tests/cpp_tests/font_registration_test.o: undefined reference to symbol 'boost::system::system_category()'
/usr/bin/ld: note: 'boost::system::system_category()' is defined in DSO /usr/lib64/libboost_system.so.1.46.1 so try adding it to the linker command line
/usr/lib64/libboost_system.so.1.46.1: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
scons: *** [tests/cpp_tests/font_registration_test] Error 1
scons: building terminated because of errors.
}}}

Here's a patch that fixed the problem for me. Maybe it should be made nicer for other systems?

{{{
Index: src/SConscript
===================================================================
--- src/SConscript (revision 3151)
+++ src/SConscript (working copy)
@@ -50,9 +50,10 @@

filesystem = 'boost_filesystem%s' % env['BOOST_APPEND']
regex = 'boost_regex%s' % env['BOOST_APPEND']
+boost_system = 'boost_system%s' % env['BOOST_APPEND']

# clear out and re-set libs for this env
-lib_env['LIBS'] = ['freetype','ltdl','png','tiff','z','jpeg','proj',env['ICU_LIB_NAME'],filesystem,regex]
+lib_env['LIBS'] = ['freetype','ltdl','png','tiff','z','jpeg','proj',env['ICU_LIB_NAME'],filesystem,regex,boost_system]

if env['HAS_CAIRO']:
# add cairo and cairomm-1.0 to libs
}}}