Hobbit / XYMON undefined reference to `clock_gettime’

On December 8, 2009, in How-to, by Cubert aka (Cube Dweller)

Hobbit / XYMON does not compile on CentOS 5 and complains about clock_gettime issues.

Error: timefunc.c:55: undefined reference to `clock_gettime’

Here is how to fix this issue.
Download Hobbit-4.2.3.tar.gz
#1 make sure pcre-devel is installed (#~yum install pcre-devel)
#2 add xymon user (#useradd xymon)
#3 set varible for “ltr” (#LIBRTDEF=-lrt)
#4 export varible (#export LIBRTDEF)
#5 Configure Hobbit inside hobbit src directory (#./configure –client)
#6 Compile program (#make)
#7 Install program (#make install)
#8 Start hobbit client (#/home/xymon/client/runclient.sh start)

Afterwards your hobbit / xymon client should be running on your CentOS or Fedora core systems.


cc -o ../client/hobbitd_client -Wl,--rpath=/usr/lib64
hobbitd_client.o
hobbitd_worker.o hobbitd_buffer.o client_config.o
../lib/hobbitclient.a
-L/usr/lib64 -lpcre
../lib/hobbitclient.a(timefunc-client.o): In function `gettimer':
/usr/src/xymon-4.2.3/lib/timefunc.c:55: undefined reference to
`clock_gettime'
../lib/hobbitclient.a(timefunc-client.o): In function `getntimer':
/usr/src/xymon-4.2.3/lib/timefunc.c:67: undefined reference to
`clock_gettime'
collect2: ld returned 1 exit status
make[1]: *** [../client/hobbitd_client] Error 1

If You get the Following Errors:

gcc -o ../client/xymond_client -Wl,--rpath,/usr/lib64 xymond_client.o    xymond_worker.o xymond_buffer.o client_config.o ../lib/xymonclient.a -L/usr/lib64 -lpcre
xymond_worker.o: In function `net_worker_run':
/root/xymon-4.3.0/xymond/xymond_worker.c:292: undefined reference to `locator_init'
/root/xymon-4.3.0/xymond/xymond_worker.c:298: undefined reference to `locator_register_server'
/root/xymon-4.3.0/xymond/xymond_worker.c:312: undefined reference to `locator_serverdown'
xymond_worker.o: In function `net_worker_heartbeat':
/root/xymon-4.3.0/xymond/xymond_worker.c:80: undefined reference to `locator_serverup'
xymond_worker.o: In function `net_worker_run':
/root/xymon-4.3.0/xymond/xymond_worker.c:317: undefined reference to `locator_serverdown'

 

The just Add "locator.o" to CLIENTLIBOBJS in lib/Makefile inside of the XYMON build directory. Then re-run "make" and you should be able to build the client.

Enjoy….

Tagged with:
 

2 Responses to “Hobbit / XYMON undefined reference to `clock_gettime’”

  1. Ronald T. says:

    Hi,

    The just Add “locator.o” to CLIENTLIBOBJS in lib/Makefile inside of the XYMON build directory. Then re-run “make” and you should be able to build the client.

    … That part. I don’t get it. How do i do that?

  2. You need to edit the file inside of the source tree located at /lib/Makefile. Just 2 or3 lines down from the top of file you will see a line that starts with CLIENTLIBOBJS. At the end of that line add a space then type in locator.o

    All your doing is adding a reference to a library it needs to complete the build process. Not sure why XYMon has not fixed this.
    It has been this way for several releases.

    Cubert

Leave a Reply

*



%d bloggers like this: