I've been trying to build the trunk version of Ganglia on an OpenBSD 4.1 box recently, and it isn't for the faint of heart. Rather, I should say that debugging autoconf/automake foibles isn't for the faint of heart.

Background info:

OpenBSD 4.1 (release)
apr-1.2.7
libconfuse-2.5p0
automake (GNU automake) 1.9.6
autoconf (GNU Autoconf) 2.59

Everything is installed as a package, if possible, and from /usr/ports, if not.

After running the bootstrap script, I call:
  ./configure --with-libapr=/usr/local --with-libconfuse=/usr/local

For some reason, libexpat is found automatically, and I don't need to indicate a location, even though it also resides in /usr/local.

Initially, the configure script was "unable to find libconfuse", even though it is installed and usable. After much digging, I found that libconfuse has dependencies on libintl and libiconv. These two libraries are not included in LDFLAGS for that section of the configure script, and test compile would then fail. The error is a misleading since it *found* the library; it just couldn't compile something using it. (not blaming this on Ganglia, since it's an autoconf issue)

I'm no expert on autoconf, but I think that this small patch fixes this problem on OpenBSD:

--- configure.in.orig   Wed Nov 28 16:34:39 2007
+++ configure.in        Wed Nov 28 16:53:16 2007
@@ -339,7 +339,7 @@
   echo Checking for confuse
   if test x"$libconfusepath" != x && test x"$libconfusepath" != xyes ; then
     CFLAGS="$CFLAGS -I$libconfusepath/include"
-    LDFLAGS="$LDFLAGS -L$libconfusepath/lib"
+    LDFLAGS="$LDFLAGS -L$libconfusepath/lib -lintl -liconv"
     echo "Added -I$libconfusepath/include to CFLAGS"
     echo "Added -L$libconfusepath/lib to LDLAGS"
   fi


Unfortunately, the problems don't end there; there are issues with apr.

For some reason, APR_CONFIG and APR_INCLUDES are not properly set in any of the resulting Makefiles, nor is set in config.log. The configure script does find apr-1-config though, as shown in the output from ./configure:

  Checking for apr
  Added -I/usr/local/include to CFLAGS
  Added -I/usr/local/lib to LDLAGS
  checking for apr_socket_send in -lapr-1... yes
The ganglia utilities use the Apache Portable Runtime functions (http://www.apache.org/)
  Found a suitable libapr1 library


The solution I found to fix this problem is much less elegant:

find . -name Makefile | xargs perl -pi \
  -e 's,APR_INCLUDES =.*,APR_INCLUDES = -I/usr/local/include/apr-1,;' \
  -e 's,^(CFLAGS = .*),$1 -I/usr/local/include/apr-1,;'

I think that if APR_CONFIG were properly set, then APR_INCLUDES (and CFLAGS!) would also be fixed as well.

After doing all this, ganglia compiles, and appears to work fine.

--
Jesse Becker
NHGRI Linux support (Digicon Contractor)

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers

Reply via email to