Bug 518881

Summary: mapnik doesn't seem to be linking to agg correctly
Product: [Fedora] Fedora Reporter: Kevin Fenzi <kevin>
Component: mapnikAssignee: Christopher Brown <chris.brown>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: caolanm, chris.brown, cristian.balint, tcallawa
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-12 20:15:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
fix the .pc file
none
fix for mapnik to explicitly link against agg even in the non-internal case
none
patch against gpsdrive to then use pkgconfig to get the right libs to link against none

Description Kevin Fenzi 2009-08-23 20:20:44 UTC
Greetings. I maintain gpsdrive. With the recent update of mapnik in rawhide, I needed to rebuild it for the new mapnik so. 

However, it fails to build with: 

/usr/lib64/ccache/c++   -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic   -fPIC CMakeFiles/gpsdrive.dir/battery.o CMakeFiles/gpsdrive.dir/database.o CMakeFiles/gpsdrive.dir/database_sqlite.o CMakeFiles/gpsdrive.dir/draw_grid.o CMakeFiles/gpsdrive.dir/friends.o CMakeFiles/gpsdrive.dir/geometry.o CMakeFiles/gpsdrive.dir/gpsdrive.o CMakeFiles/gpsdrive.dir/gpsdrive_config.o CMakeFiles/gpsdrive.dir/gps_handler.o CMakeFiles/gpsdrive.dir/gpsmisc.o CMakeFiles/gpsdrive.dir/gpsnasamap.o CMakeFiles/gpsdrive.dir/gui.o CMakeFiles/gpsdrive.dir/gpx.o CMakeFiles/gpsdrive.dir/icons.o CMakeFiles/gpsdrive.dir/import_map.o CMakeFiles/gpsdrive.dir/LatLong-UTMconversion.o CMakeFiles/gpsdrive.dir/main_gui.o CMakeFiles/gpsdrive.dir/map_download.o CMakeFiles/gpsdrive.dir/map_handler.o CMakeFiles/gpsdrive.dir/map_projection.o CMakeFiles/gpsdrive.dir/os_specific.o CMakeFiles/gpsdrive.dir/poi.o CMakeFiles/gpsdrive.dir/poi_gui.o CMakeFiles/gpsdrive.dir/routes.o CMakeFiles/gpsdrive.dir/screenshot.o CMakeFiles/gpsdrive.dir/settings.o CMakeFiles/gpsdrive.dir/settings_gui.o CMakeFiles/gpsdrive.dir/speech.o CMakeFiles/gpsdrive.dir/splash.o CMakeFiles/gpsdrive.dir/track.o CMakeFiles/gpsdrive.dir/unit_test.o CMakeFiles/gpsdrive.dir/waypoint.o CMakeFiles/gpsdrive.dir/database_postgis.o CMakeFiles/gpsdrive.dir/mapnik.o CMakeFiles/gpsdrive.dir/gpskismet.o  -o gpsdrive -rdynamic -lcrypt -lgtk-x11-2.0 -lgdk-x11-2.0 -lglib-2.0 -lxml2 -lsqlite3 -lcurl -lgps -lgda-3.0 -lboost_filesystem-mt -lmapnik -lspeechd
/usr/lib/gcc/x86_64-redhat-linux/4.4.1/../../../../lib64/libmapnik.so: undefined reference to `agg::vcgen_stroke::remove_all()'
/usr/lib/gcc/x86_64-redhat-linux/4.4.1/../../../../lib64/libmapnik.so: undefined reference to `agg::vcgen_stroke::vcgen_stroke()'
/usr/lib/gcc/x86_64-redhat-linux/4.4.1/../../../../lib64/libmapnik.so: undefined reference to `agg::bisectrix(agg::line_parameters const&, agg::line_parameters const&, int*, int*)'
/usr/lib/gcc/x86_64-redhat-linux/4.4.1/../../../../lib64/libmapnik.so: undefined reference to `agg::trans_affine::multiply(agg::trans_affine const&)'
/usr/lib/gcc/x86_64-redhat-linux/4.4.1/../../../../lib64/libmapnik.so: undefined reference to `agg::vcgen_dash::add_vertex(double, double, unsigned int)'
/usr/lib/gcc/x86_64-redhat-linux/4.4.1/../../../../lib64/libmapnik.so: undefined reference to `agg::vcgen_dash::vcgen_dash()'
/usr/lib/gcc/x86_64-redhat-linux/4.4.1/../../../../lib64/libmapnik.so: undefined reference to `agg::vcgen_stroke::add_vertex(double, double, unsigned int)'
/usr/lib/gcc/x86_64-redhat-linux/4.4.1/../../../../lib64/libmapnik.so: undefined reference to `agg::vcgen_dash::remove_all()'
/usr/lib/gcc/x86_64-redhat-linux/4.4.1/../../../../lib64/libmapnik.so: undefined reference to `agg::vcgen_dash::add_dash(double, double)'
/usr/lib/gcc/x86_64-redhat-linux/4.4.1/../../../../lib64/libmapnik.so: undefined reference to `agg::vcgen_stroke::vertex(double*, double*)'
/usr/lib/gcc/x86_64-redhat-linux/4.4.1/../../../../lib64/libmapnik.so: undefined reference to `agg::vcgen_stroke::rewind(unsigned int)'
/usr/lib/gcc/x86_64-redhat-linux/4.4.1/../../../../lib64/libmapnik.so: undefined reference to `agg::line_parameters::s_diagonal_quadrant'
/usr/lib/gcc/x86_64-redhat-linux/4.4.1/../../../../lib64/libmapnik.so: undefined reference to `agg::vcgen_dash::rewind(unsigned int)'
/usr/lib/gcc/x86_64-redhat-linux/4.4.1/../../../../lib64/libmapnik.so: undefined reference to `agg::vcgen_dash::vertex(double*, double*)'
collect2: ld returned 1 exit status

