[collectd] librrd needs now libpng

Niki W Waibel niki.waibel at wipro.com
Wed Nov 22 18:43:39 CET 2006


hi, just tried to compile latest collectd (3.10.3) on solaris10.

it seems that the latest version (1.2.15) of rrdtool needs
-lpng. during configure, collectd does the librrd check
without adding -lpng -> fails always:
===
/opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_destroy_write_struct at PNG12_0'
/opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_write_end at PNG12_0'
/opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_set_compression_level at PNG12_0'
/opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_destroy_read_struct at PNG12_0'
/opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_create_read_struct at PNG12_0'
/opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_read_info at PNG12_0'
/opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_create_write_struct at PNG12_0'
/opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_set_IHDR at PNG12_0'
/opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_set_text at PNG12_0'
/opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_set_filter at PNG12_0'
/opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_create_info_struct at PNG12_0'
/opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_get_image_height at PNG12_0'
/opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_init_io at PNG12_0'
/opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_write_info at PNG12_0'
/opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_get_image_width at PNG12_0'
/opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_malloc at PNG12_0'
/opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_write_image at PNG12_0'
/opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_free at PNG12_0'
===

the following patch can fixes it.
===
diff -u -r collectd-3.10.3.orig/configure collectd-3.10.3/configure
--- collectd-3.10.3.orig/configure      2006-11-04 13:52:31.000000000 +0100
+++ collectd-3.10.3/configure   2006-11-22 18:30:26.496063776 +0100
@@ -36987,7 +36987,7 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lrrd -lm $LIBS"
+LIBS="-lrrd -lm -lpng $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
diff -u -r collectd-3.10.3.orig/configure.in collectd-3.10.3/configure.in
--- collectd-3.10.3.orig/configure.in   2006-11-04 13:52:30.000000000 +0100
+++ collectd-3.10.3/configure.in        2006-11-22 18:28:08.638912995 +0100
@@ -467,7 +467,7 @@
        [
                AC_DEFINE(HAVE_LIBRRD, 1, [Define to 1 if you have the rrd library (-lrrd).])
        ],
-       [with_rrdtool="no (librrd not found)"], [-lm])
+       [with_rrdtool="no (librrd not found)"], [-lm -lpng])
 fi
 if test "x$with_rrdtool" = "xyes"
 then
===
but you might want to
 * check if librrd works without -lpng
 * check if librrd works with -lpng (and add -lpng)
 * fail and assume, that there is no librrd
which makes things more complicated as in the patch above.

it's strange that -lpng needs to be specified, because the other libs, librrd depends on:
===
$ ldd /opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so
        libpng12.so.0 =>         /opt/newlogic/sparc-sun-solaris2.10/lib/libpng12.so.0
        libm.so.2 =>     /lib/libm.so.2
        libart_lgpl_2.so.2 =>    /opt/newlogic/sparc-sun-solaris2.10/lib/libart_lgpl_2.so.2
        libfreetype.so.6 =>      /opt/newlogic/sparc-sun-solaris2.10/lib/libfreetype.so.6
        libz.so.1 =>     /opt/newlogic/sparc-sun-solaris2.10/lib/libz.so.1
        libc.so.1 =>     /lib/libc.so.1
===
do not need to be specified. maybe that's because libpng uses versioned symbols now...

rds, niki
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 185 bytes
Desc: not available
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20061122/22dbb298/attachment.pgp


More information about the collectd mailing list