Bugzilla – Bug 168
build of 3.05 fails under leopard
Last modified: 2010-06-25 18:00:57
You need to log in before you can comment on or make changes to this bug.
On Mac OS X 10.5 (Leopard), ganglia-3.0.5.tar.gz fails to build. Both failures are easily worked around, but of course it would be nice not to: 1) problem: kvm.h, referenced from libmetrics/darwin/metrics.c, is no longer in /usr/include solution: comment out #include kvm.h 2) problem: apr.h has the wrong setting for APR_HAS_SENDFILE, see text solution: do what the error message says and set the flag properly --- ugly error text --- Making all in network_io/unix ganglia-3.0.5/srclib/apr/network_io/unix /bin/sh ganglia-3.0.5/srclib/apr/libtool --silent --mode=compile gcc -g -O2 -DHAVE_CONFIG_H -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp -I../../include -I../../include/arch/unix -I../../include/arch/unix -c sendrecv.c && touch sendrecv.lo sendrecv.c:965:2: error: #error APR has detected sendfile on your system, but nobody has written a sendrecv.c:966:2: error: #error version of it for APR yet. To get past this, either write apr_sendfile sendrecv.c:967:2: error: #error or change APR_HAS_SENDFILE in apr.h to 0. --- end error text ---
For 1), I am not sure whether starting with Leopard, KVM is no longer supported by Darwin -- if so, the following patch would fix the problem: Index: libmetrics/darwin/metrics.c =================================================================== --- libmetrics/darwin/metrics.c (revision 1004) +++ libmetrics/darwin/metrics.c (working copy) @@ -11,7 +11,12 @@ #include <stdlib.h> #include "interface.h" + +/* kvm.h is no longer in /usr/include for Leopard */ +#ifndef MAC_OS_X_VERSION_10_5 #include <kvm.h> +#endif + #include <sys/sysctl.h> #include <mach/mach_init.h> But I don't know Darwin enough to confirm this -- hopefully someone more knowledgeable can comment on this.
I've tried the patch suggested, but it doesn't quite work. stdlib.h does not include AvailabilityMacros.h. I do get a compile if I #include "AvailabilityMacros.h" before the #ifndef suggested.
For problem 1), see also bug 258: http://bugzilla.ganglia.info/cgi-bin/bugzilla/show_bug.cgi?id=258