Looking at the recently mapnik build, it seems like the .so isn't adding -lagg to the link step, so it's not seeing that it needs that? 

I don't see any requires generated on agg in the latest build of mapnik at all. 

Happy to provide more info. Please fix so I can fix gpsdrive. ;) 
Also, if you want to just rebuild gpsdrive when you change mapnik, feel free to just drop me an email or irc note and do so.

Comment 1 Christopher Brown 2009-08-28 09:13:03 UTC
Hi Kevin,

Am away at the moment and Cristian appears non-responsive. I will get this resolved but it might be at least a week until that happens.

Alex might want to have a poke - I think this is just the external agg variable in the build which is wrong.

Cheers

Comment 2 Caolan McNamara 2009-09-11 14:54:21 UTC
couple of things here

a) the generated mapnik.pc isn't right. 
-I${includedir}/%{name}
needs to be escaped, otherwise expanded as a variable which isn't what you want. While we're at it, the .pc should capture that mapnik needs to be linked against agg2, best to use...

# install pkgconfig file
cat > %{name}.pc <<EOF
prefix=%{_prefix}
exec_prefix=%{_prefix}
includedir=%{_includedir}

Name: %{name}
Description: Free Toolkit for developing mapping applications
Version: %{version}
Requires: libagg
Libs: -lmapnik
Cflags: -I\${includedir}/%{name}
EOF

that should do the right thing

b) libmapnik doesn't explicitly link against libagg but does have symbols that needs libagg to be resolved. 

I'd guess that in src/SConscript 

-if env['INTERNAL_LIBAGG']:
-    libraries.insert(0, 'agg')
+libraries.insert(0, 'agg')

would do the right thing. i.e. we still want to link against agg, we just don't want to use the internal includes and lib.

c) Then gpsdrive would ideally ask pkg-config for the right libs and includes to use.

So three patches for these to be attached.

Comment 3 Caolan McNamara 2009-09-11 14:55:21 UTC
Created attachment 360689 [details]
fix the .pc file

fix for the .pc file

Comment 4 Caolan McNamara 2009-09-11 14:56:03 UTC
Created attachment 360690 [details]
fix for mapnik to explicitly link against agg even in the non-internal case

Comment 5 Caolan McNamara 2009-09-11 14:57:16 UTC
Created attachment 360691 [details]
patch against gpsdrive to then use pkgconfig to get the right libs to link against

Comment 6 Tom "spot" Callaway 2009-09-12 20:15:33 UTC
Fixes committed and built in rawhide (0.6.1-3):

http://koji.fedoraproject.org/koji/taskinfo?taskID=1674047

Thanks Caolan. :)

~spot, provenpackager to the rescue.

Comment 7 Christopher Brown 2009-09-13 14:39:57 UTC
Ugh, thanks guys. Sorry for not getting to this sooner...