compile error of mapnik 2.1.0 in boost 1.53.0 spirit / phoenix

613 views
Skip to first unread message

Skyvin

unread,
Apr 2, 2013, 7:39:32 AM4/2/13
to map...@googlegroups.com
Hi,

I get an error while compiling mapnik2.1.0:

include/mapnik/json/feature_collection_grammar.hpp:94:   instantiated from ‘mapnik::json::feature_collection_grammar<Iterator, FeatureType>::feature_collection_grammar(const mapnik::context_ptr&, const mapnik::transcoder&) [with Iterator = __gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, FeatureType = mapnik::feature_impl]’
src/json/feature_collection_parser.cpp:38:   instantiated from ‘mapnik::json::feature_collection_parser<Iterator>::feature_collection_parser(const mapnik::context_ptr&, const mapnik::transcoder&) [with Iterator = __gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]’
src/json/feature_collection_parser.cpp:58:   instantiated from here
/app/tools/mapnik/include/boost/spirit/home/phoenix/operator/self.hpp:65: error: conversion from ‘mapnik::feature_impl’ to non-scalar type ‘boost::error_cant_deduce_type’ requested
scons: *** [src/json/feature_collection_parser.os] Error 1
scons: building terminated because of errors.
make: *** [mapnik] Error 2

I am with boost1.53.0, icu4.6, gcc4.4.7 on rhel6.3.

Have anyone got this error? Thanks a lot.

skyvin

Dane Springmeyer

unread,
Apr 2, 2013, 2:15:13 PM4/2/13
to map...@googlegroups.com
This error started due to changes upstream in boost >= 1.52 and is fixed in both Mapnik development branches: 2.1.x (future 2.1.1 stable release) and 2.2-pre (current master).

If you want to stick with 2.1.x series then pull from this branch for the time being. Very little will change in this branch before 2.1.1 is released so you can consider it production quality.


Dane

--
You received this message because you are subscribed to the Google Groups "mapnik" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapnik+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Yi YU

unread,
Apr 3, 2013, 5:25:17 AM4/3/13
to map...@googlegroups.com
Hi Dane,

Thanks a lot for your information.
I'll try the next mapnik release soon. For now I compile v2.1.0 with boost 1.51.0. There is no more error on spirit/phoenix.
But I met another error on ICU.

g++ -o demo/c++/rundemo.o -c -I/app/labo/mapnik/include -DHAVE_JPEG -ansi -Wall -pthread -ftemplate-depth-300 -DLINUX -DBOOST_SPIRIT_THREADSAFE -DMAPNIK_THREADSAFE -O3 -fno-strict-aliasing -finline-functions -Wno-inline -Wno-parentheses -Wno-char-subscripts -DNDEBUG -DHAVE_LIBXML2 -Ideps/agg/include -I. -Iinclude -I/app/labo/mapnik/include -I/app/labo/freetype/include/freetype2 -I/app/labo/freetype/include -I/app/labo/libxml2/include/libxml2 -I/usr/include -I/usr/pgsql-9.2/include demo/c++/rundemo.cpp
g++ -o demo/c++/rundemo -L/app/labo/mapnik/lib demo/c++/rundemo.o -Ldeps/agg -Lsrc -L/app/labo/mapnik/lib -L/app/labo/freetype/lib -L/usr/lib -L/usr/pgsql-9.2/lib -lagg -lfreetype -lltdl -lpng -ltiff -lz -lproj -licuuc -lboost_filesystem -lboost_system -lboost_regex -ljpeg -lxml2 -lboost_thread -lmapnik
/app/labo/mapnik/lib/libmapnik.so: undefined reference to `icudt46_dat'
collect2: ld returned 1 exit status
scons: *** [demo/c++/rundemo] Error 1
scons: building terminated because of errors.
make: *** [mapnik] Error 2

I have built icu4c-4_6_1 from source with prefix-it "--prefix=/app/labo/mapnik". 

And I only found those files with this name "icudt46*":
$ find /app/labo/mapnik/ -name "icudt46*"
/app/labo/mapnik/icu/source/data/out/build/icudt46l
/app/labo/mapnik/icu/source/data/out/tmp/icudt46l_dat.o
/app/labo/mapnik/icu/source/data/out/tmp/icudt46l_dat.s
/app/labo/mapnik/icu/source/data/out/tmp/icudt46l.dat
/app/labo/mapnik/icu/source/data/in/icudt46l.dat

Here is some "icu-config" information: 
$ /app/labo/mapnik/bin/icu-config --icudata --icudata-install-dir --icudata-mode --icudatadir --version
icudt46l /app/labo/mapnik/share/icu/4.6.1 static /app/labo/mapnik/share/icu/4.6.1


I cannot understand this "/app/labo/mapnik/lib/libmapnik.so: undefined reference to `icudt46_dat'" error. Did you see where comes that and how to resolve it? Thanks a lot.



