Friday, July 30, 2010

Compiling Ganglia - Errors and problems

Some errors and problems:


My install directory was /opt/ganglia.


Error -
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.

Solution -
Add gcc bin path to PATH environment variable



Error -
checking for pcre.h... no
checking for pcre_compile in -lpcre... no
libpcre not found, specify --with-libpcre=no to build without PCRE support

Solution -
PCRE is not installed.
# wget ftp://ftp.sunfreeware.com/pub/freeware/SOURCES/pcre-8.10.tar.gz
# /usr/local/bin/tar -xzf pcre-8.10.tar.gz
# cd pcre-8.10
# ./configure --prefix=/opt/ganglia
# make && make install

Make sure you add, -I/opt/ganglia/include to CFLAGS environment variable
and -L/opt/ganglia/lib to LDFLAGS after this.



Problem -
Graphs not shown in ganglia or images not shown on ganglia front end.


Reason -
php-gd may not have been installed.
You can do so by ( as root) -
# yum install php-gd
Another reason could be front-end can't find RRD path. Make sure it is set in conf.php


Error -
checking for apr-1-config... no
configure: error: apr-1-config binary not found in path


Reason -
APR is not installed or path of apr-1-config is not available through the PATH environment variable.


Error -
libgcc_s.so.1: open failed: No such file or directory


Solution-
Execute the following:
# ldd gmond
...
libgcc_s.so.1 => (file not found)
...


So gmond can link to libgcc


Add the following to you LDFLAGS
# setenv LDFLAGS $LDFLAGS:-R/yourgccpath/gcc-4.0.3/lib


-R records the runtime search path.


Install again
# ./configure --prefix=/opt/ganglia --sysconfdir=/opt/ganglia/etc
# make && make install


Error -
After installation, while executing gmond
apr_pollset_create failed: Invalid argument

Solution -
In your config file gmond.conf, if there is no udp_recv_channel or tcp_accept_channel
defined, gmond fails to run with this error.
Set "deaf = yes " under "globals"

Error -
/usr/bin/ld: cannot find -lpython2.3
collect2: ld returned 1 exit status
make[4]: *** [modpython.la] Error 1

Solution -
I dont remember exactly how i resolved it.
Most likely it was the linker not being able to find python.
Probably by setting library flags this error was resolved.

Error -
false cru libgetopthelper.a getopt1.o getopt.o getopt_init.o
make[2]: *** [libgetopthelper.a] Error 1

Solution -
Add /usr/ccs/bin to PATH environment variable.

In case of dependency not found errors, you could configure options, like --with-libapr, --with-libconfuse to point to dependency paths.

Error -
Some gm_protocol_xdr.c related warnings and finally build fails with this error

ld: fatal: relocations remain against allocatable but non-writable sections
collect2: ld returned 1 exit status

Solution -
Uninstall the dependency 'confuse' and install it by setting CFLAGS="-O3 -fPIC"
> cd ../confuse-2.7/
> make uninstall
> make clean
> env CFLAGS="-O3 -fPIC" ./configure --prefix=/opt/ganglia
> make && make install

Do a configure, make and make install and you should be good.
 

5 comments:

Anonymous said...

Hello. Thanks for these suggestions. I'm having problem with images on frontend. I have installed php-gd, set paths both in conf.php and gmetad.conf, but with no luck. I still can't see images.
I did custom install, so maybe I did oversee some paths.

Harpreet said...

it should be something to do with setting the correct paths. Also check if the rrd is accumulating the metrics.

Anonymous said...

Apparently, I wanted to change position of rrds directory and it just didn't work. When I made /var/lib/ganglia/rrds directory and pointed rrd to store there graphs, it worked.
Cheers!

Anonymous said...

/usr/bin/ld: cannot find -lpython2.3
collect2: ld returned 1 exit status
make[4]: *** [modpython.la] Error 1


Please tell me how do you solve this.
m stuck at this.

Unknown said...

Kindly help me out i am installing gangilia for the First time in Aix 5.3 when i run make command its giving error.I am using XLC

"libgmond.c", line 15.10: 1506-296 (S) #include file not found.
"libgmond.c", line 37.38: 1506-277 (S) Syntax error: possible missing ')' or ','?
"libgmond.c", line 37.12: 1506-282 (S) The type of the parameters must be specified in a prototype.
"libgmond.c", line 40.8: 1506-166 (S) Definition of function cfg_opt_t requires parentheses.
"libgmond.c", line 41.34: 1506-045 (S) Undeclared identifier CFGF_NONE.
"libgmond.c", line 46.1: 1506-277 (S) Syntax error: possible missing ';' or ','?
"libgmond.c", line 48.8: 1506-166 (S) Definition of function cfg_opt_t requires parentheses.
"libgmond.c", line 49.38: 1506-045 (S) Undeclared identifier CFGF_NONE.
"libgmond.c", line 51.1: 1506-277 (S) Syntax error: possible missing ';' or ','?
"libgmond.c", line 53.8: 1506-166 (S) Definition of function cfg_opt_t requires parentheses.
"libgmond.c", line 54.28: 1506-045 (S) Undeclared identifier CFGF_NONE.
"libgmond.c", line 73.1: 1506-277 (S) Syntax error: possible missing ';' or ','?
"libgmond.c", line 75.8: 1506-166 (S) Definition of function cfg_opt_t requires parentheses.
"libgmond.c", line 76.27: 1506-045 (S) Undeclared identifier CFGF_NONE.
"libgmond.c", line 80.1: 1506-277 (S) Syntax error: possible missing ';' or ','?
"libgmond.c", line 82.8: 1506-166 (S) Definition of function cfg_opt_t requires parentheses.
"libgmond.c", line 83.30: 1506-045 (S) Undeclared identifier CFGF_NONE.
"libgmond.c", line 84.21: 1506-045 (S) Undeclared identifier access_opts.
"libgmond.c", line 84.34: 1506-045 (S) Undeclared identifier CFGF_MULTI.
"libgmond.c", line 86.1: 1506-277 (S) Syntax error: possible missing ';' or ','?
"libgmond.c", line 88.8: 1506-166 (S) Definition of function cfg_opt_t requires parentheses.
"libgmond.c", line 89.31: 1506-045 (S) Undeclared identifier CFGF_NONE.
"libgmond.c", line 97.1: 1506-277 (S) Syntax error: possible missing ';' or ','?
"libgmond.c", line 99.8: 1506-166 (S) Definition of function cfg_opt_t requires parentheses.
"libgmond.c", line 100.31: 1506-045 (S) Undeclared identifier CFGF_NONE.
"libgmond.c", line 104.18: 1506-045 (S) Undeclared identifier acl_opts.
"libgmond.c", line 106.26: 1506-045 (S) Undeclared identifier cfg_true.
"libgmond.c", line 109.1: 1506-277 (S) Syntax error: possible missing ';' or ','?
"libgmond.c", line 111.8: 1506-166 (S) Definition of function cfg_opt_t requires parentheses.
"libgmond.c", line 112.25: 1506-045 (S) Undeclared identifier CFGF_NONE.
"libgmond.c", line 115.18: 1506-045 (S) Undeclared identifier acl_opts.
"libgmond.c", line 119.1: 1506-277 (S) Syntax error: possible missing ';' or ','?
"libgmond.c", line 121.8: 1506-166 (S) Definition of function cfg_opt_t requires parentheses.
make: 1254-004 The error code from the last command is 1.


Stop.
make: 1254-004 The error code from the last command is 1.


Stop.
make: 1254-004 The error code from the last command is 2.


Stop.