Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fresh install: undefined reference to `mapnik::feature_style_processor<mapnik::cairo_renderer<std::shared_ptr<_cairo> > >::apply(double) #4243

Open
yohanboniface opened this issue Sep 1, 2021 · 16 comments

Comments

@yohanboniface
Copy link
Member

When I try to build Mapnik, after a fresh clone, it fails with this message:

/usr/bin/ld: demo/c++/rundemo.o: in function `main':
rundemo.cpp:(.text.startup+0x2699): undefined reference to `mapnik::feature_style_processor<mapnik::agg_renderer<mapnik::image<mapnik::rgba8_t>, mapnik::label_collision_detector4> >::apply(double)'
/usr/bin/ld: rundemo.cpp:(.text.startup+0x2aba): undefined reference to `mapnik::feature_style_processor<mapnik::cairo_renderer<std::shared_ptr<_cairo> > >::apply(double)'
collect2: error: ld returned 1 exit status
scons: *** [demo/c++/rundemo] Error 1
scons: building terminated because of errors.
make: *** [Makefile:48: mapnik] Error 2

Here is ./configure output:

leonardo:~/C/c/mapnik.new (master=) ./configure                                                                                                                                  48m 12s 541ms
scons: Reading SConscript files ...

Welcome to Mapnik...

Configuring build environment...
Configuring on Linux in *release mode*...
C++ compiler: c++ (GCC) 11.1.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Checking for pkg-config... yes
Checking for freetype2... yes
Checking for dlfcn.h support ... yes
Checking if compiler (c++) supports -std=c++14 flag... yes
Checking for C library z... yes
Checking for C++ library icuuc... yes
Checking for ICU version >= 4.0... yes (found ICU 69.1)
Checking for C++ library harfbuzz... yes
Checking for HarfBuzz version >= 0.9.34... yes (found HarfBuzz 2.9.0)
Checking for HarfBuzz with freetype support... yes
Searching for boost libs and headers... (cached) 
Found boost libs: /usr/lib
Found boost headers: /usr/include
Checking for C++ header file boost/version.hpp... yes
Checking for Boost version >= 1.61... yes
Found boost lib version... 1_76
Checking for C++ library boost_system... yes
Checking for C++ library boost_filesystem... yes
Checking for C++ library boost_regex... yes
Checking for C++ library boost_program_options... yes
Checking whether Boost was compiled with C++11 scoped enums ... yes
Checking if boost_regex was built with ICU unicode support... yes
Checking for C library jpeg... yes
Checking for C library proj... yes
Checking for Proj version >=7.2.0...yes (found Proj 8.0.1)
Checking for C library png... yes
Checking for C library webp... yes
Checking for C library tiff... yes
Checking for PROJ_LIB directory...proj_info.searchpath returned /usr/share/proj
Checking for ICU data directory...icu-config returned /usr/share/icu/69.1
Checking for GDAL data directory... gdal-config returned /usr/share/gdal
Checking for requested plugins dependencies...
Checking for pg_config... yes
Checking for pg_config... yes
Checking for gdal-config --libs... yes
Checking for gdal-config --cflags... yes
Checking for name of gdal library... gdal
Checking for C++ library gdal... yes
Checking if gdal is ogr enabled... yes
Checking for gdal-config --libs... yes
Checking for gdal-config --cflags... yes
Checking for name of ogr library... gdal
Checking for C++ library gdal... yes
Checking for C library sqlite3... yes
Checking if SQLite supports RTREE... yes
Checking for cairo... yes
Checking for cairo lib and include paths... yes
Checking for cairo freetype font support ... yes

All Required dependencies found!

Saving new file 'config.py'...
Will hold custom path variables from commandline and python config file(s)...

Configure completed: run `make` to build or `make install`

Full log: https://paste.sh/3M9H30rh#fu25ZorcB9fD4bcBB5yvQ8_e

I'm running Archlinux. Python 3.9.6.

Any clue ?

Thanks!

@artemp
Copy link
Member

artemp commented Sep 6, 2021

@yohanboniface - I don't see anything obvious from configure stderr. Could you re-post link to full log, I'm getting Not found?

@yohanboniface
Copy link
Member Author

Hi @artemp :)

Here you go!

mapnik.log

Thanks :)

@artemp
Copy link
Member

artemp commented Sep 6, 2021

Could you post output from

nm -C srs/libmapnik.so | grep feature_style_processor ?

@yohanboniface
Copy link
Member Author

Sure :)