--
You received this message because you are subscribed to a topic in the Google Groups "mapnik" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mapnik/qmyNGDB-wI4/unsubscribe?hl=en-GB.
To unsubscribe from this group and all of its topics, send an email to mapnik+un...@googlegroups.com.

Dane Springmeyer

unread,
Apr 3, 2013, 3:06:08 PM4/3/13
to map...@googlegroups.com
you can solve this by linking to libicudata.so like:

./configure CUSTOM_LDFLAGS="-licudata"

Dane

Skyvin

unread,
Apr 4, 2013, 5:00:56 AM4/4/13
to map...@googlegroups.com
Hi Dane,

Thank you for your reply.

Curiously, the compiling goes always to the same error even I add this linking flag in configure command. 
"g++ -o demo/c++/rundemo -L/app/labo/mapnik/lib -licudata demo/c++/rundemo.o -Ldeps/agg -Lsrc -L/app/labo/mapnik/lib -L/app/labo/freetype/lib -L/usr/lib -L/usr/pgsql-9.2/lib -lagg -lfreetype -lltdl -lpng -ltiff -lz -lproj -licuuc -lboost_filesystem -lboost_system -lboost_regex -ljpeg -lxml2 -lboost_thread -lmapnik
/app/labo/mapnik/lib/libmapnik.so: undefined reference to `icudt46_dat'"

The flage "-licudata", that I specified in configure command, has been added in the g++ process:
"g++ -o demo/c++/rundemo -L/app/labo/mapnik/lib -licudata demo/c++/rundemo.o -Ldeps/agg ... ... 
Which makes the same error. 
My configure command is:
$ export prefix=/app/labo/mapnik; ./configure PREFIX=$prefix/mapnik-2.1.0   CUSTOM_CXXFLAGS=-I$prefix/include     CUSTOM_LDFLAGS="-L$prefix/lib -licudata"   PKG_CONFIG_PATH=$prefix/lib/pkgconfig    INPUT_PLUGINS=shape,postgis  PYTHON_PREFIX=$prefix     PYTHON=/app/tools/python26/bin/python     DEMO=True FREETYPE_CONFIG=${prefix}/bin/freetype-config XML2_CONFIG=${prefix}/bin/xml2-config PG_CONFIG=/usr/pgsql-9.2/bin/pg_config


But If I run this g++ command alone with one more "-licudata" option in the end. It works.

------------------------------------------------------------------------------

Here the g++ process WITH one more "-licudata" at the end:
$ g++ -o demo/c++/rundemo -L/app/labo/mapnik/lib -licudata demo/c++/rundemo.o -Ldeps/agg -Lsrc -L/app/labo/mapnik/lib -L/app/labo/freetype/lib -L/usr/lib -L/usr/pgsql-9.2/lib -lagg -lfreetype -lltdl -lpng -ltiff -lz -lproj -licuuc -lboost_filesystem -lboost_system -lboost_regex -ljpeg -lxml2 -lboost_thread -lmapnik -v -licudata
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/4.4.7/:/usr/libexec/gcc/x86_64-redhat-linux/4.4.7/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/:/usr/lib/gcc/x86_64-redhat-linux/:/usr/libexec/gcc/x86_64-redhat-linux/4.4.7/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/:/usr/lib/gcc/x86_64-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/4.4.7/:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-o' 'demo/c++/rundemo' '-L/app/labo/mapnik/lib' '-Ldeps/agg' '-Lsrc' '-L/app/labo/mapnik/lib' '-L/app/labo/freetype/lib' '-L/usr/lib' '-L/usr/pgsql-9.2/lib' '-v' '-shared-libgcc' '-mtune=generic'
 /usr/libexec/gcc/x86_64-redhat-linux/4.4.7/collect2 --eh-frame-hdr --build-id -m elf_x86_64 --hash-style=gnu -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o demo/c++/rundemo /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/4.4.7/crtbegin.o -L/app/labo/mapnik/lib -Ldeps/agg -Lsrc -L/app/labo/mapnik/lib -L/app/labo/freetype/lib -L/usr/lib -L/usr/pgsql-9.2/lib -L/usr/lib/gcc/x86_64-redhat-linux/4.4.7 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.7 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../.. -licudata demo/c++/rundemo.o -lagg -lfreetype -lltdl -lpng -ltiff -lz -lproj -licuuc -lboost_filesystem -lboost_system -lboost_regex -ljpeg -lxml2 -lboost_thread -lmapnik -licudata -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-redhat-linux/4.4.7/crtend.o /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crtn.o

This one works!

------------------------------------------------------------------------------

Here the normal g++ process:

$ g++ -o demo/c++/rundemo -L/app/labo/mapnik/lib -licudata demo/c++/rundemo.o -Ldeps/agg -Lsrc -L/app/labo/mapnik/lib -L/app/labo/freetype/lib -L/usr/lib -L/usr/pgsql-9.2/lib -lagg -lfreetype -lltdl -lpng -ltiff -lz -lproj -licuuc -lboost_filesystem -lboost_system -lboost_regex -ljpeg -lxml2 -lboost_thread -lmapnik -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/4.4.7/:/usr/libexec/gcc/x86_64-redhat-linux/4.4.7/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/:/usr/lib/gcc/x86_64-redhat-linux/:/usr/libexec/gcc/x86_64-redhat-linux/4.4.7/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/:/usr/lib/gcc/x86_64-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/4.4.7/:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-o' 'demo/c++/rundemo' '-L/app/labo/mapnik/lib' '-Ldeps/agg' '-Lsrc' '-L/app/labo/mapnik/lib' '-L/app/labo/freetype/lib' '-L/usr/lib' '-L/usr/pgsql-9.2/lib' '-v' '-shared-libgcc' '-mtune=generic'
 /usr/libexec/gcc/x86_64-redhat-linux/4.4.7/collect2 --eh-frame-hdr --build-id -m elf_x86_64 --hash-style=gnu -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o demo/c++/rundemo /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/4.4.7/crtbegin.o -L/app/labo/mapnik/lib -Ldeps/agg -Lsrc -L/app/labo/mapnik/lib -L/app/labo/freetype/lib -L/usr/lib -L/usr/pgsql-9.2/lib -L/usr/lib/gcc/x86_64-redhat-linux/4.4.7 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.7 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../.. -licudata demo/c++/rundemo.o -lagg -lfreetype -lltdl -lpng -ltiff -lz -lproj -licuuc -lboost_filesystem -lboost_system -lboost_regex -ljpeg -lxml2 -lboost_thread -lmapnik -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-redhat-linux/4.4.7/crtend.o /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crtn.o
/app/labo/mapnik/lib/libmapnik.so: undefined reference to `icudt46_dat'
collect2: ld returned 1 exit status

------------------------------------------------------------------------------

Is there anything wrong during my compiling? 

Thanks a lot.

skyvin

Dane Springmeyer

unread,
Apr 4, 2013, 11:21:16 AM4/4/13
to map...@googlegroups.com
Skyvin,

Glad you could find a workaround. Yes, I've also seen this odd behavior - basically that the CUSTOM_LDFLAGS end up prepended instead of appended to the linker line such that they do not work as expected. This only occurs for me on linux. I've created a bug to track this problem at:


Dane

Skyvin

unread,
Apr 5, 2013, 3:57:50 AM4/5/13
to map...@googlegroups.com
Hi Dane,

Thank you very much for your support.

I add this workaround to the compiling of libmapnik.so(launch g++ separately with -licudata). Then there is no more error in my build.

I appreciate your help and time.
Have a great week-end!

Skyvin
Reply all
Reply to author
Forward
0 new messages