[collectd] Problems under FreeBSD

Oleg King king2 at kaluga.ru
Fri Mar 28 19:05:46 CET 2008


Hello all! (and sorry for my english)

I have tried to build collectd undere FreeBSD and met some problems:

1. configure did not detected rrdtools and libstatgrab, so I have to
use --with-rrdtool=/usr/local --with-libstatgrab=/usr/local. Almost
all libs under FreeBSD (and, surely, rrdtool and libstatgrab) are
installed under /usr/local by default. May be, we need to change
some defaults for FreeBSD?

2. Even with additional parameter configure did not found libstatgrab
with following in config.log:
/usr/local/lib/libstatgrab.so: undefined reference to `devstat_selectdevs',
/usr/local/lib/libstatgrab.so: undefined reference to `devstat_getdevs'

This is because -ldevstat needed for libgrabstat (at least on my
FreeBSd 6.1 - 7.0 systems). So I solved this problem by adding
-ldevstat to LIBS, but i'm not sure that it is right way :)

3. configure was not found devstat library working because of probing
getdevs function while such function called devsat_getdevs at least
in FreeBSD 6.2-release and 7.0-release. after patching it was
detected by configure and was succesfully compiled.

All tests was made on this system:
FreeBSD profiler5.f7 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24 19:59:52 UTC 2008 root at logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

libraries was installed with portinstall:
portinstall rrdtool (rrdtool-1.2.26)
portinstall libstatgrab (libstatgrab-0.15)

Sources was obtained with git.

Dry clean patch follows (i merged both changes into one patch because
this is one problem with libdevstat):

----------------------------------------------------------------
diff -pur collectd/configure.in collectd.patched/configure.in
--- collectd/configure.in             2008-03-28 20:44:21.000000000 +0300
+++ collectd.patched/configure.in     2008-03-28 20:35:11.000000000 +0300
@@ -1048,6 +1048,7 @@ AC_ARG_WITH(libstatgrab, [AS_HELP_STRING
        then
                LDFLAGS="$LDFLAGS -L$withval/lib"
                CPPFLAGS="$CPPFLAGS -I$withval/include"
+               LIBS="$LIBS -ldevstat"
                with_libstatgrab="yes"
        else
                with_libstatgrab="$withval"
@@ -1071,7 +1072,7 @@ then
 fi
 if test "x$with_libstatgrab" = "xyes"
 then
-       AC_CHECK_LIB(devstat, getdevs, [with_libdevstat="yes"], [with_libdevstat="no"])
+       AC_CHECK_LIB(devstat, devstat_getdevs, [with_libdevstat="yes"], [with_libdevstat="no"])
 fi
 if test "x$with_libstatgrab" = "xyes"
 then
----------------------------------------------------------------

That's all for now :)

-- 
С уважением,
 Oleg                          mailto:king2 at kaluga.ru




More information about the collectd mailing list