Bugzilla – Bug 143
2.5.7's pbs_mom fails to link: u_threadpool.c:246: undefined reference to `clock_gettime'
Last modified: 2011-06-30 14:10:41 MDT
You need to log in before you can comment on or make changes to this bug.
I get the following error, when building Torque 2.5.7 on openSUSE. The problem is that the package is linked with --as-needed, which fails if "-lrt" is specified before "../lib/Libutils/libutils". gcc -fomit-frame-pointer -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -fno-strict-aliasing -std=gnu99 -fstack-protector -D_LARGEFILE64_SOURCE -o .libs/pbs_mom catch_child.o mom_comm.o mom_inter.o mom_main.o mom_server.o prolog.o requests.o start_exec.o checkpoint.o tmsock_recov.o req_quejob.o job_func.o attr_recov.o dis_read.o job_attr_def.o job_recov.o process_request.o reply_send.o resc_def_all.o job_qs_upgrade.o linux/libmommach.a -lpthread -lrt -lutil ../lib/Libattr/libattr.a ../lib/Libsite/libsite.a ../lib/Libutils/libutils.a ../lib/Libpbs/.libs/libtorque.so ../lib/Libutils/libutils.a(u_threadpool.o): In function `work_thread': /usr/src/packages/BUILD/torque-2.5.7/src/lib/Libutils/u_threadpool.c:246: undefined reference to `clock_gettime' collect2: ld returned 1 exit status make[3]: *** [pbs_mom] Error 1 make[3]: Leaving directory `/usr/src/packages/BUILD/torque-2.5.7/src/resmom' Patch: diff -rup ../torque-2.5.7-orig//src/resmom/Makefile.am ./src/resmom/Makefile.am --- ../torque-2.5.7-orig//src/resmom/Makefile.am 2011-06-01 21:40:00.000000000 +0200 +++ ./src/resmom/Makefile.am 2011-06-30 18:29:35.000000000 +0200 @@ -18,7 +18,7 @@ PBS_LIBS = ../lib/Libattr/libattr.a \ EXTRA_DIST = rm_dep.h sbin_PROGRAMS = pbs_mom pbs_demux -LDADD = @PBS_MACH@/libmommach.a $(MOMLIBS) $(PBS_LIBS) +LDADD = @PBS_MACH@/libmommach.a $(PBS_LIBS) $(MOMLIBS) pbs_mom_SOURCES = catch_child.c mom_comm.c mom_inter.c mom_main.c \ mom_server.c prolog.c requests.c start_exec.c \ diff -rup ../torque-2.5.7-orig//src/resmom/Makefile.in ./src/resmom/Makefile.in --- ../torque-2.5.7-orig//src/resmom/Makefile.in 2011-06-13 19:45:41.000000000 +0200 +++ ./src/resmom/Makefile.in 2011-06-30 18:29:41.000000000 +0200 @@ -373,7 +373,7 @@ PBS_LIBS = ../lib/Libattr/libattr.a \ ../lib/Libpbs/libtorque.la EXTRA_DIST = rm_dep.h -LDADD = @PBS_MACH@/libmommach.a $(MOMLIBS) $(PBS_LIBS) +LDADD = @PBS_MACH@/libmommach.a $(PBS_LIBS) $(MOMLIBS) pbs_mom_SOURCES = catch_child.c mom_comm.c mom_inter.c mom_main.c \ mom_server.c prolog.c requests.c start_exec.c checkpoint.c \ tmsock_recov.c req_quejob.c job_func.c ../server/attr_recov.c \
The patch has been added to the 2.5-fixes branch and will be part of the 2.5.8 build.