openstreetmap / mod_tile

Renders map tiles with mapnik and serves them using apache
http://wiki.openstreetmap.org/wiki/Mod_tile
GNU General Public License v2.0
288 stars 191 forks source link

Compile error on Ubuntu 16.04 against Mapnik 3.0 #130

Closed antigravity99 closed 3 years ago

antigravity99 commented 8 years ago

I installed mapnik with the following command: sudo apt-get install libmapnik-dev libmapnik3.0 mapnik-utils mapnik-vector-tile python-mapnik python3-mapnik

When I make I get the following error:

src/renderd-gen_tile.o: In function render_thread': /home/josh/mod_tile/src/gen_tile.cpp:369: undefined reference tomapnik::Map::srs() const' clang: error: linker command failed with exit code 1 (use -v to see invocation) Makefile:784: recipe for target 'renderd' failed make[1]: * [renderd] Error 1 make[1]: Leaving directory '/home/josh/mod_tile' Makefile:1300: recipe for target 'all-recursive' failed make: * [all-recursive] Error 1

Thanks in advance for any help!

pnorman commented 8 years ago

Can you run mapnik-config -v and report the version number?

cc @springmeyer

antigravity99 commented 8 years ago

3.0.9

pnorman commented 8 years ago

the automake libtool g++ apache2-dev mapnik-utils libmapnik-dev packages will work on a clean install. Do you get the same error if you do

apt-get remove *mapnik* && apt-get install libtool g++ apache2-dev libmapnik-dev mapnik-utils
pnorman commented 8 years ago

the automake libtool g++ apache2-dev mapnik-utils libmapnik-dev packages will work on a clean install.

More specifically, I tested this as part of a script which installs

zip unzip curl git ca-certificates locales \
postgresql-9.5-postgis-2.2 \
  postgresql-contrib-9.5 osm2pgsql proj-bin \
mapnik-utils node-carto \
  fonts-dejavu-core fonts-droid-fallback ttf-unifont \
automake libtool g++ apache2-dev libmapnik-dev
SomeoneElseOSM commented 8 years ago