leonardo:~/C/c/mapnik.new (master=) nm -C src/libmapnik.so | grep feature_style_processor                                                                                                  5ms
00000000001068a0 t _GLOBAL__sub_I_feature_style_processor.cpp
00000000001ed400 t mapnik::feature_style_processor<mapnik::agg_renderer<mapnik::image<mapnik::rgba8_t>, mapnik::label_collision_detector4> >::render_style(mapnik::agg_renderer<mapnik::image<mapnik::rgba8_t>, mapnik::label_collision_detector4>&, mapnik::feature_type_style const*, mapnik::rule_cache const&, std::shared_ptr<mapnik::Featureset>, mapnik::proj_transform const&)
00000000001f4060 t mapnik::feature_style_processor<mapnik::agg_renderer<mapnik::image<mapnik::rgba8_t>, mapnik::label_collision_detector4> >::prepare_layer(mapnik::layer_rendering_material&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<mapnik::IProcessorContext>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<mapnik::IProcessorContext> > > >&, mapnik::agg_renderer<mapnik::image<mapnik::rgba8_t>, mapnik::label_collision_detector4>&, double, double, unsigned int, unsigned int, mapnik::box2d<double> const&, int, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)
00000000001f5400 t mapnik::feature_style_processor<mapnik::agg_renderer<mapnik::image<mapnik::rgba8_t>, mapnik::label_collision_detector4> >::apply_to_layer(mapnik::layer const&, mapnik::agg_renderer<mapnik::image<mapnik::rgba8_t>, mapnik::label_collision_detector4>&, mapnik::projection const&, double, double, unsigned int, unsigned int, mapnik::box2d<double> const&, int, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)
00000000001f4e60 t mapnik::feature_style_processor<mapnik::agg_renderer<mapnik::image<mapnik::rgba8_t>, mapnik::label_collision_detector4> >::prepare_layers(mapnik::layer_rendering_material&, std::vector<mapnik::layer, std::allocator<mapnik::layer> > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<mapnik::IProcessorContext>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<mapnik::IProcessorContext> > > >&, mapnik::agg_renderer<mapnik::image<mapnik::rgba8_t>, mapnik::label_collision_detector4>&, double)
00000000001f4e60 t mapnik::feature_style_processor<mapnik::agg_renderer<mapnik::image<mapnik::rgba8_t>, mapnik::label_collision_detector4> >::prepare_layers(mapnik::layer_rendering_material&, std::vector<mapnik::layer, std::allocator<mapnik::layer> > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<mapnik::IProcessorContext>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<mapnik::IProcessorContext> > > >&, mapnik::agg_renderer<mapnik::image<mapnik::rgba8_t>, mapnik::label_collision_detector4>&, double) [clone .localalias]
00000000001ee310 t mapnik::feature_style_processor<mapnik::agg_renderer<mapnik::image<mapnik::rgba8_t>, mapnik::label_collision_detector4> >::render_material(mapnik::layer_rendering_material const&, mapnik::agg_renderer<mapnik::image<mapnik::rgba8_t>, mapnik::label_collision_detector4>&)
00000000001ef250 t mapnik::feature_style_processor<mapnik::agg_renderer<mapnik::image<mapnik::rgba8_t>, mapnik::label_collision_detector4> >::render_submaterials(mapnik::layer_rendering_material const&, mapnik::agg_renderer<mapnik::image<mapnik::rgba8_t>, mapnik::label_collision_detector4>&)
00000000001ef250 t mapnik::feature_style_processor<mapnik::agg_renderer<mapnik::image<mapnik::rgba8_t>, mapnik::label_collision_detector4> >::render_submaterials(mapnik::layer_rendering_material const&, mapnik::agg_renderer<mapnik::image<mapnik::rgba8_t>, mapnik::label_collision_detector4>&) [clone .localalias]
00000000001f5190 t mapnik::feature_style_processor<mapnik::agg_renderer<mapnik::image<mapnik::rgba8_t>, mapnik::label_collision_detector4> >::apply(double)
00000000001f56b0 t mapnik::feature_style_processor<mapnik::agg_renderer<mapnik::image<mapnik::rgba8_t>, mapnik::label_collision_detector4> >::apply(mapnik::layer const&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, double)
00000000001e2b90 t mapnik::feature_style_processor<mapnik::agg_renderer<mapnik::image<mapnik::rgba8_t>, mapnik::label_collision_detector4> >::feature_style_processor(mapnik::Map const&, double)
00000000001e2b90 t mapnik::feature_style_processor<mapnik::agg_renderer<mapnik::image<mapnik::rgba8_t>, mapnik::label_collision_detector4> >::feature_style_processor(mapnik::Map const&, double)
00000000001e9440 W mapnik::feature_style_processor<mapnik::grid_renderer<mapnik::hit_grid<mapnik::gray64s_t> > >::render_style(mapnik::grid_renderer<mapnik::hit_grid<mapnik::gray64s_t> >&, mapnik::feature_type_style const*, mapnik::rule_cache const&, std::shared_ptr<mapnik::Featureset>, mapnik::proj_transform const&)
00000000001f28b0 W mapnik::feature_style_processor<mapnik::grid_renderer<mapnik::hit_grid<mapnik::gray64s_t> > >::prepare_layer(mapnik::layer_rendering_material&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<mapnik::IProcessorContext>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<mapnik::IProcessorContext> > > >&, mapnik::grid_renderer<mapnik::hit_grid<mapnik::gray64s_t> >&, double, double, unsigned int, unsigned int, mapnik::box2d<double> const&, int, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)
00000000001f3c40 W mapnik::feature_style_processor<mapnik::grid_renderer<mapnik::hit_grid<mapnik::gray64s_t> > >::apply_to_layer(mapnik::layer const&, mapnik::grid_renderer<mapnik::hit_grid<mapnik::gray64s_t> >&, mapnik::projection const&, double, double, unsigned int, unsigned int, mapnik::box2d<double> const&, int, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)
00000000001f36a0 W mapnik::feature_style_processor<mapnik::grid_renderer<mapnik::hit_grid<mapnik::gray64s_t> > >::prepare_layers(mapnik::layer_rendering_material&, std::vector<mapnik::layer, std::allocator<mapnik::layer> > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<mapnik::IProcessorContext>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<mapnik::IProcessorContext> > > >&, mapnik::grid_renderer<mapnik::hit_grid<mapnik::gray64s_t> >&, double)
00000000001f36a0 t mapnik::feature_style_processor<mapnik::grid_renderer<mapnik::hit_grid<mapnik::gray64s_t> > >::prepare_layers(mapnik::layer_rendering_material&, std::vector<mapnik::layer, std::allocator<mapnik::layer> > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<mapnik::IProcessorContext>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<mapnik::IProcessorContext> > > >&, mapnik::grid_renderer<mapnik::hit_grid<mapnik::gray64s_t> >&, double) [clone .localalias]
00000000001ea490 W mapnik::feature_style_processor<mapnik::grid_renderer<mapnik::hit_grid<mapnik::gray64s_t> > >::render_material(mapnik::layer_rendering_material const&, mapnik::grid_renderer<mapnik::hit_grid<mapnik::gray64s_t> >&)
00000000001eb370 W mapnik::feature_style_processor<mapnik::grid_renderer<mapnik::hit_grid<mapnik::gray64s_t> > >::render_submaterials(mapnik::layer_rendering_material const&, mapnik::grid_renderer<mapnik::hit_grid<mapnik::gray64s_t> >&)
00000000001eb370 t mapnik::feature_style_processor<mapnik::grid_renderer<mapnik::hit_grid<mapnik::gray64s_t> > >::render_submaterials(mapnik::layer_rendering_material const&, mapnik::grid_renderer<mapnik::hit_grid<mapnik::gray64s_t> >&) [clone .localalias]
00000000001f39d0 W mapnik::feature_style_processor<mapnik::grid_renderer<mapnik::hit_grid<mapnik::gray64s_t> > >::apply(double)
00000000001f3ef0 W mapnik::feature_style_processor<mapnik::grid_renderer<mapnik::hit_grid<mapnik::gray64s_t> > >::apply(mapnik::layer const&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, double)
00000000001e2b30 W mapnik::feature_style_processor<mapnik::grid_renderer<mapnik::hit_grid<mapnik::gray64s_t> > >::feature_style_processor(mapnik::Map const&, double)
00000000001e2b30 W mapnik::feature_style_processor<mapnik::grid_renderer<mapnik::hit_grid<mapnik::gray64s_t> > >::feature_style_processor(mapnik::Map const&, double)
00000000001eb3f0 t mapnik::feature_style_processor<mapnik::cairo_renderer<std::shared_ptr<_cairo> > >::render_style(mapnik::cairo_renderer<std::shared_ptr<_cairo> >&, mapnik::feature_type_style const*, mapnik::rule_cache const&, std::shared_ptr<mapnik::Featureset>, mapnik::proj_transform const&)
00000000001f1100 t mapnik::feature_style_processor<mapnik::cairo_renderer<std::shared_ptr<_cairo> > >::prepare_layer(mapnik::layer_rendering_material&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<mapnik::IProcessorContext>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<mapnik::IProcessorContext> > > >&, mapnik::cairo_renderer<std::shared_ptr<_cairo> >&, double, double, unsigned int, unsigned int, mapnik::box2d<double> const&, int, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)
00000000001f2490 t mapnik::feature_style_processor<mapnik::cairo_renderer<std::shared_ptr<_cairo> > >::apply_to_layer(mapnik::layer const&, mapnik::cairo_renderer<std::shared_ptr<_cairo> >&, mapnik::projection const&, double, double, unsigned int, unsigned int, mapnik::box2d<double> const&, int, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)
00000000001f1ef0 t mapnik::feature_style_processor<mapnik::cairo_renderer<std::shared_ptr<_cairo> > >::prepare_layers(mapnik::layer_rendering_material&, std::vector<mapnik::layer, std::allocator<mapnik::layer> > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<mapnik::IProcessorContext>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<mapnik::IProcessorContext> > > >&, mapnik::cairo_renderer<std::shared_ptr<_cairo> >&, double)
00000000001f1ef0 t mapnik::feature_style_processor<mapnik::cairo_renderer<std::shared_ptr<_cairo> > >::prepare_layers(mapnik::layer_rendering_material&, std::vector<mapnik::layer, std::allocator<mapnik::layer> > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<mapnik::IProcessorContext>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<mapnik::IProcessorContext> > > >&, mapnik::cairo_renderer<std::shared_ptr<_cairo> >&, double) [clone .localalias]
00000000001ec4c0 t mapnik::feature_style_processor<mapnik::cairo_renderer<std::shared_ptr<_cairo> > >::render_material(mapnik::layer_rendering_material const&, mapnik::cairo_renderer<std::shared_ptr<_cairo> >&)
00000000001ed380 t mapnik::feature_style_processor<mapnik::cairo_renderer<std::shared_ptr<_cairo> > >::render_submaterials(mapnik::layer_rendering_material const&, mapnik::cairo_renderer<std::shared_ptr<_cairo> >&)
00000000001ed380 t mapnik::feature_style_processor<mapnik::cairo_renderer<std::shared_ptr<_cairo> > >::render_submaterials(mapnik::layer_rendering_material const&, mapnik::cairo_renderer<std::shared_ptr<_cairo> >&) [clone .localalias]
00000000001f2220 t mapnik::feature_style_processor<mapnik::cairo_renderer<std::shared_ptr<_cairo> > >::apply(double)
00000000001f2740 t mapnik::feature_style_processor<mapnik::cairo_renderer<std::shared_ptr<_cairo> > >::apply(mapnik::layer const&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, double)
00000000001e2ad0 t mapnik::feature_style_processor<mapnik::cairo_renderer<std::shared_ptr<_cairo> > >::feature_style_processor(mapnik::Map const&, double)
00000000001e2ad0 t mapnik::feature_style_processor<mapnik::cairo_renderer<std::shared_ptr<_cairo> > >::feature_style_processor(mapnik::Map const&, double)

