You are not logged in.
Hi all,
as part of a compilation of a software for genomic alignment, I am running into a compilation error concerning the realtime extensions (librt; part of glibc, I believe) and the asynchronous facility (libaio) libraries. The issue may be as simple as gcc looking for either library in the wrong location.
The relevant line of the makefile is:
DEPS_LIBS = -L/home/michael/binaries/Mauve/libs/lib -lMems-1.6 -lboost_system -lboost_filesystem -lboost_program_options -lboost_iostreams -lrt -lpthread -lGenome-1.3 -lMUSCLE-3.7The resulting error is:
make[2]: Entering directory '/home/michael/binaries/Mauve/build_scripts/build/mauveAligner/src'
g++ -O2 -funroll-loops -fomit-frame-pointer -ftree-vectorize -DCOMMAND_LINE -static -Wl,--whole-archive -lpthread -Wl,--no-whole-archive -o mauveStatic mauveAligner.o -L/home/michael/binaries/Mauve/libs/lib -lMems-1.6 -lboost_system -lboost_filesystem -lboost_program_options -lboost_iostreams -lrt -lpthread -lGenome-1.3 -lMUSCLE-3.7
/usr/bin/ld: cannot find -lrt
collect2: error: ld returned 1 exit statusTo me, this doesn't look like faulty C code, but an inability by gcc to utilize the correct libraries. Any suggestions on resolving this would be appreciated.
Last edited by Michael Gruenstaeudl (2015-07-01 20:29:49)
Offline
The error is most probably caused by the -static option: if this option is passed to g++ then it will try to link the libraries statically and thus will search for librt.a instead of the shared version, however static libraries are not provided by any official package because Archlinux has a strict no-static-libraries policy and so the linking will fail. In order to successfully compile the program, you have to reconfigure it to use shared libraries.
Offline
A thank you to mauritiusdadd for his insightful reply. Upon removing the -static flag from the makefile, the compilation executed normally.
Offline