If you run into errors like the following, it's because kvm.h is no longer part of OSX as of release 10.5 (Leopard). Have a look at my instructions on building ganglia for OSX. There's an easy workaround.
Ganglia has this problem with OSX released >= 10.5 (Leopard). A bug report for the kvm.h problem has been created in Ganglia's Bugzilla, and will hopefully be addressed soon. I've put a patch for the problem on my GitHub account in the meantime.
mkdir .libs
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I/opt/local/include -I/usr/X11R6/include -I.. -I../../lib -I../../include -g -O2 -Wall -MT metrics.lo -MD -MP -MF .deps/metrics.Tpo -c metrics.c -fno-common -DPIC -o .libs/metrics.o
metrics.c:14:17: error: kvm.h: No such file or directory
metrics.c: In function ‘proc_run_func’:
metrics.c:658: warning: implicit declaration of function ‘host_processor_sets’
metrics.c:667: warning: implicit declaration of function ‘host_processor_set_priv’
metrics.c:693: warning: implicit declaration of function ‘thread_info’
metrics.c:718: warning: implicit declaration of function ‘vm_deallocate’
metrics.c:631: warning: unused variable ‘ti’
metrics.c:630: warning: unused variable ‘a_task’
metrics.c:626: warning: unused variable ‘port’
metrics.c: In function ‘mem_free_func’:
metrics.c:789: warning: pointer targets in passing argument 4 of ‘host_statistics’ differ in signedness
metrics.c:783: warning: unused variable ‘host_port’
metrics.c: In function ‘mtu_func’:
metrics.c:847: warning: unused variable ‘min’
metrics.c: In function ‘get_netbw’:
metrics.c:966: warning: implicit declaration of function ‘errx’
metrics.c: In function ‘makenetvfslist’:
metrics.c:1263: warning: implicit declaration of function ‘warnx’
metrics.c:1302: warning: assignment makes integer from pointer without a cast
make[4]: *** [metrics.lo] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I/opt/local/include -I/usr/X11R6/include -I.. -I../../lib -I../../include -g -O2 -Wall -MT metrics.lo -MD -MP -MF .deps/metrics.Tpo -c metrics.c -fno-common -DPIC -o .libs/metrics.o
metrics.c:14:17: error: kvm.h: No such file or directory
metrics.c: In function ‘proc_run_func’:
metrics.c:658: warning: implicit declaration of function ‘host_processor_sets’
metrics.c:667: warning: implicit declaration of function ‘host_processor_set_priv’
metrics.c:693: warning: implicit declaration of function ‘thread_info’
metrics.c:718: warning: implicit declaration of function ‘vm_deallocate’
metrics.c:631: warning: unused variable ‘ti’
metrics.c:630: warning: unused variable ‘a_task’
metrics.c:626: warning: unused variable ‘port’
metrics.c: In function ‘mem_free_func’:
metrics.c:789: warning: pointer targets in passing argument 4 of ‘host_statistics’ differ in signedness
metrics.c:783: warning: unused variable ‘host_port’
metrics.c: In function ‘mtu_func’:
metrics.c:847: warning: unused variable ‘min’
metrics.c: In function ‘get_netbw’:
metrics.c:966: warning: implicit declaration of function ‘errx’
metrics.c: In function ‘makenetvfslist’:
metrics.c:1263: warning: implicit declaration of function ‘warnx’
metrics.c:1302: warning: assignment makes integer from pointer without a cast
make[4]: *** [metrics.lo] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