Thanks!

@artemp
Copy link
Member

artemp commented Sep 6, 2021

@yohanboniface so the symbol in question is defined libmapnik.so hmm.. it's difficult to guess how your build system configured exactly, perhaps you have multiple libmapnik.so libs accessible via LD_LIBRARY_PATH ?

@yohanboniface
Copy link
Member Author

I do have a bunch of libmapnik.so around:

leonardo:~/C/c/mapnik.new (master !=) locate libmapnik.so                                                                                                                        25m 41s 273ms
/home/ybon/.cache/yay/mapnik-git/pkg/mapnik-git/usr/lib/libmapnik.so
/home/ybon/.cache/yay/mapnik-git/pkg/mapnik-git/usr/lib/libmapnik.so.4.0
/home/ybon/.cache/yay/mapnik-git/pkg/mapnik-git/usr/lib/libmapnik.so.4.0.0
/home/ybon/.cache/yay/mapnik-git/src/mapnik/src/libmapnik.so
/home/ybon/.cache/yay/mapnik-git/src/mapnik/src/libmapnik.so.4.0
/home/ybon/Code/cpp/mapnik/src/libmapnik.so
/home/ybon/Code/cpp/mapnik/src/libmapnik.so.4.0
/home/ybon/Code/cpp/mapnik.new/src/libmapnik.so
/home/ybon/Code/cpp/mapnik.new/src/libmapnik.so.4.0
/home/ybon/Code/cpp/python-mapnik/mapnik/lib/libmapnik.so
/home/ybon/Code/cpp/python-mapnik/mason_packages/.link/lib/libmapnik.so
/home/ybon/Code/cpp/python-mapnik/mason_packages/linux-x86_64/mapnik/df0bbe4/lib/libmapnik.so
/home/ybon/Code/js/kosmtik/node_modules/mapnik/lib/binding/lib/libmapnik.so
/home/ybon/Code/js/kosmtik/node_modules.bk/node_modules.bk/mapnik/lib/binding/lib/libmapnik.so
/home/ybon/Code/js/kosmtik/node_modules.bk/node_modules.bk/node_modules/mapnik/lib/binding/lib/libmapnik.so
/home/ybon/Code/js/kosmtik/node_modules.bk.20210208/mapnik/lib/binding/lib/libmapnik.so
/home/ybon/Code/py/mapnikio/vendor/mapnik/src/libmapnik.so
/home/ybon/Code/py/mapnikio/vendor/mapnik/src/libmapnik.so.3.1
/home/ybon/Code/py/mapnikio/vendor/mapnik/src/libmapnik.so.4.0
/home/ybon/Code/py/pyknik/vendor/mapnik/src/libmapnik.so
/home/ybon/Code/py/pyknik/vendor/mapnik/src/libmapnik.so.3.1
/home/ybon/Work/node_modules/mapnik/lib/binding/node-v46-linux-x64/libmapnik.so
/home/ybon/Work/playground/node_modules/mapnik/lib/binding/node-v47-linux-x64/libmapnik.so