For info, a build of mod_tile 11 days ago against what was in 16.04 LTS worked for me to (as an aside, I had a problem trying to build mapnik itself, and created https://github.com/mapnik/mapnik/issues/3462 , but the mapnik in 16.04 "just worked").

My sequence of events:

 sudo apt-get install autoconf apache2-dev libtool libxml2-dev libbz2-dev libgeos-dev libgeos++-dev libproj-dev gdal-bin libgdal1-dev
 The following NEW packages will be installed
   gdal-bin libgdal1-dev
 sudo apt-get install libmapnik-dev mapnik-utils python-mapnik

cd ~/src
git clone git://github.com/SomeoneElseOSM/mod_tile.git
cd mod_tile
./autogen.sh
./configure
make
sudo make install
sudo make install-mod_tile
sudo ldconfig

(that mod_tile is pretty similar to this one)

antigravity99 commented 8 years ago

That seems to have gotten me past my original problem but now I am getting this:

In file included from /usr/local/include/mapnik/params.hpp:29:0,
                 from /usr/local/include/mapnik/map.hpp:32,
                 from src/gen_tile.cpp:2:
/usr/local/include/mapnik/util/variant.hpp:27:30: fatal error: mapbox/variant.hpp: No such file or directory
compilation terminated.

I think I found a post on how to fix this, I just don't understand git enough to apply the fix. So I am going to have to do a little more Googling. Thanks!

sebastic commented 8 years ago

@antigravity99, Mapbox variant has been packaged for Mapnik >= 3.0.10 in the mapbox-variant source package which builds the libmapbox-variant-dev binary package, and has been synced from Debian into Ubuntu yakkety. If you're building mapnik from source you need to install the mapbox variant headers in /usr/local/include too.

mozartvn commented 7 years ago

hi all, I have the same issues, please help me !

osm@ubuntu:~/mod_tile$ make Making all in iniparser3.0b make[1]: Entering directory '/home/osm/mod_tile/iniparser3.0b' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/home/osm/mod_tile/iniparser3.0b' make[1]: Entering directory '/home/osm/mod_tile' /bin/bash ./libtool --tag=CXX --mode=link g++ -I/usr/include -I/usr/include/mapnik/agg -I/usr/include -I/usr/include/freetype2 -I/usr/include/libxml2 -I/usr/include/gdal -I/usr/include/postgresql -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng12 -DMAPNIK_MEMORY_MAPPED_FILE -DMAPNIK_HAS_DLCFN -DBIGINT -DBOOST_REGEX_HAS_ICU -DHAVE_JPEG -DMAPNIK_USE_PROJ4 -DHAVE_PNG -DHAVE_WEBP -DHAVE_TIFF -DLINUX -DMAPNIK_THREADSAFE -DBOOST_SPIRIT_NO_PREDEFINED_TERMINALS=1 -DBOOST_PHOENIX_NO_PREDEFINED_TERMINALS=1 -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DNDEBUG -DHAVE_CAIRO -DGRID_RENDERER -DHAVE_LIBXML2 -std=c++11 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g0 -Wall -pthread -Wsign-compare -Wshadow -O2 -I/usr/include -I/usr/include/mapnik/agg -I/usr/include -I/usr/include/freetype2 -I/usr/include/libxml2 -I/usr/include/gdal -I/usr/include/postgresql -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng12 -DMAPNIK_MEMORY_MAPPED_FILE -DMAPNIK_HAS_DLCFN -DBIGINT -DBOOST_REGEX_HAS_ICU -DHAVE_JPEG -DMAPNIK_USE_PROJ4 -DHAVE_PNG -DHAVE_WEBP -DHAVE_TIFF -DLINUX -DMAPNIK_THREADSAFE -DBOOST_SPIRIT_NO_PREDEFINED_TERMINALS=1 -DBOOST_PHOENIX_NO_PREDEFINED_TERMINALS=1 -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DNDEBUG -DHAVE_CAIRO -DGRID_RENDERER -DHAVE_LIBXML2 -std=c++11 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g0 -Wall -pthread -Wsign-compare -Wshadow -O2 -L/usr/lib -L/usr/lib/x86_64-linux-gnu -Wl,-Bsymbolic-functions -Wl,-z,relro -g0 -pthread -o renderd src/daemon.o src/daemon_compat.o src/renderd-gen_tile.o src/sys_utils.o src/request_queue.o src/cache_expire.o src/renderd-metatile.o src/renderd-parameterize_style.o src/protocol_helper.o src/store.o src/store_file.o src/store_file_utils.o src/store_memcached.o src/store_rados.o src/store_ro_http_proxy.o src/store_ro_composite.o src/store_null.o -L/usr/lib -lmapnik -L/usr/lib -L/usr/lib/x86_64-linux-gnu -Wl,-Bsymbolic-functions -Wl,-z,relro -g0 -pthread -lboost_filesystem -lboost_regex -lcairo -lpng -lproj -ltiff -lwebp -lxml2 -licui18n -lboost_system -lharfbuzz -ljpeg -licuuc -lfreetype -lz -ldl -L/usr/lib/x86_64-linux-gnu -lcurl -liniparser -Liniparser3.0b/.libs -liniparser -lm libtool: link: g++ -I/usr/include -I/usr/include/mapnik/agg -I/usr/include -I/usr/include/freetype2 -I/usr/include/libxml2 -I/usr/include/gdal -I/usr/include/postgresql -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng12 -DMAPNIK_MEMORY_MAPPED_FILE -DMAPNIK_HAS_DLCFN -DBIGINT -DBOOST_REGEX_HAS_ICU -DHAVE_JPEG -DMAPNIK_USE_PROJ4 -DHAVE_PNG -DHAVE_WEBP -DHAVE_TIFF -DLINUX -DMAPNIK_THREADSAFE -DBOOST_SPIRIT_NO_PREDEFINED_TERMINALS=1 -DBOOST_PHOENIX_NO_PREDEFINED_TERMINALS=1 -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DNDEBUG -DHAVE_CAIRO -DGRID_RENDERER -DHAVE_LIBXML2 -std=c++11 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g0 -Wall -pthread -Wsign-compare -Wshadow -O2 -I/usr/include -I/usr/include/mapnik/agg -I/usr/include -I/usr/include/freetype2 -I/usr/include/libxml2 -I/usr/include/gdal -I/usr/include/postgresql -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng12 -DMAPNIK_MEMORY_MAPPED_FILE -DMAPNIK_HAS_DLCFN -DBIGINT -DBOOST_REGEX_HAS_ICU -DHAVE_JPEG -DMAPNIK_USE_PROJ4 -DHAVE_PNG -DHAVE_WEBP -DHAVE_TIFF -DLINUX -DMAPNIK_THREADSAFE -DBOOST_SPIRIT_NO_PREDEFINED_TERMINALS=1 -DBOOST_PHOENIX_NO_PREDEFINED_TERMINALS=1 -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DNDEBUG -DHAVE_CAIRO -DGRID_RENDERER -DHAVE_LIBXML2 -std=c++11 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g0 -Wall -pthread -Wsign-compare -Wshadow -O2 -Wl,-Bsymbolic-functions -Wl,-z -Wl,relro -g0 -pthread -o .libs/renderd src/daemon.o src/daemon_compat.o src/renderd-gen_tile.o src/sys_utils.o src/request_queue.o src/cache_expire.o src/renderd-metatile.o src/renderd-parameterize_style.o src/protocol_helper.o src/store.o src/store_file.o src/store_file_utils.o src/store_memcached.o src/store_rados.o src/store_ro_http_proxy.o src/store_ro_composite.o src/store_null.o -Wl,-Bsymbolic-functions -Wl,-z -Wl,relro -g0 -pthread -L/usr/lib -L/usr/lib/x86_64-linux-gnu -lmapnik -lboost_filesystem -lboost_regex -lcairo -lpng /usr/lib/x86_64-linux-gnu/libproj.so -ltiff -lwebp -lxml2 -licui18n -lboost_system -lharfbuzz -ljpeg -licuuc /usr/lib/x86_64-linux-gnu/libfreetype.so -lz -ldl /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so -Liniparser3.0b/.libs /home/osm/mod_tile/iniparser3.0b/.libs/libiniparser.so -lm -pthread src/renderd-gen_tile.o: In functionload_fonts(char const, int)': gen_tile.cpp:(.text+0x188): undefined reference to mapnik::freetype_engine::register_font(std::string const&)' src/renderd-gen_tile.o: In functionrender_init': gen_tile.cpp:(.text+0x60e): undefined reference to mapnik::datasource_cache::register_datasources(std::string const&, bool)' src/renderd-gen_tile.o: In functionrender_thread': gen_tile.cpp:(.text+0x7dd): undefined reference to mapnik::Map::Map(int, int, std::string const&)' gen_tile.cpp:(.text+0x94f): undefined reference tomapnik::load_map(mapnik::Map&, std::string const&, bool, std::string)' gen_tile.cpp:(.text+0x1058): undefined reference to mapnik::Map::srs() const' gen_tile.cpp:(.text+0x164d): undefined reference tostd::string mapnik::save_to_string(mapnik::image_view_any const&, std::string const&)' src/renderd-parameterize_style.o: In function `parameterize_map_language(mapnik::Map&, char)': parameterize_style.cpp:(.text+0x465): undefined reference to boost::optional<std::string> mapnik::parameters::get<std::string>(std::string const&) const' collect2: error: ld returned 1 exit status Makefile:784: recipe for target 'renderd' failed make[1]: *** [renderd] Error 1 make[1]: Leaving directory '/home/osm/mod_tile' Makefile:1300: recipe for target 'all-recursive' failed make: *** [all-recursive] Error 1 osm@ubuntu:~/mod_tile$

thanks in advance !

PeteDevoy commented 6 years ago

For anyone coming from Google having problems installing libmapnik-dev on Ubuntu -- my unmet libmapbox-variant-dev dependency was due to ubuntugis PPA in my apt sources.

adililhan commented 6 years ago

@PeteDevoy thank you man! you saved my hours!

coenier commented 4 years ago

@PeteDevoy or @adililhan How did you fix that?

PeteDevoy commented 4 years ago

@PeteDevoy or @adililhan How did you fix that?

@coenier I'm probably late but just remove the PPA.

LobsterFestival commented 4 years ago

@mozartvn please, i am having this same issue, did you ever find a resolution to this issue? I'm going crazy trying to resolve this.

pantierra commented 3 years ago

Compiling in recent Ubuntu versions works by now. Closing here.