I had the intuition that the issue could be something like that, this is why I reclonned mapnik (mapnik.new) and I also removed my system mapnik.
But I don't know which one from the list above could create a conflict. Any way to debug LD_LIBRARY_PATH at compile time ?

@cmidst
Copy link

cmidst commented Sep 29, 2021

@yohanboniface Were you able to figure out what the problem was?

I'm experiencing the same issue. In my case it's a RHEL 8 system and the only thing on it is mapnik (a single libmapnik.so).
I'm trying to figure out what changed in my environment since I last built this 3 months ago.

@b00ga
Copy link

b00ga commented Sep 29, 2021

Very similar issue. CentOS 8, Postgres13, postgis, libpq, gdal, proj from postgresql.org (PGDG) repo. Boost169 from CentOS.

c++ -o demo/c++/rundemo demo/c++/rundemo.o -Ldeps/agg -Lsrc -Lsrc/json -Lsrc/wkt -Lfreetype -L/usr/lib -L/usr/proj81/lib -L/usr/lib64/boost169 -L/usr/lib64 -L/usr/gdal33/lib -lmapnik -lagg -lboost_filesystem -lboost_regex -lcairo -lpng -lproj -lsqlite3 -ltiff -lwebp -licui18n -lboost_system -lharfbuzz -ljpeg -licuuc -lfreetype -lz -ldl -lsqlite3 -lpthread
demo/c++/rundemo.o: In function `main':
rundemo.cpp:(.text.startup+0x2780): undefined reference to `mapnik::feature_style_processor<mapnik::agg_renderer<mapnik::image<mapnik::rgba8_t>, mapnik::label_collision_detector4> >::apply(double)'
rundemo.cpp:(.text.startup+0x2b5a): undefined reference to `mapnik::feature_style_processor<mapnik::cairo_renderer<std::shared_ptr<_cairo> > >::apply(double)'
collect2: error: ld returned 1 exit status
scons: *** [demo/c++/rundemo] Error 1
scons: building terminated because of errors.
make: *** [Makefile:48: mapnik] Error 2

Built from commit 69911ad

Configured with:

PYTHON=python3 ./configure PROJ_LIBS=/usr/proj81/lib PROJ_INCLUDES=/usr/proj81/include GDAL_CONFIG=/usr/gdal33/bin/gdal-config BOOST_INCLUDES=/usr/include/boost169 BOOST_LIBS=/usr/lib64/boost169

and compiled with JOBS=1 make PYTHON=python3

@gravicappa
Copy link

I have similar issue and I managed to workaround it by removing -fvisibility=hidden from CFLAGS in SConstruct file.

@alsaleem00
Copy link

@gravicappa , I have same problem.
I did remove -fvisibility=hidden but did not work.
I used to compile mapnik from sources in zip file. But having this problem when i got the code with git.
Thanks.

@alsaleem00
Copy link

I switched to cmake build and goes well now.

@gravicappa
Copy link

Cmake build doesn't generate mapnik-config script which is required for building python-mapnik.

@albertas-akistechnologies

Hi everyone,
I managed to build successfully by adding two additional external template declarations:

diff --git a/include/mapnik/agg_renderer.hpp b/include/mapnik/agg_renderer.hpp
index d73ea3e8e..1c5ba141d 100644
--- a/include/mapnik/agg_renderer.hpp
+++ b/include/mapnik/agg_renderer.hpp
@@ -196,6 +196,7 @@ class MAPNIK_DECL agg_renderer : public feature_style_processor<agg_renderer<T0>
     void setup(Map const& m, buffer_type& pixmap);
 };
 
+extern template class MAPNIK_DECL feature_style_processor<agg_renderer<image_rgba8>>;
 extern template class MAPNIK_DECL agg_renderer<image<rgba8_t>>;
 
 } // namespace mapnik
diff --git a/include/mapnik/cairo/cairo_renderer.hpp b/include/mapnik/cairo/cairo_renderer.hpp
index 94bbec037..6ed4afd68 100644
--- a/include/mapnik/cairo/cairo_renderer.hpp
+++ b/include/mapnik/cairo/cairo_renderer.hpp
@@ -137,6 +137,7 @@ class MAPNIK_DECL cairo_renderer : public feature_style_processor<cairo_renderer
     void setup(Map const& m);
 };
 
+extern template class MAPNIK_DECL feature_style_processor<cairo_renderer<cairo_ptr>>;
 extern template class MAPNIK_DECL cairo_renderer<cairo_ptr>;
 
 } // namespace mapnik

feature_style_processor template class is not marked as visible by MAPNIK_DECL macro, so it is hidden by default, and it gets instantiated by cairo_renderer and agg_renderer templates due to inheritance. This can be fixed either by declaring external feature_style_processor templates with correct visibility, or by marking feature_style_processor template class as visible:

diff --git a/include/mapnik/feature_style_processor.hpp b/include/mapnik/feature_style_processor.hpp
index a8047fd0e..07f65a337 100644
--- a/include/mapnik/feature_style_processor.hpp
+++ b/include/mapnik/feature_style_processor.hpp
@@ -47,7 +47,7 @@ struct layer_rendering_material;
 enum eAttributeCollectionPolicy { DEFAULT = 0, COLLECT_ALL = 1 };
 
 template<typename Processor>
-class feature_style_processor
+class MAPNIK_DECL feature_style_processor
 {
   public:
     explicit feature_style_processor(Map const& m, double scale_factor = 1.0);

cloudwow added a commit to cloudwow/mapnik that referenced this issue Oct 7, 2022
Using fixes described in mapnik#4243 (comment)
@Donwulff
Copy link

Having the same problem still with the current development head (for proj-8) on RHEL/Oracle Linux 9. Just confirming the above patch fixed it for me as well. Need CXX_STD = '17' or BOOST_FILESYSTEM = True too, but same happens with both.

@HotPepperDaddy
Copy link

HotPepperDaddy commented Aug 2, 2023

I just had to apply the same patches to a fresh checkout. FYI running on Centos 9 stream and also had to use CXX_STD=17.

@arbrisseaux
Copy link

arbrisseaux commented Aug 22, 2023

Worked for me too, compiled mapnik on master branch with those two patches with success.

RUN git clone https://github.com/mapnik/mapnik.git && \ 
  cd mapnik && \
  git apply ../patch1.patch && \
  git apply ../patch2.patch && \
  git submodule update --init && \
  ./configure CXX_STD=17 && \
  JOBS=4 make && \
  make install

Nakaner pushed a commit to geofabrik/mapnik that referenced this issue Sep 6, 2023
Nakaner pushed a commit to geofabrik/mapnik that referenced this issue Oct 10, 2023
Nakaner pushed a commit to geofabrik/mapnik that referenced this issue Nov 16, 2023
Nakaner pushed a commit to geofabrik/mapnik that referenced this issue Nov 24, 2023
Nakaner pushed a commit to geofabrik/mapnik that referenced this issue Nov 24, 2023
Nakaner pushed a commit to geofabrik/mapnik that referenced this issue Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants